diff --git a/.changeset/adapter-kit-is-encrypted-payload.md b/.changeset/adapter-kit-is-encrypted-payload.md new file mode 100644 index 0000000000..4e2e1a4729 --- /dev/null +++ b/.changeset/adapter-kit-is-encrypted-payload.md @@ -0,0 +1,7 @@ +--- +"@cipherstash/stack": patch +--- + +`@cipherstash/stack/adapter-kit` now exports `isEncryptedPayload`, the check +model decryption uses to find an encrypted value in a row. The Supabase adapter +uses it to refuse a row it would otherwise return undecrypted. diff --git a/.changeset/auth-device-session-workspace-pin.md b/.changeset/auth-device-session-workspace-pin.md new file mode 100644 index 0000000000..c627b02168 --- /dev/null +++ b/.changeset/auth-device-session-workspace-pin.md @@ -0,0 +1,8 @@ +--- +"@cipherstash/auth": patch +"stash": patch +--- + +`@cipherstash/auth`'s `AutoStrategy` now honours `CS_WORKSPACE_CRN` when you are signed in through the CLI (no access key). The default `@cipherstash/stack` client resolves credentials in `@cipherstash/protect-ffi` and does not pick this up until that package does. Previously the CRN was ignored and the CLI's *current* workspace was used, so switching workspaces with the CLI silently changed which workspace a process authenticated against. Now the session saved for the workspace named by the CRN is used, and every token is checked against that workspace, failing with `WORKSPACE_MISMATCH` otherwise. If no session exists for that workspace, the result is `NOT_AUTHENTICATED`. Without a CRN, behaviour is unchanged. + +The client key (`secretkey.json`) that `stack-encrypt` reads from the CLI profile follows the same workspace, so the token and the client key never come from different ones. diff --git a/.changeset/auth-expiry-and-secret-wiping.md b/.changeset/auth-expiry-and-secret-wiping.md new file mode 100644 index 0000000000..7146e61144 --- /dev/null +++ b/.changeset/auth-expiry-and-secret-wiping.md @@ -0,0 +1,12 @@ +--- +"@cipherstash/auth": patch +--- + +Sign-in and token refresh no longer trust an unbounded `expires_in` from the +auth server. A token lifetime longer than 30 days is treated as 30 days, and a +device code is polled for at most one hour, so an oversized value can no +longer panic the process or wrap to an already-expired token. The buffers that +carry saved tokens and keys to and from `~/.cipherstash`, and an access key +read from `CS_CLIENT_ACCESS_KEY`, are now wiped from memory once used. +A device code's lifetime now runs from when it was issued, and polling stops +at that deadline rather than at the next poll after it. diff --git a/.changeset/cli-drizzle-migrations-out.md b/.changeset/cli-drizzle-migrations-out.md new file mode 100644 index 0000000000..a0df9103bc --- /dev/null +++ b/.changeset/cli-drizzle-migrations-out.md @@ -0,0 +1,5 @@ +--- +'stash': patch +--- + +`stash encrypt drop` and `stash decrypt drop` now write the Drizzle migration to the directory drizzle-kit reports (the `out` in `drizzle.config.ts`) instead of scanning `--migrations-dir`. Previously, when the two differed, the SQL could be written over an older migration with the same name while drizzle-kit journaled an empty stub in the real `out`, so the DROP never shipped. When a scan fallback is needed it matches the exact `_.sql` suffix and refuses to overwrite any file that is not a drizzle-kit scaffold (blank or comment-only), and `--migrations-dir` now warns when drizzle-kit wrote elsewhere. diff --git a/.changeset/eql-cross-query-domain-blockers.md b/.changeset/eql-cross-query-domain-blockers.md new file mode 100644 index 0000000000..e7b840d4d0 --- /dev/null +++ b/.changeset/eql-cross-query-domain-blockers.md @@ -0,0 +1,6 @@ +--- +"@cipherstash/eql": patch +"stash": patch +--- + +Comparing an encrypted column with a different domain's query operand now raises instead of silently returning no rows. For example `public.eql_v3_text_ord = $1::eql_v3.query_text_eq`, or `eql_v3_text_ord < $1::eql_v3.query_text_ord_ope`, previously fell through to native `jsonb` comparison and answered false for equal values. Within a type family, every pair of a column domain and another domain's query operand now resolves to a blocker for the operators both sides support, naming both operands and telling the caller to use the query domain that matches the column. Use the query domain of the column's own domain (`eql_v3.query_`). The install bundle grows by about 1,060 functions and the same number of operators, so a single-transaction uninstall now takes about 8,550 locks (up from about 6,400); raise `max_locks_per_transaction` on busy clusters. diff --git a/.changeset/eql-drop-ignored-query-json-cast.md b/.changeset/eql-drop-ignored-query-json-cast.md new file mode 100644 index 0000000000..c9cb12b546 --- /dev/null +++ b/.changeset/eql-drop-ignored-query-json-cast.md @@ -0,0 +1,5 @@ +--- +'@cipherstash/eql': patch +--- + +Drop the `CREATE CAST (public.eql_v3_json_search AS eql_v3.query_json)` that PostgreSQL always ignored (it warned "cast will be ignored because the source data type is a domain" on every install). `doc::eql_v3.query_json` was never converting; call `eql_v3.to_ste_vec_query(col)` instead. Also corrects the `eql-bindings` wire-format docs: `op` backs `_ord` / `_ord_ope` (and `text_ord` / `text_search` carry `hm` + `op`), `ob` only `_ord_ore`. diff --git a/.changeset/eql-json-array-root-flag.md b/.changeset/eql-json-array-root-flag.md new file mode 100644 index 0000000000..9982dae8c0 --- /dev/null +++ b/.changeset/eql-json-array-root-flag.md @@ -0,0 +1,5 @@ +--- +'@cipherstash/eql': patch +--- + +Encrypted JSON arrays now agree between the Rust/TypeScript bindings and the SQL. `SteVecDocument` models the root `a` array flag that the SQL root validator accepts and the array accessors require, so an array document the database accepts also parses in the bindings. The `a` flag on documents and entries is now optional but not nullable in the generated TypeScript and JSON Schema (`a?: boolean`), matching the SQL CHECK; a `null` is rejected instead of failing later with a cast error. `eql_v3.jsonb_array_length` returns 0 for an empty array (it returned NULL), and `eql_v3.jsonb_array_elements` and `eql_v3.jsonb_document_contains(jsonb[], jsonb)` no longer raise "upper bound of FOR loop cannot be null" on one. diff --git a/.changeset/eql-wrapper-operators-search-path.md b/.changeset/eql-wrapper-operators-search-path.md new file mode 100644 index 0000000000..c28b6cb75c --- /dev/null +++ b/.changeset/eql-wrapper-operators-search-path.md @@ -0,0 +1,25 @@ +--- +'@cipherstash/eql': patch +'stash': patch +--- + +Fix: the `_ord_ore` comparison functions (`eql_v3.lt`, `lte`, `gt`, `gte`, `eq`, +`neq`), and the operators on `_ord_ore` columns when named with their schema +(`col OPERATOR(public.<) $1`), no longer give wrong answers when `public` is not +on the `search_path`. These functions are kept free of a pinned +`search_path` so PostgreSQL can inline them into index scans, which means they +look up their comparison operator through the caller's `search_path`. The ORE +comparison operators live in `public`, so a caller without it, such as a +`SECURITY DEFINER` function with `SET search_path = ''` (the hardening Supabase +recommends), got PostgreSQL's built-in record comparison instead. That compares +the ciphertext bytes, so equality and ordering were silently wrong rather than +raising an error. Every generated comparison function now names its operator +with its schema (`OPERATOR(public.<)` for ORE, `OPERATOR(pg_catalog.<)` for the +HMAC, bloom filter and OPE terms), so the result no longer depends on the +`search_path`, and the functions still inline. A bare `col < $1` still needs +`public` on the `search_path`, because the operators on encrypted columns are +created in `public`; without it, call the function (`eql_v3.lt(col, $1)`) or +name the operator's schema. Reinstall or upgrade EQL to pick up the fix. + +The `stash-postgres` skill now explains how to query encrypted columns from a +function or role whose `search_path` leaves out `public`. diff --git a/.changeset/migrate-readme-column-migration.md b/.changeset/migrate-readme-column-migration.md new file mode 100644 index 0000000000..7009bae52a --- /dev/null +++ b/.changeset/migrate-readme-column-migration.md @@ -0,0 +1,5 @@ +--- +'@cipherstash/migrate': patch +--- + +The README now calls the forward and reverse moves of a column "column migrations", matching the package glossary, instead of "lifecycle". diff --git a/.changeset/nextjs-session-cookie-hardening.md b/.changeset/nextjs-session-cookie-hardening.md new file mode 100644 index 0000000000..00feac4dc0 --- /dev/null +++ b/.changeset/nextjs-session-cookie-hardening.md @@ -0,0 +1,17 @@ +--- +'@cipherstash/nextjs': patch +--- + +Harden the CipherStash session cookie (`__cipherstash_cts_session`). + +- The cookie is now written `httpOnly` and `secure`. It holds a bearer token and nothing in this package reads it client-side; if your own client code read it, move that read to the server. `secure` applies in every environment: browsers accept it from `http://localhost`, but a plain-HTTP development server on another host (a LAN address, for example) will no longer keep the session. +- A session is only reused for the user it was minted for. The cookie now records the issuer and subject (`iss` and `sub`) of the OIDC token it was minted from, and `protectMiddleware` and `protectClerkMiddleware` replace a session left behind by another user (for example after a Clerk multi-session `setActive` switch, or a sign-out on a route the middleware does not match). If a replacement cannot be minted, the stale cookie is cleared. Cookies written by earlier versions carry no owner and are re-minted once. Ownership is read without verifying a signature, so the token you pass to `protectMiddleware` or `getCtsToken` must be one your application has already authenticated. +- `getCtsToken(oidcToken)` only returns the cookie session when it belongs to the issuer and subject of `oidcToken`, and otherwise fetches a fresh session for that token. +- `getCtsToken()` with no argument is deprecated. It returns the session cookie without checking who it belongs to, because it has no identity to compare it with, so pass the user's token whenever you have one. If a user signs out on a route the middleware does not match, call `resetCtsToken` there. +- An expired or malformed session cookie no longer passes through or throws: it is treated as no session and re-minted or cleared by the middleware, instead of returning a 500 on every matched route. +- A successful CTS response is now validated before it is used. A 2xx body that is not an unexpired token (non-JSON, the wrong shape, or an `expiry` already past) is reported as a failure instead of being written to the cookie or thrown out of the middleware. +- `GetCtsTokenResponse` now uses `success: true` and `success: false` as literal discriminants, so checking `result.success` narrows `result.ctsToken` to a `CtsToken`. +- When the middleware replaces or clears the session on a response that continues the request (`NextResponse.next()` or a rewrite), the request forwarded to route handlers and server components is updated in the same request, so `getCtsToken()` there never sees the previous user's session. Next.js does not do this for route handlers on any release tested, from 14.0.0 to 15.5.29. If the response you pass in already overrides the forwarded request headers, the forwarded session cookie is set to the one the middleware decided on, whether your override replaced the cookie or left it out. A session cookie your response already sets is likewise replaced with the kept session, or cleared when none was kept. +- A CTS transport failure (DNS, TLS, connection reset) is reported as a failure instead of throwing, so the middleware still clears a stale session and does not return a 500. The error does not repeat the exception's message, which a fetch wrapper could fill with the request body. +- A rejected Clerk `getToken()` no longer fails the request. It is treated as no token being available, so a stale session is still cleared. +- On Next.js 14.2.8 to 14.2.23 and 15.0.x, Next.js itself sends the session token to the browser in an `x-middleware-set-cookie` response header whenever the session changes, so `httpOnly` does not protect it on those responses. Upgrade to at least 14.2.25 or 15.2.3, which also fix a critical Next.js middleware bypass (GHSA-f82v-jwr5-mffw). diff --git a/.changeset/no-plaintext-search-terms-in-errors.md b/.changeset/no-plaintext-search-terms-in-errors.md new file mode 100644 index 0000000000..bd63d45452 --- /dev/null +++ b/.changeset/no-plaintext-search-terms-in-errors.md @@ -0,0 +1,10 @@ +--- +'@cipherstash/stack': patch +'@cipherstash/stack-supabase': patch +'@cipherstash/stack-prisma': patch +'stash': patch +--- + +Two validation errors no longer quote the caller's search term: a free-text search term that is too short, and a `like`/`ilike` pattern with wildcards the encrypted search cannot honour. Each now reports the term's length instead. + +The Supabase and DynamoDB adapters' error logs now record a failure's kind instead of its full message, which could quote a plaintext value. The kind is the error class plus any known encryption error type, FFI error code or auth code it carries; anything else is left out. The DynamoDB `options.logger` hook now receives a copy of the error whose message is that description, with the same `code`. The full message is still returned to the caller and passed to `errorHandler`. `@cipherstash/stack/adapter-kit` exports the shared `describeFailure` and `likeWildcardError` helpers that produce these messages. diff --git a/.changeset/stash-dynamodb-hmac-narrowing.md b/.changeset/stash-dynamodb-hmac-narrowing.md new file mode 100644 index 0000000000..ec8bafbc22 --- /dev/null +++ b/.changeset/stash-dynamodb-hmac-narrowing.md @@ -0,0 +1,5 @@ +--- +'stash': patch +--- + +The `stash-dynamodb` skill's query examples now narrow the `encryptQuery` result before reading `hm`. The previous `result.data.hm` did not type-check, because the result type also covers ciphertexts, strings and `null`. diff --git a/.changeset/stash-dynamodb-no-reencryption.md b/.changeset/stash-dynamodb-no-reencryption.md new file mode 100644 index 0000000000..3d6b076d99 --- /dev/null +++ b/.changeset/stash-dynamodb-no-reencryption.md @@ -0,0 +1,5 @@ +--- +'stash': patch +--- + +The `stash-dynamodb` skill now scopes the no-re-encryption upgrade to the tested top-level scalar equality columns and unindexed text written by `@cipherstash/protect-dynamodb@6.0.1`. It explains boolean lookup changes and the privacy cost of a plaintext replacement, stale `__hmac` removal, `downcase` normalization, and the required legacy JSON backfill with its rollback limit. It also clarifies legacy v2 reads and queries using current v3 schemas. diff --git a/.changeset/stash-supabase-skill-plaintext-tables.md b/.changeset/stash-supabase-skill-plaintext-tables.md new file mode 100644 index 0000000000..9f1bce900f --- /dev/null +++ b/.changeset/stash-supabase-skill-plaintext-tables.md @@ -0,0 +1,7 @@ +--- +"stash": patch +--- + +The `stash-supabase` skill now says that tables with no encrypted columns are +read and written through the same `es.from()`, and that an embedded relation to +an encrypted table is refused rather than decrypted. diff --git a/.changeset/supabase-plaintext-table-reads.md b/.changeset/supabase-plaintext-table-reads.md new file mode 100644 index 0000000000..aef7bdccda --- /dev/null +++ b/.changeset/supabase-plaintext-table-reads.md @@ -0,0 +1,17 @@ +--- +"@cipherstash/stack-supabase": patch +--- + +Reading a table that has no encrypted columns no longer fails. Such a table is +not registered with the encryption client, and the adapter still asked the +client to decrypt its rows, so every `select()` on it, and every insert, update +or upsert followed by `.select()`, returned "decryptModel received a table this +client was not initialized with" (or threw, with `throwOnError`). On the +`wasm-inline` entry, writes to such a table failed the same way. The adapter now +passes the rows of a table with no encrypted columns straight through, in both +introspection and declared mode, without calling the encryption client. + +A row from such a table that still holds an encrypted value, from an embedded +relation to an encrypted table or from an undeclared `eql_v3_*` column in +declared mode, is refused with an error naming the column, rather than returned +as ciphertext. diff --git a/.github/impact-gate/requirements.txt b/.github/impact-gate/requirements.txt index f57dfb3ca9..a999807843 100644 --- a/.github/impact-gate/requirements.txt +++ b/.github/impact-gate/requirements.txt @@ -2,12 +2,12 @@ # CI installs it with `pip install --require-hashes --no-deps`, so nothing here # resolves at install time and a transitive dependency cannot float. # -# The top-level pins are impact-gate==0.4.1, lizard==1.24.1 (Lizard 1.24.0 is +# The top-level pins are impact-gate==0.4.1, lizard==1.24.3 (Lizard 1.24.0 is # excluded by ImpactGate's own metadata) and pygments==2.21.0, which # scripts/impact-gate.py imports directly. uv still annotates pygments "via # lizard". To regenerate after changing them, from the repository root: # -# printf 'impact-gate==0.4.1\nlizard==1.24.1\npygments==2.21.0\n' \ +# printf 'impact-gate==0.4.1\nlizard==1.24.3\npygments==2.21.0\n' \ # | uv pip compile - --generate-hashes --universal --python-version 3.12 \ # --no-header -o .github/impact-gate/requirements.txt # @@ -15,9 +15,9 @@ impact-gate==0.4.1 \ --hash=sha256:9d9c8fb4c6f2fa56559d0530ff82569bc6d42b28ff5a77103e504e2470f198c6 \ --hash=sha256:e6dab6abec925151bd4dbffff92d4a40f742d561a6f8527b3fbe15dd68b25518 -lizard==1.24.1 \ - --hash=sha256:746060a3e9a375af7340b2d4c6aab307b8a8b4199339c36ddc7afc4188b53d1c \ - --hash=sha256:c022cf1aac8170994b175e2a700f0535088f66da7e6bdf6c59fbd3b716cd10ac +lizard==1.24.3 \ + --hash=sha256:7d2570ca711288388de1cf0f25512e97fbbc5e189f551c87b4e20d11d028b297 \ + --hash=sha256:f7fccd909719170e323a240cc6927bfea65984d77a8f9c0e6405be582e9861db # via impact-gate pathspec==1.1.1 \ --hash=sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a \ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7939d29e4a..16ab13baeb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -93,7 +93,8 @@ jobs: filters: | js: - '**' - # Plans and ADRs; plan-docs-unread-by-tests.test.mjs holds the + # Plans, ADRs and guides (`direct` selects the guides the jobs + # read); plan-docs-unread-by-tests.test.mjs holds the # plans half for the `paths:` filter above. - '!docs/**' # The Go module, and the Rust crates no binding these jobs build @@ -132,6 +133,10 @@ jobs: filters: | js: - '.github/workflows/tests.yml' + # The Protect upgrade guide, which `e2e-tests` reads: + # e2e/tests/protect-upgrade-guide.e2e.test.ts holds the guide's + # claims to the suites it describes. + - 'docs/migration/**' # The eql-bindings files cargo compiles into the protect-ffi # binding, as `.github/actions/build-ffi-binding` hashes them, # and the EQL workspace manifest cargo reads for them. @@ -581,8 +586,9 @@ jobs: CS_CLIENT_ID: ${{ vars.CS_CLIENT_ID }} CS_CLIENT_KEY: ${{ secrets.CS_CLIENT_KEY }} CS_CLIENT_ACCESS_KEY: ${{ secrets.CS_CLIENT_ACCESS_KEY }} - CS_ZEROKMS_HOST: https://ap-southeast-2.aws.zerokms.cipherstashmanaged.net - CS_CTS_HOST: https://ap-southeast-2.aws.cts.cipherstashmanaged.net + # No CS_ZEROKMS_HOST / CS_CTS_HOST: current clients derive both from the + # CRN, and a pinned region points the shared credentials at the wrong + # deployment (see integration-protect-ffi.yml). steps: - name: Checkout Repo @@ -618,24 +624,24 @@ jobs: client-key: ${{ secrets.CS_CLIENT_KEY }} client-access-key: ${{ secrets.CS_CLIENT_ACCESS_KEY }} - # `e2e/vitest.config.ts` includes `tests/**/*.e2e.test.ts` and the step - # below applies no file filter, so this job runs - # `tests/prisma-example-readme.e2e.test.ts` — whose - # `describe.skipIf(!authConfigured)` un-skips the moment CS_CLIENT_ID and - # CS_CLIENT_KEY are set, which the job env above does. That walkthrough's - # `pnpm start` step encrypts against the live service through - # `@cipherstash/stack`, so it needs `index.node`; turbo's `^build` only - # gets as far as protect-ffi's `build` (tsc → `lib/`), which is the half - # that does not encrypt anything. + # The protect-dynamodb compatibility step at the end of this job + # encrypts against the live service through `@cipherstash/stack`, so it + # needs `index.node`; turbo's `^build` only gets as far as protect-ffi's + # `build` (tsc → `lib/`), which is the half that does not encrypt + # anything. (`tests/prisma-example-readme.e2e.test.ts` would need it too, + # but under turbo's strict env mode the job-level CS_* never reach it, + # so it skips.) # # After the pre-flight above, per # scripts/__tests__/ffi-binding-step-order.test.mjs. No `wasm: true` — # nothing in `e2e/tests/**` loads the WASM build (the Deno smoke test that # does lives in `e2e/wasm/` and runs in `wasm-e2e-tests`). - name: Build the protect-ffi binding + id: ffi-binding uses: ./.github/actions/build-ffi-binding - name: Build the @cipherstash/auth binding + id: auth-binding uses: ./.github/actions/build-auth-binding # Run the standalone `e2e/` workspace via turbo so the `^build` @@ -645,6 +651,75 @@ jobs: - name: Run E2E tests run: pnpm exec turbo run test:e2e --filter @cipherstash/e2e + # The step above runs under turbo's strict env mode, which filters out + # every env var `turbo.json` does not declare, so the job-level CS_* + # never reach vitest there and auth-gated suites skip. The + # protect-dynamodb compatibility suite proves a migration claim made to + # customers, so the default e2e config leaves it out and it runs here + # with `--env-mode=loose`, which lets the credentials through. It fails + # rather than skips if they are missing. + - name: Run the protect-dynamodb compatibility suite + run: pnpm exec turbo run test:protect-compat --filter @cipherstash/e2e --env-mode=loose + + # The DynamoDB <-> Postgres cross-store suite moves protect-dynamodb + # 6.0.1 items into EQL v3 columns and back, so it needs a database. + # `integration-db` gives this job its own compose project and ephemeral + # port; the suite installs EQL v3 itself through the real + # `stash eql install`. Loose env mode for the same reason as above. + # The suite is independent of the preceding test suites, but still + # requires both native bindings. A failed build must not start the DB + # and produce a second set of missing-binding errors. + - name: Start postgres + id: db + if: ${{ !cancelled() && steps.ffi-binding.outcome == 'success' && steps.auth-binding.outcome == 'success' }} + uses: ./.github/actions/integration-db + with: + db: postgres + + - name: Run the DynamoDB <-> Postgres cross-store suite + if: ${{ !cancelled() && steps.db.outcome == 'success' }} + run: pnpm exec turbo run test:protect-crossover --filter @cipherstash/e2e --env-mode=loose + env: + DATABASE_URL: ${{ steps.db.outputs.database-url }} + + # Guarded on the project being set: if the stack never came up there is + # nothing to tear down, and an unguarded `-p ""` would mask the real error. + - name: Stop postgres + if: always() && env.CS_COMPOSE_PROJECT != '' + run: docker compose -p "$CS_COMPOSE_PROJECT" -f "$CS_COMPOSE_FILE" down -v + + # The integration image above is PostgreSQL 17. PostgreSQL 18 records + # NOT NULL constraints in pg_constraint, including the one on a primary + # key's column, so the upgrade example's dependency preflight sees a + # different catalogue there. No postgres-eql image exists for 18; the + # upgrade suite installs EQL v2.2.1 and v3 itself, so the official image + # (pinned by digest) is enough. + - name: Start PostgreSQL 18 + id: db18 + if: ${{ !cancelled() && steps.ffi-binding.outcome == 'success' && steps.auth-binding.outcome == 'success' }} + run: | + docker run -d --name pg18-upgrade -e POSTGRES_PASSWORD=password \ + -p 127.0.0.1::5432 \ + postgres:18@sha256:e3d24f6906d0760bf4da0dae872415391ededefad23fd471c47dc53b0ddf3c42 + # Probe over TCP: the init-time server listens on the socket only. + for _ in $(seq 1 60); do + docker exec pg18-upgrade pg_isready -h 127.0.0.1 -U postgres -q && break + sleep 1 + done + docker exec pg18-upgrade pg_isready -h 127.0.0.1 -U postgres + port="$(docker port pg18-upgrade 5432/tcp | head -n1 | sed 's/.*://')" + echo "database-url=postgres://postgres:password@127.0.0.1:${port}/postgres" >> "$GITHUB_OUTPUT" + + - name: Run the Postgres upgrade example on PostgreSQL 18 + if: ${{ !cancelled() && steps.db18.outcome == 'success' }} + run: pnpm exec turbo run test:protect-crossover --filter @cipherstash/e2e --env-mode=loose -- tests/protect-postgres-upgrade.e2e.test.ts + env: + DATABASE_URL: ${{ steps.db18.outputs.database-url }} + + - name: Stop PostgreSQL 18 + if: always() && steps.db18.outcome != 'skipped' + run: docker rm -f pg18-upgrade || true + # Verifies @cipherstash/stack/wasm-inline works under Deno — i.e. the # WASM build of protect-ffi 0.26+ and auth 0.40+ can round-trip an # encryption against ZeroKMS / CTS in a runtime with no native diff --git a/AGENTS.md b/AGENTS.md index 20a056d9e9..b3494d5e63 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -94,6 +94,7 @@ Every npm package except EQL lives under `languages/typescript/`: packages in `l - `languages/typescript/packages/auth`, `languages/typescript/packages/profile`, `languages/typescript/packages/stack-auth-wasm`: The node bindings of those crates. `@cipherstash/auth` (napi-rs v2) and its six `platforms/*` packages are published to npm from this repository by `release.yml` (`auth-artifacts`, `publish-auth`); a change to what it ships, the `stack-auth` crate included, needs an `@cipherstash/auth` changeset (`require-auth-npm-changeset.yml`). `@cipherstash/profile` and its platforms are private and never published; `@cipherstash/stack-auth-wasm` is private and builds the wasm that `@cipherstash/auth` ships. Their `build` and `test` scripts never invoke cargo; `build:native`, `build:debug` and `test:cargo` do. - `languages/golang`: The Go module — the SDK `encrypt` with its generated-code support `encrypt/gensupport` and the policy packages `encrypt/policy` and `encrypt/policy/protosource`; the credential package `auth`; the generator `stashgen` and its command `cmd/stashgen`; and `internal` (the shared guest plumbing and the `record` wire model). A wazero host with no cgo. Its two WASI guests (`encrypt/guest`, `auth/guest`) are detached Cargo workspaces built by `mise run wasm:guest:build` and `mise run wasm:auth-guest:build`; `mise run wasm:guest:build:deterministic` builds the seeded TEST build the hermetic Go tests use; the `.wasm` files they embed are gitignored. The stack-encrypt guest has a second build with the EQL types (`mise run wasm:guest:build:eql`, cargo feature `eql`, linking `eql-bindings` by path; `wasm:guest:build:eql:deterministic` is its test build), embedded by `encrypt/eql` and registered on import, so a program whose generated code names an EQL type runs it (ADR-0007, amended). `encrypt/eql`'s types and `Types` table are generated from the EQL catalog by `eql-codegen` (`eql_gen.go`, written by `mise run types:generate` in `packages/eql` and drift-gated by `types:check` and `cargo test -p eql-codegen`). Generated `*_stash.go` files are committed and CI fails when `go generate ./...` changes one. Releases are cut by hand with `.github/workflows/release-golang.yml` (`gh workflow run release-golang.yml -f version=X.Y.Z[-pre] --ref `): because the guests are gitignored on main and Go fetches a version as the files committed at its tag, the workflow builds them, commits them on a release-only commit no branch points at, tags it `languages/golang/vX.Y.Z` and pushes the tag alone, then attaches the EQL v4 SQL bundle to the GitHub release. The ref must carry the EQL v4 bundle, or the build stops at "Build the EQL SQL bundles". `scripts/go-release-version.mjs` refuses, before anything is built, every version Go would refuse (non-canonical semver, `+build` metadata, a v2+ major on a module path with no `/vN` suffix, a version shaped like a pseudo-version), a final version dispatched from anywhere but `main`, and a final version while `languages/golang/go.mod` pins a `github.com/cipherstash/vitaminc/…` module at a pseudo-version (vitaminc's Go bindings have no tags, and a TEMPORARY pin on an unreleased commit must be gone before the module is tagged); a pre-release may come from a branch and may carry such a pin. The build job also refuses a version the Go proxy already lists in `@v/list`, which catches a tag deleted after the proxy fetched it; it never asks the proxy for the version itself before the tag exists, because the proxy would cache "not found" for up to 30 minutes and `verify` would fail after the push. The build checks the `Cargo.lock` of the EQL workspace and both guest workspaces with `--locked` first, since none of those builds passes it. It runs in a job with no write token and hands the guests to a `publish` job that holds `contents: write` and runs only git and gh. `publish` fetches the commit with plain unauthenticated git rather than `actions/checkout`, whose `token` input defaults to the job's writable token, and refuses a release commit whose tree is not the one the build tested. `publish` takes the paths it commits from the workflow's fixed `GUESTS` list, never from the artifact, and refuses a `guests.sha256` that is not exactly one SHA-256 line for each of those three guests: the build job runs third-party code after writing that manifest, so a path read from it could put any file on the tag (`scripts/__tests__/go-release-artifact.test.mjs`). A version is immutable once the Go proxy has fetched it, so a tag is never moved or deleted: if `publish` or `verify` fails after the tag is pushed, use "Re-run failed jobs" on the same run, which keeps a tag that run pushed and creates or completes the release; a new dispatch of the same version is refused. Never tag a main commit by hand: `go get` would fetch a module with no guests. - `e2e/*`: Cross-package end-to-end tests (package managers, supply chain, Prisma example README) +- `e2e/migration-guide`: Unpublished, separately installed npm examples for the Protect/EQL v2 to Stack/EQL v3 guide. See its README before running; Postgres requires a disposable database and DynamoDB persistence is in memory. - `languages/typescript/examples/*`: Working apps (basic, prisma, supabase-worker) - `docs/plans/*`: Internal design plans. User-facing documentation lives at https://cipherstash.com/docs (not in this repo). - `skills/*`: Agent skills (`stash-cli`, `stash-encryption`, `stash-indexing`, `stash-deployment`, `stash-zerokms`, `stash-auth`, `stash-postgres`, `stash-edge`, `stash-drizzle`, `stash-dynamodb`, `stash-supabase`, `stash-prisma`, `stash-managed-platforms`, `stash-supply-chain-security`) diff --git a/CONTEXT-MAP.md b/CONTEXT-MAP.md index af93fdfbdf..c67b2a45e8 100644 --- a/CONTEXT-MAP.md +++ b/CONTEXT-MAP.md @@ -7,6 +7,11 @@ - [Stack Encrypt](./packages/stack-encrypt/CONTEXT.md) — encrypts values under per-value ZeroKMS data keys and derives searchable terms from them, for Rust and, through a WASI guest, Go. +- [Migrate](./languages/typescript/packages/migrate/CONTEXT.md) — moves an + existing column between plaintext and encrypted form, resumably, for the + Stack CLI and customer workers. +- [Migration Harness](./e2e/migration-harness/CONTEXT.md) — tests the + Protect.js upgrade guide by having agents follow it and judging the result. ## Relationships @@ -18,3 +23,6 @@ - **Stack Encrypt → EQL**: Stack Encrypt seals values and renders the ZeroKMS descriptor; EQL's `eql-bindings` transcodes those into EQL payloads, and its `Identifier` (a table and a column) is a two-segment Stack Encrypt `Label`. +- **Migrate → Stack CLI**: the Stack CLI drives each column migration through + `stash encrypt *` and `stash decrypt *`; Migrate records it and owns its + rules, including the forced-pass obligation, so embedded workers get them too. diff --git a/Cargo.lock b/Cargo.lock index c452341fd1..9ed9883beb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2283,9 +2283,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open" -version = "5.4.4" +version = "5.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa576c76302b7b808eecc68061e67336c47833ef9d22caa74dda10fa9675eebc" +checksum = "8d8c8b8e725ad26404d6896eb2f064294a0a7b4f1d9120210d85544684c4ca95" dependencies = [ "is-wsl", "libc", @@ -3521,6 +3521,7 @@ dependencies = [ "tempfile", "thiserror 1.0.69", "uuid", + "zeroize", ] [[package]] @@ -3776,9 +3777,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.53.3" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -4194,9 +4195,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" dependencies = [ "atomic", "getrandom 0.4.2", diff --git a/SECURITY.md b/SECURITY.md index 8c44a1d228..acaea5909e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -51,6 +51,12 @@ a fake key source, executes the Rustdoc text encryption example, and provides optional disposable PostgreSQL coverage. It adds no published package or production service. +`e2e/migration-guide` is an unpublished npm example package, outside the +workspace release pipeline. It uses live encryption credentials and a disposable +Postgres database; its DynamoDB example persists items only in memory. It is +not a production migration service. Reports of unsafe migration guidance are +in scope as documentation/code-example issues. + > **Note on publishing.** Every package in the table above, including all > seven `@cipherstash/protect-ffi*` packages, all seven `@cipherstash/auth*` > packages and `@cipherstash/eql`, is published from this repository by diff --git a/biome.json b/biome.json index e6e9dd28f2..f0b81b9a2f 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.5.3/schema.json", + "$schema": "https://biomejs.dev/schemas/2.6.4/schema.json", "files": { "includes": [ "**", @@ -49,6 +49,8 @@ "!languages/typescript/packages/profile/native.d.ts", "!languages/golang", "!**/*.grit", + "!**/*.yml", + "!**/*.yaml", "!**/*.generated.ts", "!**/contract.json", "!**/contract.d.ts", @@ -74,6 +76,11 @@ "unsafeParameterDecoratorsEnabled": true } }, + "markdown": { + "formatter": { + "enabled": false + } + }, "linter": { "rules": { "suspicious": { diff --git a/docs/migration/protect-dynamodb-to-stack.md b/docs/migration/protect-dynamodb-to-stack.md new file mode 100644 index 0000000000..25fb522103 --- /dev/null +++ b/docs/migration/protect-dynamodb-to-stack.md @@ -0,0 +1,378 @@ +# Upgrade Protect/EQL v2 to Stack/EQL v3 on DynamoDB and PostgreSQL + +EQL (Encrypt Query Language) v2 and v3 identify data generations, **not npm package majors**. This guide targets Stack **1.2.1**, using `@cipherstash/stack/v3`. It does not migrate data to EQL v4. + +Choose the procedure for your existing store: + +- **DynamoDB:** follow the scalar compatibility explanation and steps 1–7 below. +- **PostgreSQL with existing EQL v2 columns:** follow [PostgreSQL v2 → v3](#postgresql-v2--v3). Copying DynamoDB attributes into an already-v3 database is a separate optional example, not this database upgrade. + +For both procedures, inventory your schema and queries, retain access to the original workspace/keyset, take a recoverable backup, and rehearse on a disposable copy before deployment. Install Node.js 22 or later (22.18+ for the executable TypeScript examples). Keep the four `CS_*` credentials available, but do not commit them. The package upgrade and database conversion are separate steps; installing a new SDK does not change existing PostgreSQL column types. + +This guide moves an app from `@cipherstash/protect@10.2.1` and `@cipherstash/protect-dynamodb@6.0.1` to `@cipherstash/stack` 1.x. These versions also pull in `@cipherstash/protect-ffi@0.18.1` and `@cipherstash/schema@2.0.2`; the legacy versions are removed with Protect. Stack still depends on its own newer `@cipherstash/protect-ffi`. + +For the tested top-level text, numeric and boolean attributes, existing ciphertext can stay **untouched**. Stack decrypts it as stored; text and numeric equality terms remain compatible when the schema and normalization rules below are followed. Boolean lookups need an application change, and legacy `dataType('json')` attributes need a separate conversion before the standard Stack adapter can read them. The no-backfill path does not cover those JSON attributes. Go straight to Stack 1.x; an intermediate hop through `@cipherstash/stack` 0.19 adds nothing (`compat › Stack 0.19 re-writes the same attributes and the same __hmac values Protect wrote`). + +Compatibility claims below cite their supporting tests, prefixed with the suite it lives in (compat › *test name*): + +- `compat` is `e2e/tests/protect-dynamodb-compat.e2e.test.ts`. +- `crossover` is `e2e/tests/protect-crossover.e2e.test.ts`. +- `postgres-upgrade` is `e2e/tests/protect-postgres-upgrade.e2e.test.ts`. +- `example` is `e2e/tests/protect-guide-example.e2e.test.ts`. + +Both suites produce item objects with the real Protect.js versions above, installed from npm, and read them back with the in-tree Stack package (currently 1.2.1). They test live encryption, but do not contact DynamoDB: item persistence and HMAC matching are simulated in memory. The crossover suite also runs real Postgres inserts and SQL queries. This verifies adapter compatibility, not AWS expressions, GSI configuration or a deployed customer application. They run on every pull request in the `e2e-tests` job of `.github/workflows/tests.yml`. Both need `CS_WORKSPACE_CRN`, `CS_CLIENT_ID`, `CS_CLIENT_KEY` and `CS_CLIENT_ACCESS_KEY`, supplied in the environment, `e2e/.env` or the repository-root `.env`. The crossover suite also needs `DATABASE_URL` for a disposable Postgres database where it can install EQL and create tables. From an installed repository checkout, build the native binding and run through Turbo so workspace dependencies are built: + +```bash +pnpm --filter @cipherstash/protect-ffi run build:native +pnpm exec turbo run test:protect-compat --filter @cipherstash/e2e --env-mode=loose +pnpm exec turbo run test:protect-crossover --filter @cipherstash/e2e --env-mode=loose +``` + +The native build needs the repository's Rust toolchain and trusted mise configuration. These commands are for maintainers verifying the guide; a customer installing Stack from npm receives prebuilt binaries. The crossover task also runs the PostgreSQL upgrade and executable DynamoDB example. Credentialed tests fail if configuration is missing; a skipped or unrun suite is not migration evidence. + +The [executable examples](../../e2e/migration-guide/README.md) use npm and the pinned customer packages. Run them on disposable data. The DynamoDB example uses in-memory item persistence and exercises legacy reads, new writes, normalization, bigint serialization and boolean updates (`example › runs the npm DynamoDB example through legacy reads, new writes and boolean updates`). It is not an AWS deployment test. + +## Why the supported scalar attributes need no re-encryption + +protect-dynamodb stores each encrypted attribute as at most two strings, with no EQL version on disk (`compat › stores only __source and __hmac — no EQL version on disk`): + +- `__source` is the ciphertext. +- `__hmac` is the equality term, present only on columns with an equality index. + +Stack reads and writes the same two attributes: + +- It decrypts a legacy `__source` with no read option (`compat › every legacy item decrypts, one at a time, with no read option`, `compat › every legacy item decrypts in one bulk call`), and gets the same plaintext protect-dynamodb does (`compat › agrees with what protect-dynamodb itself decrypts`). +- Its `encryptQuery` mints the same `__hmac` that protect-dynamodb's `createSearchTerms` did (`compat › matches protect-dynamodb createSearchTerms for the same value`), so the tested text and numeric equality queries match the expected legacy items (`compat › every equality query finds exactly the legacy rows it should`). +- A new Stack write sits beside legacy items, and one query and one bulk read cover both (`compat › new Stack writes sit beside legacy items: one query and one bulk read cover both`). +- Reading and querying leave the stored items byte-identical (`compat › Stack's reads and queries left every stored item byte-identical`). +- A tampered ciphertext fails to decrypt; it never returns wrong plaintext (`compat › fails, never returns wrong plaintext, when the ciphertext is tampered with`). + +## Steps + +### 1. Inventory the schema + +List every `csTable` and `csColumn` the app declares, with its `dataType` and index (`equality()`, `equality([{ kind: 'downcase' }])`, or none). Find every `createSearchTerms` call, every `UpdateItem` that sets an encrypted attribute, and every query that filters on a boolean `__hmac`. + +Done when every column has a row in the mapping table in step 3, and every column outside that table is listed as untested (see "Outside what the tests cover"). + +### 2. Swap the packages + +```bash +npm uninstall @cipherstash/protect @cipherstash/protect-dynamodb +npm install --save-exact @cipherstash/stack@1.2.1 +``` + +If the app's `package.json` also declares `@cipherstash/schema` or `@cipherstash/protect-ffi` directly, remove those with `npm uninstall`. Commit the resulting package manifest and lockfile. Stack retains its own newer FFI dependency; do not remove that transitive dependency. + +Stack needs Node.js 22 or later. It reads the same four `CS_*` variables from the environment, so retain the same workspace and key access used to write the data. If the app passed credentials explicitly to Protect, populate these environment variables or configure the equivalent Stack credentials. If the app passed a `keyset` to `protect()`, pass the same keyset to `Encryption` as `config.keyset`. A client bound to a different keyset either fails to decrypt or, if it was granted the old keyset, decrypts but mints terms that match no existing `__hmac`. Keysets are untested by these suites. + +Stack finds its service endpoints from `CS_WORKSPACE_CRN`. Protect 10.2.1 did not: outside `ap-southeast-2` it needed `CS_CTS_HOST` and `CS_ZEROKMS_HOST` set explicitly. Stack still honours both variables when they are set, so remove them from ordinary managed deployments. Keep them only for a deliberately configured private or custom endpoint, and check that endpoint before relying on it. + +Done when `npm ls --all` shows `@cipherstash/stack` and its own dependencies (including its own newer `@cipherstash/protect-ffi`), and no `@cipherstash/protect@`, `@cipherstash/protect-dynamodb` or `@cipherstash/schema` line. + +### 3. Translate the schema + +Keep every **property key** exactly as it was. Stack finds `__source` by property key, and a renamed key does not fail: the read returns the raw ciphertext under the old attribute name and leaves the new key unset (`compat › passes raw ciphertext through, with no failure, when a property key was renamed`). The table name and DB column names are free to change; neither is needed to decrypt or to mint the term (`compat › decrypts under a renamed table and renamed DB column names`, `compat › the HMAC is bound to neither table nor column`). Keeping them the same is simplest. + +| Protect 10.2.1 column | Stack 1.x domain | Notes | Proved by | +|---|---|---|---| +| `csColumn(k).equality()` (text) | `types.TextEq(k)` | | `compat › %s: Stack %s encryptQuery reproduces the stored __hmac` | +| `csColumn(k).dataType('number').equality()` | `types.IntegerEq(k)` for whole numbers, `types.DoubleEq(k)` for fractions | Choose a domain that represents the data; whole-number and fractional compatibility are tested | `compat › IntegerEq and DoubleEq queries match the legacy whole-number HMAC`, `compat › DoubleEq preserves fractional number reads, writes and equality terms` | +| `csColumn(k).dataType('bigint').equality()` | `types.BigintEq(k)` | Reads return a JS `bigint`, not a `number`; the value is unchanged | `compat › changes the JS type of a bigint column, but not its value` | +| `csColumn(k).equality([{ kind: 'downcase' }])` | `types.TextEq(k)` | The app now lowercases: see step 5 | `compat › a v2 downcase filter is reproduced only by lowercasing first` | +| `csColumn(k).dataType('boolean').equality()` | `types.Boolean(k)` | Decrypts, but is no longer queryable: see step 5 | `compat › the one query a Stack 1.x app cannot mint is a boolean equality, with or without a rewrite` | +| `csColumn(k)` (text, no index) | `types.Text(k)` | Text only; unindexed number, bigint and boolean columns are untested | `compat › every legacy item decrypts, one at a time, with no read option` | +| `csColumn(k).dataType('json')` | `types.Json(k)`, after a one-off backfill | Requires conversion for the standard adapter: see step 5 | `compat › backfills to a types.Json item that Stack 1.x reads` | +| `csColumn(k).dataType('date')` | No verified mapping | The tested date inputs fail to encrypt in Protect 10.2.1; investigate any existing date attributes separately | `compat › protect 10.2.1 rejects the tested date inputs` | + +Give each supported text or numeric equality column an `Eq` domain; boolean lookups need the separate treatment in step 5. An `Ord` domain such as `types.IntegerOrd` mints no equality term, so lookups on that column would find nothing (`compat › a numeric *Ord domain emits no HMAC at all`). + +```typescript +// Before +import { csColumn, csTable } from '@cipherstash/protect' + +const users = csTable('users', { + email: csColumn('email').equality(), + emailLower: csColumn('emailLower').equality([{ kind: 'downcase' }]), + age: csColumn('age').dataType('number').equality(), + balance: csColumn('balance').dataType('bigint').equality(), + active: csColumn('active').dataType('boolean').equality(), + notes: csColumn('notes'), +}) + +// After +import { encryptedTable, types } from '@cipherstash/stack/v3' + +const users = encryptedTable('users', { + email: types.TextEq('email'), + emailLower: types.TextEq('emailLower'), + age: types.IntegerEq('age'), + balance: types.BigintEq('balance'), + active: types.Boolean('active'), + notes: types.Text('notes'), +}) +``` + +Done when every column from step 1 has its Stack domain and every property key is unchanged. + +### 4. Swap the client, the adapter and the search terms + +Build the client with every table the adapter will touch. + +```typescript +// Before +import { protect } from '@cipherstash/protect' +import { protectDynamoDB } from '@cipherstash/protect-dynamodb' + +const protectClient = await protect({ schemas: [users] /* , credentials */ }) +const dynamo = protectDynamoDB({ protectClient }) + +// After +import { encryptedDynamoDB } from '@cipherstash/stack/dynamodb' +import { Encryption } from '@cipherstash/stack/v3' + +const client = await Encryption({ schemas: [users] }) +const dynamo = encryptedDynamoDB({ encryptionClient: client }) +``` + +`encryptModel(model, table)`, `bulkEncryptModels(models, table)`, `decryptModel(item, table)` and `bulkDecryptModels(items, table)` keep their names and arguments. Each returns `{ data }` or `{ failure }`, as before. A read needs no `{ storedEqlVersion: 2 }` option for these items, because a top-level attribute carries no version; one read call covers items written before and after the upgrade (`compat › reads the same item with no storedEqlVersion at all (scalars carry no version)`). + +Replace each `createSearchTerms` call with `client.encryptQuery`, and use its `hm` as the `__hmac` value in the key condition or filter: + +```typescript +// Before +const terms = await dynamo.createSearchTerms([ + { value: 'ada@example.com', column: users.email, table: users }, +]) +if (terms.failure) throw new Error(terms.failure.message) +const [emailHmac] = terms.data + +// After +const term = await client.encryptQuery('ada@example.com', { + table: users, + column: users.email, +}) +if (term.failure) throw new Error(term.failure.message) +const emailHmac = hmacOf(term.data) + +// encryptQuery's result type also covers ciphertexts, strings and null, so +// narrow to the equality term before reading `hm`. +function hmacOf(term: unknown): string { + if (typeof term === 'object' && term !== null && 'hm' in term && typeof term.hm === 'string') { + return term.hm + } + throw new Error('encryptQuery returned no equality term: is the column an *Eq domain?') +} +``` + +Done when no file imports `@cipherstash/protect` or `@cipherstash/protect-dynamodb`, and the app type-checks. + +### 5. Handle the known differences + +These are the differences established by the tested schemas. Work through each one that step 1 found. + +**Boolean lookups.** A `types.Boolean` column decrypts, but `encryptQuery` refuses it with `no indexes configured`, and a Stack write stores no `active__hmac` (`compat › a v3 Boolean writes no __hmac, though protect-dynamodb wrote one`). Re-encrypting does not bring the lookup back. If the app filters on a boolean, redesign that lookup before deploying. A plaintext attribute exposes the value, so use it only if that is acceptable for the field. A GSI requires a supported key representation, such as a string; a DynamoDB boolean cannot itself be a GSI key ([AWS key requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html)). Populating a replacement attribute on existing items is a separate backfill, outside this suite. + +**Bigint values.** Protect's tested bigint input is a safe JS `number`; Stack reads it as a JS `bigint`. Pass `bigint` values to `types.BigintEq` writes and queries (for example, `BigInt(balance)` after checking `Number.isSafeInteger(balance)`). Update JSON serialization and API boundaries accordingly. The suite does not establish lossless rollback for new values outside the safe-number range. + +**In-place updates of a column with no term.** When an `UpdateItem` sets a `Boolean` (or any other domain that writes no `__hmac`) on a legacy item, `REMOVE` the old `__hmac` in the same update. With `SET` alone, the stale term still matches a lookup on the old value (`compat › a Stack Boolean update writes no __hmac, so a partial update must REMOVE the legacy one`). + +```typescript +UpdateExpression: 'SET active__source = :active REMOVE active__hmac' +``` + +**`downcase` columns.** Stack has no `downcase` filter, so the app lowercases the value itself, on both sides: + +- Lowercase the value before `encryptQuery`, and the term matches the stored `__hmac` (`compat › a v2 downcase filter is reproduced only by lowercasing first`). +- Lowercase the value before every write too. Stack hashes a mixed-case value as given, so a lowercase query would miss it (`compat › a Stack write keeps mixed-case plaintext only by giving up the legacy HMAC`). + +Lowercasing on write means new items store the lowercased value, where protect-dynamodb kept the original casing in the ciphertext. If the app needs the original, store it in a second attribute, for example `emailDisplay: types.Text('emailDisplay')`, and keep the lowercased one for lookups. + +**`dataType('json')` columns.** Protect stored a JSON value as a scalar ciphertext, which does not read as `types.Json` through the adapter (`compat › fails to read through encryptedDynamoDB with types.Json (known gap)`). The tested conversion uses a JSON object; `types.Json` accepts documents (objects, arrays or null), so scalar JSON values need a separate schema decision. Backfill each supported document once: rebuild the legacy envelope, decrypt it with `client.decrypt`, and write it back with a `types.Json` column (`compat › reads through client.decrypt() on a rebuilt v2 scalar envelope`, `compat › backfills to a types.Json item that Stack 1.x reads`). + +```typescript +const docs = encryptedTable('docs', { profile: types.Json('profile') }) +const jsonClient = await Encryption({ schemas: [docs] }) +const jsonDynamo = encryptedDynamoDB({ encryptionClient: jsonClient }) + +if (typeof item.profile__source !== 'string') { + throw new Error('Expected a legacy scalar JSON ciphertext') +} +const value = await jsonClient.decrypt({ + v: 2, + k: 'ct', + i: { t: 'docs', c: 'profile' }, // the Protect table and column names + c: item.profile__source, +}) +if (value.failure) throw new Error(value.failure.message) +// This example uses the profile shape exercised by the compatibility suite. +// Validate against your application's JSON schema before using its type. +const profile = value.data as { roles: string[]; tz: string } +const rewritten = await jsonDynamo.encryptModel({ profile }, docs) +if (rewritten.failure) throw new Error(rewritten.failure.message) +// Persist only the returned profile attributes with UpdateItem, preserving +// the item's keys and all other attributes. Guard against concurrent changes. +// This call encrypts in memory; it does not write anything to DynamoDB. +``` + +Before replacing JSON attributes, plan rollback separately: the original Protect JSON schema cannot read the new representation (`compat › the original Protect JSON schema cannot read a Stack Json rewrite`). The snippet is a conversion example, not a resumable backfill runner. + +Done when each boolean lookup has an approved replacement, bigint callers use the correct JS type, each partial update of a term-less column removes its `__hmac`, each `downcase` column is lowercased on every write and query, and each JSON item is backfilled. + +### 6. Verify against your own data + +Before deploying, run the new code against a copy of real items: + +- Decrypt a sample of legacy items with Stack and compare each to what the Protect build decrypts. Every field matches, with `bigint` columns now a JS `bigint`. +- For each supported text or numeric equality column, normalize downcase inputs and use bigint inputs where required, then mint a term with `encryptQuery` for a known value and confirm it equals the stored `__hmac` of an item holding that value. + +Done when both checks pass for every table. + +### 7. Deploy, with rollback available + +Deploy after the application-specific checks pass. For the tested scalar values, rollback can redeploy the Protect build without rewriting ciphertext: protect-dynamodb 6.0.1 reads items Stack wrote (`compat › an item written by Stack 1.x reads back through protect-dynamodb 6.0.1`), and Stack writes the same `__hmac` protect-dynamodb wrote (`compat › Stack 1.x writes the same __hmac protect-dynamodb wrote`). The scalar cycle (legacy write, mixed update, optional scalar rewrite, HMAC matching, rollback) runs with in-memory persistence in `compat › runs the migration and keeps every generation readable and queryable`. + +Rollback limitations: JSON converted to `types.Json` needs a separate reverse conversion or a reader that handles both formats; values outside the tested numeric range need independent verification; boolean items Stack wrote have no `__hmac`, so the Protect build cannot find them by boolean lookup; and lowercased `downcase` values stay lowercased. + +## PostgreSQL v2 → v3 + +This procedure starts with **real Protect.js writes in `public.eql_v2_encrypted` columns**. It retains those source columns, builds v3 target columns and verifies both generations before application cutover. The executable example and live test use EQL v2 2.2.1 alongside the v3 SQL installed by the current CLI. They do not replace v2 data with newly generated v3 data before testing (`postgres-upgrade › migrates actual v2 columns, preserves ciphertext and queries, and rolls back before writes resume`). + +### Supported PostgreSQL mappings + +| Protect declaration | Target domain and Stack constructor | Supported input | +|---|---|---| +| `csColumn('email').equality()` | `public.eql_v3_text_eq`, `types.TextEq('email')` | Text without normalization filters | +| `csColumn('age').dataType('number').equality()` | `public.eql_v3_integer_eq`, `types.IntegerEq('age')` | Safe whole-number JavaScript values; the example checks `Number.isSafeInteger` | +| `csColumn('notes')` | `public.eql_v3_text`, `types.Text('notes')` | Storage-only text | + +The example uses logical identity `customers/email`, `customers/age` and `customers/notes` throughout. Physical target column names carry `_v3`; their encrypted identity does not. Do not apply this fixed example to different identities without adapting and testing them. + +**Stop and plan a separate migration** for boolean equality, downcase filters, bigint, JSON, dates, fractional numbers, grouped fields, lock contexts, range/order or text search. The DynamoDB mappings above do not establish PostgreSQL support for these cases. Null source values, additional columns and capabilities also fall outside this small example. Its preflight rejects them instead of dropping unrecognized data (`postgres-upgrade › refuses unsupported payload capabilities before changing source data or columns`). + +### 1. Prepare and inventory + +Record the source declarations, queries, row counts, constraints, indexes, views, triggers and policies. Establish that the old Protect build can decrypt and query the source data. Keep that build and its lockfile available for rollback. + +The executable example accepts one primary key and the three source columns above. It refuses secondary indexes, non-primary constraints, dependent views, user triggers, row-level security and inheritance. Those objects need a reviewed migration of their own before using this example. Do not drop them merely to make preflight pass (`postgres-upgrade › refuses customer views before changing source data or columns`). + +For an existing database, retain its v2 SQL installation. Install v3 alongside it using the current `stash eql install` against the rehearsed database. Do not uninstall v2 or drop its schemas during this procedure. Capture and verify existing indexes and dependencies around installation, as well as around data conversion. + +### 2. Prepare the new application + +Use an isolated release checkout so the old build remains runnable: + +```bash +npm uninstall @cipherstash/protect +npm install --save-exact @cipherstash/stack@1.2.1 +``` + +Remove directly declared legacy schema/FFI dependencies as described in DynamoDB step 2. Preserve the original workspace and keyset. Remove the old managed endpoint overrides from the new application's environment, retaining deliberate private endpoint configuration only after checking it. + +```typescript +import { Encryption, encryptedTable, types } from '@cipherstash/stack/v3' + +const customers = encryptedTable('customers', { + email: types.TextEq('email'), + age: types.IntegerEq('age'), + notes: types.Text('notes'), +}) +const client = await Encryption({ schemas: [customers] }) +``` + +Configure reads and writes to use the `_v3` physical columns after cutover, while passing the original logical schema above to the encryption client. Handle every SDK `{ failure }` before using `{ data }`. + +### 3. Stop writes and convert + +This first procedure requires a **write-maintenance window**. Stop all application, background and administrative writers; a transaction's table lock alone does not stop an old writer from resuming immediately after commit. Keep writes paused through verification and the rollback decision. + +The [executable migration](../../e2e/migration-guide/postgres.ts) performs these steps in one transaction: + +1. Lock the source table and reject unsupported structure/dependencies before DDL. +2. Validate each legacy envelope and plaintext against the supported mappings. Recompute supported equality terms with Stack and compare them to the stored terms; fail on disagreement. +3. Add `email_v3`, `age_v3` and `notes_v3` with the domains above. +4. Build a new envelope `{ v: 3, i: originalIdentity, c: originalCiphertext, hm: originalEqualityTerm }`; omit `hm` for storage-only text. This is a tested envelope reconstruction, not a universal version-field replacement. Never copy unknown term fields into another domain. +5. Create functional equality indexes on `eql_v3.eq_term(email_v3)` and `eql_v3.eq_term(age_v3)`. +6. Read and decrypt the target values with Stack, compare plaintext and retained bytes against the source, then commit. A failed check rolls back the added columns and indexes too. + +Only the envelope and database structure change for these proven mappings; the ciphertext and equality terms are copied unchanged. Do not generalize this to other capabilities or to v4 (`postgres-upgrade › migrates actual v2 columns, preserves ciphertext and queries, and rolls back before writes resume`). + +The example reads the small source table into memory and validates each value. It is not a resumable production backfill service. Rehearse duration, database lock time and key-service usage before choosing a maintenance window for your data size. + +### 4. Verify queries, indexes and cutover + +Compare source and target row counts, decrypted values, positive and negative equality query results and retained ciphertext/search-term bytes. An encryption-client success alone does not verify SQL querying. + +Use the v3 query function and matching query domain. With the `postgres` driver: + +```typescript +const result = await client.encryptQuery('ada@example.com', { + table: customers, column: customers.email, +}) +if (result.failure) throw new Error(result.failure.message) +// Bind JSON, never interpolate a query value into SQL text. +const term = JSON.parse(JSON.stringify(result.data)) +const rows = await sql` + SELECT pk FROM customers + WHERE eql_v3.eq(email_v3, ${sql.json(term)}::jsonb::eql_v3.query_text_eq) +` +``` + +For age, use `eql_v3.query_integer_eq` and `age_v3`. Map selected physical columns back to logical properties before `decryptModel`, or decrypt each envelope individually. For new writes, encrypt against `customers` and bind each resulting logical value into its matching `_v3` column. + +Run `ANALYZE`, inspect index definitions and check representative query plans on a suitably sized dataset. The live suite checks that selective email and age queries use their functional indexes without disabling sequential scans (`postgres-upgrade › creates usable equality indexes on the converted columns`). + +In rehearsal, test fresh Stack writes beside migrated rows, reads, lookups and updates. The example's fresh-write step proves mixed old/new reads and queries, and causes its simple rollback to refuse (`postgres-upgrade › reads and queries fresh Stack writes beside legacy rows and refuses stale rollback`). In production, switch every reader and writer to the new application before resuming writes; keep the source columns and backup until the recovery window is closed. + +### 5. Rollback boundary + +**Before writes resume**, switch the application back to its preserved Protect build and original columns. The example's rollback checks source/target ciphertext and terms still match and refuses customer dependencies added since conversion, allowing only its own known target indexes. It then drops the target columns and their derived indexes without `CASCADE`. Legacy reads remain available. PostgreSQL can automatically drop same-table constraints and indexes with a column even without `CASCADE`, so dependency preflight is essential (`postgres-upgrade › refuses rollback that would discard a customer %s`). Stop on any dependency error rather than dropping customer objects. + +**After target-only writes resume**, the source columns are stale. Do not roll back by selecting or renaming them: new or updated data would be missing. Reconcile changes or restore through a separately rehearsed recovery procedure. The example rejects a fresh target-only row; it is not a general change journal and cannot prove that arbitrary application deletes or writes never occurred. + +### Reproduce the PostgreSQL example + +Use the [npm example instructions](../../e2e/migration-guide/README.md) with a disposable database containing both EQL generations. `seed` creates a new table and refuses an existing one; `migrate` validates and creates targets; `verify` reads them; `rollback` demonstrates recovery before writes; `write` demonstrates why that recovery boundary closes. No step drops or reinstalls an EQL schema. + +## Optional: moving values between DynamoDB and Postgres + +For the tested text equality, integer equality and storage-only text columns, a value moves between DynamoDB and a Postgres EQL v3 column as a **copy** of two strings, in either direction, with no key and no re-encryption: + +| DynamoDB attribute | Postgres EQL v3 envelope field | +|---|---| +| `__source` | `c` (the ciphertext) | +| `__hmac` | `hm` (the equality term) | + +The rest of the envelope is `{ v: 3, i: { t: , c: } }`, which carries no secret and comes from the schema. Use `eql_v3_text_eq` and `eql_v3_integer_eq` columns for equality columns, and `eql_v3_text` for storage-only text; install EQL v3 with `npx stash eql install`. + +```typescript +const toEnvelope = (item, column) => ({ + v: 3, + i: { t: 'users', c: column }, + c: item[`${column}__source`], + ...(typeof item[`${column}__hmac`] === 'string' ? { hm: item[`${column}__hmac`] } : {}), +}) + +const toAttributes = (envelope, column) => ({ + [`${column}__source`]: envelope.c, + ...(typeof envelope.hm === 'string' ? { [`${column}__hmac`]: envelope.hm } : {}), +}) +``` + +What the crossover suite proves: + +- protect-dynamodb items copied into Postgres are accepted by the column types (`crossover › the EQL v3 column domains accept the copied attributes`), arrive byte-for-byte (`crossover › stores the DynamoDB ciphertext and HMAC byte-for-byte`), decrypt with Stack (`crossover › Stack 1.x decrypts the Postgres rows`), and are found by SQL equality (`crossover › SQL equality queries find exactly the right rows`). +- Copying back returns the original item exactly (`crossover › round trip DynamoDB → Postgres → DynamoDB returns the original item exactly`). +- A Stack-written Postgres row copied into DynamoDB decrypts with Stack (`crossover › Stack 1.x encryptedDynamoDB decrypts the item`) and with protect-dynamodb 6.0.1 (`crossover › protect-dynamodb 6.0.1 decrypts the item too`), and carries the `__hmac` a native write would (`crossover › the item carries the same __hmac a native DynamoDB write would, so existing key conditions match it`). +- Raw payloads from Protect's `encrypt` copy into both stores the same way (`crossover › becomes a DynamoDB item Stack 1.x decrypts with the legacy email equality term`, `crossover › becomes a Postgres EQL v3 row that SQL finds and Stack 1.x decrypts`). + +## Outside what the tests cover + +The suites cover the examples in the step 3 table, including expected failures for JSON reads and date encryption. Verify anything else against your own data with step 6 before relying on it, in particular: + +- columns with `orderAndRange()`, `freeTextSearch()` or other index kinds; +- unindexed `number`, `bigint` or `boolean` columns (only unindexed text is tested); +- nested or grouped attributes; +- items written with a lock context; +- Unicode normalization beyond the ASCII `downcase` examples, numeric precision boundaries, and JSON rollback after conversion; +- real DynamoDB requests, pagination, GSI behavior, concurrent updates, or production backfill orchestration. diff --git a/e2e/README.md b/e2e/README.md index 6333c56e5e..ac5f9a750b 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -36,6 +36,23 @@ Some tests spawn the wizard binary, which runs an auth check before reaching the The CI job for this workspace exposes those env vars from repo secrets. Without them the wizard suite is skipped (the provider suite still runs). +## Protect compatibility suites + +These live suites are excluded from the default run. From an installed repository checkout, build the native binding, then use Turbo to build the workspace dependencies and run each suite: + +```bash +pnpm --filter @cipherstash/protect-ffi run build:native +pnpm exec turbo run test:protect-compat --filter @cipherstash/e2e --env-mode=loose +pnpm exec turbo run test:protect-crossover --filter @cipherstash/e2e --env-mode=loose +``` + +The native build needs the repository's Rust toolchain and trusted mise configuration. Both suites require `CS_WORKSPACE_CRN`, `CS_CLIENT_ID`, `CS_CLIENT_KEY` and `CS_CLIENT_ACCESS_KEY` in the environment, `e2e/.env` or the root `.env`; missing configuration fails the run rather than skipping it. The crossover suite also requires `DATABASE_URL` pointing to a disposable Postgres database where it can install EQL and create test tables. + +- `tests/protect-dynamodb-compat.e2e.test.ts` checks Protect.js → Stack reads, writes and equality terms using real encryption and in-memory DynamoDB item storage. +- `tests/protect-crossover.e2e.test.ts` checks ciphertext and HMAC transfer between DynamoDB item objects and real Postgres rows. The same runner includes `tests/protect-postgres-upgrade.e2e.test.ts` and `tests/protect-guide-example.e2e.test.ts` for the Postgres upgrade and executable guide examples. + +See the [migration guide](../docs/migration/protect-dynamodb-to-stack.md) for the tested scope and limitations. + ## Adding a new e2e test - File name must end in `.e2e.test.ts` to be picked up by `vitest.config.ts`. diff --git a/e2e/migration-guide/README.md b/e2e/migration-guide/README.md new file mode 100644 index 0000000000..771f7b6dc3 --- /dev/null +++ b/e2e/migration-guide/README.md @@ -0,0 +1,58 @@ +# Protect v2 to Stack v3 examples + +These examples accompany the [two-store migration guide](../../docs/migration/protect-dynamodb-to-stack.md). EQL v2/v3 are data generations; the target npm package is Stack 1.2.1. Nothing here uses v4. + +Use Node.js 22.18 or later. Copy this directory to a disposable location outside the monorepo and run: + +```bash +npm install +``` + +The exact direct package versions are in `package.json`; retain the generated npm lockfile for your rehearsal. In this checkout, the live tests import the same example functions against the in-tree Stack build instead. That is different evidence from a separately installed published tarball; record the tested version/revision when running either. + +Set the original workspace credentials in a local `.env`: + +```dotenv +CS_WORKSPACE_CRN= +CS_CLIENT_ID= +CS_CLIENT_KEY= +CS_CLIENT_ACCESS_KEY= +``` + +Do not commit credentials. The examples contain fixed, non-secret synthetic customer data. The legacy client temporarily sets managed service endpoints from the workspace region, then restores them; do not use this managed-host example unchanged with private/custom endpoints. + +## DynamoDB + +```bash +npm run dynamodb +``` + +This runs actual Protect/Stack encryption with **in-memory persistence**. Assertions cover preserved legacy bytes, reads, lowercase equality, fresh writes, bigint serialization and removal of the stale boolean term on partial updates. It makes no AWS requests and does not prove GSI, pagination or concurrent-update behavior. The broader compatibility suite covers the guide's JSON conversion and other exceptions. + +## PostgreSQL + +Provide `DATABASE_URL` for a **disposable** PostgreSQL database where EQL v2 and v3 are already installed. Existing customer databases already have v2; the integration suite installs the historical EQL 2.2.1 bundle only to create a realistic test starting point. Install v3 alongside it using `stash eql install`; never uninstall v2 as part of this example. + +```bash +npm run postgres -- seed +npm run postgres -- migrate +npm run postgres -- verify +npm run postgres -- rollback +``` + +`seed` creates `protect_upgrade_example` with three Protect-written EQL v2 rows. It refuses to replace an existing table. `migrate` locks the table, refuses unsupported structure/data, creates v3 target columns and indexes, and verifies values before committing. `verify` reports counts without logging plaintext. `rollback` preserves the v2 sources and removes unchanged targets before application writes resume. + +Then demonstrate fresh writes and the rollback boundary: + +```bash +npm run postgres -- migrate +npm run postgres -- write +npm run postgres -- verify +npm run postgres -- rollback +``` + +The final command **must fail** because source columns do not contain the new Stack-only row. This is not a recovery service: after writes resume, reconcile changes or use a separately rehearsed recovery plan. Do not run `seed` again to conceal this condition. + +The example deliberately supports only an uncustomized table with a text primary key, text equality, safe whole-number equality and storage-only text under the fixed `customers` logical identity. It refuses extra columns, secondary indexes, non-primary constraints, dependent views, user triggers, row-level security and inheritance. Review those objects rather than removing them to bypass a refusal. + +Run the existing credentialed `test:protect-crossover` task from the repository to verify these functions against real Postgres and ZeroKMS. It also tests unsupported-input refusal, fresh writes and actual equality-index engagement. See the guide for the maintainer build commands. diff --git a/e2e/migration-guide/dynamodb-run.ts b/e2e/migration-guide/dynamodb-run.ts new file mode 100644 index 0000000000..661b71968d --- /dev/null +++ b/e2e/migration-guide/dynamodb-run.ts @@ -0,0 +1,3 @@ +import { migrateDynamoExample } from './dynamodb.ts' + +console.log(await migrateDynamoExample()) diff --git a/e2e/migration-guide/dynamodb.ts b/e2e/migration-guide/dynamodb.ts new file mode 100644 index 0000000000..1f78ac9c88 --- /dev/null +++ b/e2e/migration-guide/dynamodb.ts @@ -0,0 +1,100 @@ +import assert from 'node:assert/strict' +import { csColumn, csTable } from '@cipherstash/protect' +import { protectDynamoDB } from '@cipherstash/protect-dynamodb' +import { encryptedDynamoDB } from '@cipherstash/stack/dynamodb' +import { Encryption, encryptedTable, types } from '@cipherstash/stack/v3' +import { legacyProtect, ok } from './legacy.ts' + +/** Executable before/after example; persistence is in memory, not AWS. */ +export async function migrateDynamoExample() { + const before = csTable('customers', { + email: csColumn('email').equality(), + emailLower: csColumn('emailLower').equality([{ kind: 'downcase' }]), + age: csColumn('age').dataType('number').equality(), + balance: csColumn('balance').dataType('bigint').equality(), + active: csColumn('active').dataType('boolean').equality(), + notes: csColumn('notes'), + }) + const after = encryptedTable('customers', { + email: types.TextEq('email'), + emailLower: types.TextEq('emailLower'), + age: types.IntegerEq('age'), + balance: types.BigintEq('balance'), + active: types.Boolean('active'), + notes: types.Text('notes'), + }) + const legacy = protectDynamoDB({ + protectClient: await legacyProtect([before]), + }) + const client = await Encryption({ schemas: [after] }) + const stack = encryptedDynamoDB({ encryptionClient: client }) + const original = { + pk: 'legacy', + email: 'ada@example.com', + emailLower: 'Ada@Example.com', + age: 36, + balance: 1000, + active: true, + notes: 'engines', + } + const item: Record = ok( + await legacy.encryptModel(original, before), + 'legacy write', + ) + const snapshot = structuredClone(item) + const decrypted = ok(await stack.decryptModel(item, after), 'legacy read') + assert.deepEqual(decrypted, { ...original, balance: 1000n }) + const query = ok( + await client.encryptQuery(original.emailLower.toLowerCase(), { + table: after, + column: after.emailLower, + }), + 'normalized query', + ) + assert.equal(hmac(query), item.emailLower__hmac) + assert.deepEqual(item, snapshot) + + const fresh = { + ...original, + pk: 'new', + emailLower: original.emailLower.toLowerCase(), + balance: 1000n, + active: false, + } + const written = ok(await stack.encryptModel(fresh, after), 'Stack write') + assert.equal(written.emailLower__hmac, item.emailLower__hmac) + assert.equal('active__hmac' in written, false) + assert.deepEqual( + ok(await stack.decryptModel(written, after), 'new read'), + fresh, + ) + // A partial UpdateItem must remove the previous boolean term atomically. + const update = { ...item, active__source: written.active__source } + Reflect.deleteProperty(update, 'active__hmac') + assert.equal('active__hmac' in update, false) + const changed = ok(await stack.decryptModel(update, after), 'updated read') + assert.equal(changed.active, false) + // The example's replacement boolean lookup decrypts and filters; production + // must also handle pagination and the cost of scanning its data. + assert.equal([decrypted, changed].filter((row) => row.active).length, 1) + const publicValue = JSON.stringify(changed, (_key, value) => + typeof value === 'bigint' ? value.toString() : value, + ) + assert.equal(JSON.parse(publicValue).balance, '1000') + return { + legacyBytesPreserved: true, + newWritesVerified: true, + booleanUpdateVerified: true, + } +} + +function hmac(value: unknown): string { + if ( + typeof value === 'object' && + value !== null && + 'hm' in value && + typeof value.hm === 'string' + ) + return value.hm + throw new Error('Expected an equality term') +} diff --git a/e2e/migration-guide/legacy.ts b/e2e/migration-guide/legacy.ts new file mode 100644 index 0000000000..fbc2121044 --- /dev/null +++ b/e2e/migration-guide/legacy.ts @@ -0,0 +1,42 @@ +import { protect } from '@cipherstash/protect' + +/** Protect 10.2.1 needs explicit managed endpoints outside ap-southeast-2. */ +export async function legacyProtect( + schemas: Parameters[0]['schemas'], +) { + const crn = process.env.CS_WORKSPACE_CRN + if (!crn) throw new Error('CS_WORKSPACE_CRN is required') + const region = crn.split(':')[1] + const saved = { + CS_CTS_HOST: process.env.CS_CTS_HOST, + CS_ZEROKMS_HOST: process.env.CS_ZEROKMS_HOST, + } + process.env.CS_CTS_HOST = `https://${region}.cts.cipherstashmanaged.net` + process.env.CS_ZEROKMS_HOST = `https://${region}.viturhosted.net` + try { + return await protect({ + schemas, + workspaceCrn: crn, + clientId: process.env.CS_CLIENT_ID, + clientKey: process.env.CS_CLIENT_KEY, + accessKey: process.env.CS_CLIENT_ACCESS_KEY, + }) + } finally { + for (const [key, value] of Object.entries(saved)) { + if (value === undefined) delete process.env[key] + else process.env[key] = value + } + } +} + +/** Check every SDK result; never continue with a failed encryption operation. */ +export function ok( + result: { data: T; failure?: undefined } | { failure: unknown }, + label: string, +): T { + if ('failure' in result && result.failure !== undefined) { + throw new Error(`${label} failed`, { cause: result.failure }) + } + if ('data' in result) return result.data + throw new Error(`${label} returned no data`) +} diff --git a/e2e/migration-guide/package.json b/e2e/migration-guide/package.json new file mode 100644 index 0000000000..5bb8e7038c --- /dev/null +++ b/e2e/migration-guide/package.json @@ -0,0 +1,16 @@ +{ + "name": "protect-to-stack-guide-example", + "private": true, + "type": "module", + "engines": { "node": ">=22.18.0" }, + "scripts": { + "postgres": "node --experimental-strip-types --env-file-if-exists=.env run.ts", + "dynamodb": "node --experimental-strip-types --env-file-if-exists=.env dynamodb-run.ts" + }, + "dependencies": { + "@cipherstash/protect": "10.2.1", + "@cipherstash/protect-dynamodb": "6.0.1", + "@cipherstash/stack": "1.2.1", + "postgres": "3.4.9" + } +} diff --git a/e2e/migration-guide/postgres.ts b/e2e/migration-guide/postgres.ts new file mode 100644 index 0000000000..280429d25e --- /dev/null +++ b/e2e/migration-guide/postgres.ts @@ -0,0 +1,330 @@ +import { csColumn, csTable } from '@cipherstash/protect' +import { Encryption, encryptedTable, types } from '@cipherstash/stack/v3' +import type postgres from 'postgres' +import { legacyProtect, ok } from './legacy.ts' + +/** A deliberately small migration example, not a general backfill service. */ +export async function createExample(sql: postgres.Sql, table: string) { + if (!/^[a-z][a-z0-9_]{0,39}$/.test(table)) + throw new Error('Invalid example table name') + const legacySchema = csTable('customers', { + email: csColumn('email').equality(), + age: csColumn('age').dataType('number').equality(), + notes: csColumn('notes'), + }) + const schema = encryptedTable('customers', { + email: types.TextEq('email'), + age: types.IntegerEq('age'), + notes: types.Text('notes'), + }) + const legacy = await legacyProtect([legacySchema]) + const stack = await Encryption({ schemas: [schema] }) + const columns = ['email', 'age', 'notes'] as const + const corpus = [ + { pk: 'ada', email: 'ada@example.com', age: 36, notes: 'engines' }, + { pk: 'alan', email: 'alan@example.com', age: 36, notes: 'machines' }, + { pk: 'grace', email: 'grace@example.com', age: 85, notes: 'compilers' }, + ] + + async function seed() { + // Never replace an existing table or seed a customer's database in place. + await sql.begin(async (tx) => { + await tx`CREATE TABLE ${tx(table)} ( + pk text PRIMARY KEY, + email public.eql_v2_encrypted, + age public.eql_v2_encrypted, + notes public.eql_v2_encrypted + )` + for (const row of corpus) { + const email = ok( + await legacy.encrypt(row.email, { + table: legacySchema, + column: legacySchema.email, + }), + 'legacy email', + ) + const age = ok( + await legacy.encrypt(row.age, { + table: legacySchema, + column: legacySchema.age, + }), + 'legacy age', + ) + const notes = ok( + await legacy.encrypt(row.notes, { + table: legacySchema, + column: legacySchema.notes, + }), + 'legacy notes', + ) + await tx`INSERT INTO ${tx(table)} VALUES (${row.pk}, ${tx.json(email)}, ${tx.json(age)}, ${tx.json(notes)})` + } + }) + } + + async function read(generation: 'v2' | 'v3') { + // Custom domain OIDs are not JSON parser OIDs in postgres.js. Project the + // base jsonb type explicitly instead of passing serialized text to the SDK. + const rows = + generation === 'v2' + ? await sql`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes FROM ${sql(table)} ORDER BY pk` + : await sql`SELECT pk, email_v3::jsonb AS email, age_v3::jsonb AS age, notes_v3::jsonb AS notes FROM ${sql(table)} ORDER BY pk` + return Promise.all( + rows.map(async (row) => { + const values = await Promise.all( + columns.map(async (column) => { + const payload = row[column] + return [ + column, + ok( + await (generation === 'v2' + ? legacy.decrypt(payload) + : stack.decrypt(payload)), + 'decrypt', + ), + ] as const + }), + ) + return { pk: row.pk, ...Object.fromEntries(values) } + }), + ) + } + + async function find( + generation: 'v2' | 'v3', + column: 'email' | 'age', + value: string | number, + ) { + if ( + (column === 'email' && typeof value !== 'string') || + (column === 'age' && !Number.isSafeInteger(value)) + ) { + throw new Error('Unsupported query value') + } + // Protect's encrypt output includes the equality term used by its SQL operator. + const term = + generation === 'v2' + ? ok( + await legacy.encrypt(value, { + table: legacySchema, + column: legacySchema[column], + }), + 'legacy term', + ) + : column === 'email' + ? ok( + await stack.encryptQuery(String(value), { + table: schema, + column: schema.email, + }), + 'email term', + ) + : ok( + await stack.encryptQuery(Number(value), { + table: schema, + column: schema.age, + }), + 'age term', + ) + // The SDK's query result union also includes non-JSON query families. + // This equality example binds the actual JSON wire representation. + const jsonTerm: postgres.JSONValue = JSON.parse(JSON.stringify(term)) + const rows = + generation === 'v2' + ? await sql`SELECT pk FROM ${sql(table)} WHERE ${sql(column)} = ${sql.json(jsonTerm)}::jsonb ORDER BY pk` + : column === 'email' + ? await sql`SELECT pk FROM ${sql(table)} WHERE eql_v3.eq(email_v3, ${sql.json(jsonTerm)}::jsonb::eql_v3.query_text_eq) ORDER BY pk` + : await sql`SELECT pk FROM ${sql(table)} WHERE eql_v3.eq(age_v3, ${sql.json(jsonTerm)}::jsonb::eql_v3.query_integer_eq) ORDER BY pk` + return rows.map((row) => row.pk) + } + + async function checkDependencies( + tx: postgres.TransactionSql, + allowTargetIndexes: boolean, + ) { + const dependencies = await tx`SELECT + EXISTS (SELECT 1 FROM pg_trigger WHERE tgrelid = ${table}::regclass AND NOT tgisinternal) + OR EXISTS (SELECT 1 FROM pg_constraint WHERE (conrelid = ${table}::regclass OR confrelid = ${table}::regclass) + -- PostgreSQL 18 also lists the primary key column's NOT NULL here. + AND NOT (contype IN ('p', 'n') AND conrelid = ${table}::regclass AND conkey = ARRAY[1]::smallint[])) + -- PostgreSQL 17 and earlier keep NOT NULL out of pg_constraint, so read + -- it from the column on every version. + OR EXISTS (SELECT 1 FROM pg_attribute WHERE attrelid = ${table}::regclass + AND attnum > 1 AND NOT attisdropped AND attnotnull) + OR EXISTS (SELECT 1 FROM pg_index ix JOIN pg_class idx ON idx.oid = ix.indexrelid + WHERE indrelid = ${table}::regclass AND NOT indisprimary AND NOT ( + ${allowTargetIndexes} AND NOT indisunique AND indpred IS NULL AND indnatts = 1 + AND ((idx.relname = ${`${table}_email_v3_idx`} AND pg_get_indexdef(indexrelid, 1, true) = 'eql_v3.eq_term(email_v3)') + OR (idx.relname = ${`${table}_age_v3_idx`} AND pg_get_indexdef(indexrelid, 1, true) = 'eql_v3.eq_term(age_v3)')))) + OR EXISTS (SELECT 1 FROM pg_depend WHERE refobjid = ${table}::regclass AND classid = 'pg_rewrite'::regclass) + OR (SELECT relrowsecurity OR relispartition OR relkind <> 'r' FROM pg_class WHERE oid = ${table}::regclass) + OR EXISTS (SELECT 1 FROM pg_policy WHERE polrelid = ${table}::regclass) + OR EXISTS (SELECT 1 FROM pg_inherits WHERE inhparent = ${table}::regclass OR inhrelid = ${table}::regclass) + AS unsupported` + if (dependencies[0].unsupported) + throw new Error( + 'Unsupported table dependencies: review constraints, indexes, views, triggers, policies and inheritance first', + ) + } + + async function migrate() { + await sql.begin(async (tx) => { + await tx`LOCK TABLE ${tx(table)} IN ACCESS EXCLUSIVE MODE` + // Fail before adding any columns. This example understands one exact shape. + const attributes = + await tx`SELECT attname, atttypid::regtype::text AS type + FROM pg_attribute WHERE attrelid = ${table}::regclass + AND attnum > 0 AND NOT attisdropped ORDER BY attnum` + if ( + JSON.stringify(attributes.map((a) => [a.attname, a.type])) !== + JSON.stringify([ + ['pk', 'text'], + ['email', 'eql_v2_encrypted'], + ['age', 'eql_v2_encrypted'], + ['notes', 'eql_v2_encrypted'], + ]) + ) + throw new Error( + 'Unsupported columns: expected pk and three EQL v2 columns', + ) + await checkDependencies(tx, false) + const rows = + await tx`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes FROM ${tx(table)} ORDER BY pk` + if (rows.length === 0) + throw new Error('Empty source: this example requires legacy records') + for (const row of rows) { + for (const column of columns) { + const payload = row[column] + if ( + payload?.v !== 2 || + payload.k !== 'ct' || + typeof payload.c !== 'string' || + payload.i?.t !== 'customers' || + payload.i?.c !== column || + Object.keys(payload).some( + (key) => !['v', 'k', 'i', 'c', 'hm', 'ob', 'bf'].includes(key), + ) || + // Protect represents unused index capabilities with null fields. + payload.ob != null || + payload.bf != null || + (column === 'notes' + ? payload.hm != null + : typeof payload.hm !== 'string') + ) { + throw new Error(`Unsupported legacy payload in ${column}`) + } + const plain = ok( + await legacy.decrypt(payload), + 'validate legacy payload', + ) + if ( + column === 'age' + ? !Number.isSafeInteger(plain) + : typeof plain !== 'string' + ) { + throw new Error(`Unsupported plaintext in ${column}`) + } + if (column !== 'notes') { + const term = + column === 'email' + ? ok( + await stack.encryptQuery(String(plain), { + table: schema, + column: schema.email, + }), + 'verify email mapping', + ) + : ok( + await stack.encryptQuery(Number(plain), { + table: schema, + column: schema.age, + }), + 'verify age mapping', + ) + if ( + typeof term !== 'object' || + term === null || + !('hm' in term) || + term.hm !== payload.hm + ) { + throw new Error(`Unsupported equality mapping in ${column}`) + } + } + } + } + await tx`ALTER TABLE ${tx(table)} + ADD COLUMN email_v3 public.eql_v3_text_eq, + ADD COLUMN age_v3 public.eql_v3_integer_eq, + ADD COLUMN notes_v3 public.eql_v3_text` + // Rebuild only the envelope. Source columns and their bytes stay intact. + for (const column of columns) { + await tx`UPDATE ${tx(table)} SET ${tx(`${column}_v3`)} = jsonb_build_object( + 'v', 3, 'i', ${tx(column)}::jsonb->'i', 'c', ${tx(column)}::jsonb->'c' + ) || CASE WHEN ${column} = 'notes' THEN '{}'::jsonb + ELSE jsonb_build_object('hm', ${tx(column)}::jsonb->'hm') END` + } + await tx`CREATE INDEX ${tx(`${table}_email_v3_idx`)} ON ${tx(table)} (eql_v3.eq_term(email_v3))` + await tx`CREATE INDEX ${tx(`${table}_age_v3_idx`)} ON ${tx(table)} (eql_v3.eq_term(age_v3))` + // Read through Stack before committing, so a wrong mapping rolls back DDL too. + const converted = + await tx`SELECT pk, email_v3::jsonb AS email_v3, age_v3::jsonb AS age_v3, notes_v3::jsonb AS notes_v3 FROM ${tx(table)} ORDER BY pk` + for (let i = 0; i < rows.length; i++) { + for (const column of columns) { + const before = rows[i][column] + const after = converted[i][`${column}_v3`] + if ( + after.c !== before.c || + (after.hm ?? null) !== (before.hm ?? null) || + ok(await stack.decrypt(after), 'verify target') !== + ok(await legacy.decrypt(before), 'verify source') + ) { + throw new Error(`Conversion verification failed in ${column}`) + } + } + } + }) + await sql`ANALYZE ${sql(table)}` + } + + async function write() { + const model = { + pk: 'new', + email: 'new@example.com', + age: 36, + notes: 'written by Stack', + } + const encrypted = ok(await stack.encryptModel(model, schema), 'fresh write') + await sql`INSERT INTO ${sql(table)} (pk, email_v3, age_v3, notes_v3) + VALUES (${model.pk}, ${sql.json(encrypted.email)}, ${sql.json(encrypted.age)}, ${sql.json(encrypted.notes)})` + return model + } + + async function rollback() { + await sql.begin(async (tx) => { + await tx`LOCK TABLE ${tx(table)} IN ACCESS EXCLUSIVE MODE` + await checkDependencies(tx, true) + const rows = + await tx`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes, + email_v3::jsonb AS email_v3, age_v3::jsonb AS age_v3, notes_v3::jsonb AS notes_v3 FROM ${tx(table)}` + for (const row of rows) { + for (const column of columns) { + if ( + !row[column] || + !row[`${column}_v3`] || + row[column].c !== row[`${column}_v3`].c || + (row[column].hm ?? null) !== (row[`${column}_v3`].hm ?? null) + ) { + throw new Error( + 'Writes have resumed: reconcile target changes before rollback', + ) + } + } + } + // Preflight permits only our two derived indexes. PostgreSQL otherwise + // drops same-table constraints/indexes with a column even without CASCADE. + await tx`ALTER TABLE ${tx(table)} DROP COLUMN email_v3, DROP COLUMN age_v3, DROP COLUMN notes_v3` + }) + } + + return { corpus, seed, migrate, read, find, write, rollback } +} diff --git a/e2e/migration-guide/run.ts b/e2e/migration-guide/run.ts new file mode 100644 index 0000000000..efa9cadcf1 --- /dev/null +++ b/e2e/migration-guide/run.ts @@ -0,0 +1,43 @@ +import postgres from 'postgres' +import { createExample } from './postgres.ts' + +const command = process.argv[2] +if (!['seed', 'migrate', 'verify', 'write', 'rollback'].includes(command)) { + throw new Error( + 'Usage: npm run postgres -- seed|migrate|verify|write|rollback', + ) +} +if (!process.env.DATABASE_URL) throw new Error('DATABASE_URL is required') +const sql = postgres(process.env.DATABASE_URL, { prepare: false }) +try { + const app = await createExample(sql, 'protect_upgrade_example') + if (command === 'seed') { + await app.seed() + console.log( + 'Seeded three Protect-written v2 rows. Legacy equality matches:', + (await app.find('v2', 'age', 36)).length, + ) + } else if (command === 'migrate') { + await app.migrate() + console.log( + 'Verified v3 target columns committed; v2 source columns retained.', + ) + } else if (command === 'verify') { + // Do not print plaintext or ciphertext from a customer's test data. + console.log('Readable v3 rows:', (await app.read('v3')).length) + console.log( + 'Expected example age matches:', + (await app.find('v3', 'age', 36)).length, + ) + } else if (command === 'write') { + await app.write() + console.log('Wrote a new v3-only row. Simple rollback is now refused.') + } else { + await app.rollback() + console.log( + 'Removed unchanged target columns; legacy reads remain available.', + ) + } +} finally { + await sql.end() +} diff --git a/e2e/migration-harness/CONTEXT.md b/e2e/migration-harness/CONTEXT.md new file mode 100644 index 0000000000..1460212fa3 --- /dev/null +++ b/e2e/migration-harness/CONTEXT.md @@ -0,0 +1,113 @@ +# Migration Harness + +A harness that tests an upgrade guide by having agents follow it. A Migrator upgrades a Protect.js application using only the guide, an Oracle judges the result, and an Editor revises the guide from what went wrong. + +## Language + +**Fixture App**: +The small Protect.js application with encrypted data in DynamoDB and Postgres that is the starting point for a Run. +_Avoid_: sample app, demo app, test app + +**Run**: +One execution of the harness pipeline for a Fixture App, described by a Run Report even when execution ends before migration or verification. +_Avoid_: trial, attempt, episode + +**Legacy Data**: +Records from the unmigrated Fixture App used as the baseline for compatibility and no-rewrite checks, distinct from Mutation Data. +_Avoid_: seed data, fixtures, old data + +**Iteration**: +One or more Runs against a single revision of the guide, followed by at most one Editor revision. +_Avoid_: round, cycle + +**Migrator**: +The agent responsible for upgrading the Fixture App using the guide, without access to the Oracle or Reference Migration. +_Avoid_: subject, worker, executor + +**Oracle**: +The deterministic, agent-free checks of the migrated Fixture App's behaviour, stored data and migration completeness, hidden from the Migrator. +_Avoid_: grader, judge, evaluator + +**App Host**: +The execution environment for the migrated Fixture App during Oracle verification. +_Avoid_: runner, worker, sandbox + +**Editor**: +The agent that revises the guide from eligible Run Reports in Iteration Results. +_Avoid_: improver, reviewer, author + +**Reference Migration**: +A known-correct upgrade of the Fixture App used to establish that the Oracle can be passed, hidden from both Migrator and Editor. +_Avoid_: golden app, solution, answer key + +**Friction Log**: +The Migrator's own record of where the guide was unclear, wrong or silent. +_Avoid_: notes, feedback, report + +**Mutation Data**: +Records reserved for mutating Oracle checks, separate from Legacy Data. +_Avoid_: reserved records + +**Run Slot**: +One configured position in an Iteration, associated with a Run and its infrastructure retries. +_Avoid_: run position + +**Loop**: +A bounded sequence of Iterations that evaluates and revises one guide toward consistent passing Runs without actionable friction. +_Avoid_: iteration loop + +**Fake Migrator**: +A deterministic substitute for a Migrator in harness self-tests. +_Avoid_: mock migrator + +**Review List**: +The review artifact containing claims that need tests, skill drift, and evidence-linked diagnoses supporting or rejecting guide edits. +_Avoid_: Needs-test List + +**Run Report**: +The harness-produced record of a Run's outcomes, Oracle results, Run Manifest, diff, Friction Log and transcript. +_Avoid_: run output + +**Fake Editor**: +A deterministic substitute for an Editor in harness self-tests. +_Avoid_: mock editor + +**Broken Migration**: +A deliberately incorrect migrated Fixture App used to establish a specific Oracle failure or isolation result. +_Avoid_: fake migration + +**Protected Resources**: +The material reserved for the harness to preserve independent verification and isolation between Runs. +_Avoid_: hidden Oracle evidence, hidden set + +**Iteration Results**: +The collected Run Reports, evidence and available edit disposition for one Iteration. +_Avoid_: iteration output + +**Loop Summary**: +The human-review artifact aggregating Iteration Results, pass rates, friction, kept/reverted edits and the Review List across a Loop. +_Avoid_: loop report + +**Clean Iteration**: +A complete Iteration with passing Runs and no actionable friction. +_Avoid_: clean round + +**Store Set**: +The paired DynamoDB and Postgres stores assigned to one role in a Run. +_Avoid_: database pair + +**Migrator Stores**: +The Store Set assigned to a Migrator for exploration and application verification. +_Avoid_: agent databases + +**Oracle Stores**: +The separate Store Set accessed by the harness and App Host for deterministic Oracle checks. +_Avoid_: acceptance databases + +**Run Manifest**: +The reproducibility metadata attached to a Run Report, identifying Stack, guide, Fixture App and agent configuration. +_Avoid_: run metadata + +**Migrator Environment**: +The execution environment for a Migrator's commands. +_Avoid_: Migrator sandbox diff --git a/e2e/migration-harness/docs/adr/0001-isolated-agent-migration-harness.md b/e2e/migration-harness/docs/adr/0001-isolated-agent-migration-harness.md new file mode 100644 index 0000000000..b361153e33 --- /dev/null +++ b/e2e/migration-harness/docs/adr/0001-isolated-agent-migration-harness.md @@ -0,0 +1,349 @@ +--- +status: proposed +date: 2026-11-09 +--- + +# Deliver the Protect/EQL v2 to Stack/EQL v3 guide and verify it with isolated agent Runs + +Compatibility tests establish supported encryption operations but cannot show +whether a reader can follow the Protect.js upgrade guide. We will use a local +Migration Harness: a Migrator upgrades a fresh Fixture App, a deterministic Oracle +checks it through a restricted App Host, and an Editor revises the guide from +Iteration Results. This ADR is the authoritative architecture and implementation +contract for [epic #1540](https://github.com/cipherstash/stack/issues/1540), +using the [context glossary](../../CONTEXT.md). Status remains proposed pending review. +The full implementation contract remains in this ADR at the maintainer's direction, +as an explicit exception to the usual short ADR format. + +Keep agent execution separate from the process holding assertions and snapshots. +Migrators and App Hosts receive separate Store Sets and enforced filesystem +and network boundaries. The Editor sees Iteration Results but cannot +read Protected Resources. Dependency lifecycle +scripts execute within the same restrictions as migrated application code. + +Test at whole Run and Iteration boundaries using swappable agent commands. Preserve +Legacy Data for no-rewrite checks and use distinct Mutation Data for updates. +A Reference Migration proves the Oracle is passable; failures still require +diagnosis before guide edits. Require valid Friction Logs and two consecutive +Clean Iterations on the same guide revision before declaring convergence. + +## Considered Options + +- Compatibility and citation tests alone miss unclear or absent instructions. +- Having one agent migrate, judge and edit lets it adapt to its own assertions. +- Shared execution and stores expose Protected Resources and permit Run interference. +- CI execution is out of scope: ordinary tests must not need model budget, + live credentials or this harness's Docker environment. + +## Consequences + +Per-process loopback forwarding preserves the Fixture App's loopback-only endpoint rule. +Convergence provides evidence for this Fixture App and guide revision only. +Citation gates validate reference names, not claims; human review of guide changes +remains required. The requirements and acceptance contract below form part of +this decision and guide the stacked implementation PRs. + +## Priority amendment: v2 to v3 for both stores + +Amended 2026-11-10 at the maintainer's direction. The first deliverable is a +tested Protect/EQL v2 to Stack/EQL v3 migration guide covering both DynamoDB and +Postgres. Here v2 and v3 name the EQL generations, not npm package majors: +the starting client is Protect.js 10.2.1 and the target is Stack 1.x's v3 API. +Pin the tested target release or in-tree digest in verification evidence. +EQL v4 migration work follows this deliverable and is not a prerequisite. + +The existing DynamoDB guide, compatibility suites and harness remain useful. +Their Postgres coverage starts with EQL v3 columns populated from DynamoDB +attributes; it does not establish an upgrade of a Protect-written EQL v2 +Postgres database. PRs #1496 and #1497 cover migration to v4, not this missing +v2-to-v3 path. This amendment supersedes the former exclusion of Postgres +v2-to-v3 upgrades and the former single-DynamoDB-guide scope. + +### Problem Statement + +A Protect user needs instructions for upgrading an existing application and +its encrypted data to Stack's v3 API on either store. A DynamoDB-to-Postgres +copy example cannot tell a Postgres user how to migrate existing v2 columns, +queries, indexes and application dependencies. Passing harness self-tests +alone also cannot establish that a customer can complete the guide. + +### Solution + +Deliver one v2-to-v3 guide with common preparation and explicit DynamoDB and +Postgres procedures, backed by executable before/after examples and live +compatibility tests. Preserve the existing DynamoDB instructions and citations +while adding the missing Postgres procedure. Complete this guide before +resuming v4 migration work. Then extend the existing Migration Harness to +test both procedures through its existing Run and Iteration contracts. + +### User Stories + +These stories extend, rather than renumber, the 42 harness stories below. + +43. As a Protect user, I want the guide to distinguish package versions from EQL generations, so that I install the intended Stack release. +44. As a Protect user, I want a shared preparation checklist and a procedure for my store, so that I can upgrade without following unrelated cross-store instructions. +45. As a DynamoDB user, I want to read and query existing Protect-written items with Stack and write new items beside them, so that I can verify the upgrade before deployment. +46. As a DynamoDB user, I want explicit treatment of boolean lookups, downcase normalization, bigint serialization and legacy JSON, so that compatibility exceptions are not hidden by a blanket no-re-encryption claim. +47. As a Postgres user, I want an example starting with actual Protect-written EQL v2 columns, so that the procedure matches my existing database. +48. As a Postgres user, I want tested mappings from supported v2 columns and queries to v3 domains and queries, so that changing the client does not silently change query results. +49. As a Postgres user, I want to know which stored ciphertext and search terms can be retained and which require conversion, so that I do not perform unnecessary or unsafe rewrites. +50. As a Postgres user, I want installation, data conversion, index creation, application cutover and verification instructions, so that I can execute the whole migration. +51. As a Postgres user, I want an explicit write-maintenance window and rollback boundary, so that concurrent writes and post-cutover changes cannot silently invalidate recovery. +52. As a Protect user, I want unsupported types, query capabilities and deployment patterns listed before mutation, so that I can stop before damaging data or losing required queries. +53. As a guide maintainer, I want each compatibility claim tied to a passing live test and reproducible example, so that the guide describes demonstrated behaviour. +54. As a guide maintainer, I want the Postgres procedure checked independently of the agent Loop, so that finishing harness automation is not a prerequisite for delivering the guide. +55. As a guide maintainer, I want the Oracle to check a migration starting from v2 Postgres columns, so that an already-v3 Fixture App cannot produce false confidence. +56. As a guide maintainer, I want independent guide-only Runs for both store procedures, so that success on DynamoDB cannot conceal Postgres friction. +57. As a guide maintainer, I want v4 work explicitly deferred until the v2-to-v3 guide is complete, so that migration targets and their evidence remain separate. + +### Implementation Decisions + +- Guide scope: common package, credential and schema preparation, followed by + separate store procedures. Cross-store copying remains optional and is not + evidence for an existing Postgres database upgrade. +- Preserve the existing DynamoDB coverage and its documented exceptions. + Initially demonstrate Postgres text equality, integer-valued number equality + and storage-only text, matching the existing cross-store evidence. Record + the exact legacy declarations and supported value ranges. Inventory boolean, + normalization, bigint, JSON, dates, fractional numbers, grouped fields, + lock contexts, range/order and text-search capabilities explicitly; a + capability without a passing migration example is unsupported by this + first procedure, not implicitly safe. Do not drop such columns or indexes. +- The Postgres example begins with real Protect.js writes to EQL v2 columns + and verifies the legacy application's reads and queries before migration. + Install EQL v3 alongside the legacy setup and build separate target columns. + Establish the conversion from actual stored payloads in live tests; do not + assume that a cast or changing a version field is sufficient. Preserve + ciphertext/search-term bytes where the test proves it is valid. Any required + re-encryption must be stated per supported mapping and tested explicitly. +- Use an explicit write-maintenance window for this first Postgres procedure. + Preserve source columns and data while populating and verifying target + columns, rebuilding required indexes and switching application reads and + writes. Verify row counts, plaintext, query result sets and fresh writes. + Demonstrate rollback before writes resume. After target-only writes resume, + do not promise rollback by renaming old columns; document the need to + reconcile those writes. Zero-downtime dual-writing is outside this delivery. +- Follow the system-wide durable-data ADR: installation must preserve data; + capture, rebuild and verify derived indexes, and refuse unsupported customer + dependencies before mutation. The example must not drop a schema with + CASCADE as a substitute for migrating customer columns. +- Keep #1534–#1536 and their existing Fixture App acceptance scope intact. + Their original Store Set provisioning, Oracle ordering and no-rewrite checks + below describe the DynamoDB/cross-store baseline. A separate extension adds + a Postgres-v2 Fixture App starting state, Reference Migration and Broken + Migrations. Provision v2 for that starting state; never seed into v3 and call + it a v2 upgrade. Each Run identifies its store procedure and source/target + EQL generations in its Run Manifest. +- The Postgres extension applies the migrated application's database migration + through the restricted App Host to independently seeded Oracle Stores before + checking them. Migrator Stores remain separate. Compare source bytes and + verified retained ciphertext/search terms across conversion; permitted new + envelopes, target columns and indexes are not themselves no-rewrite failures. + Unexpected ciphertext rewriting for a mapping proven to retain bytes fails. +- Maintain the existing isolation, evidence export and Editor gates. An + Iteration evaluates one store procedure; its guide revision and procedure + identity must match before Clean Iterations count toward convergence. Combined convergence requires both procedures to meet their clean-Iteration + criterion against the same final guide hash, whether or not the Editor made + edits. Any guide edit invalidates convergence evidence for the previous hash. +- Delivery order: finish the two tested guide procedures first. Extend the + Postgres harness and complete #1537–#1539 afterwards. Adapter work may reuse + existing seams, but is not a blocker for shipping the tested guide. No v4 + package, codec, payload or SDK adoption is required for this workstream. + +### Testing Decisions + +- Migration correctness uses the existing live compatibility test boundary: + real legacy writes, the documented migration procedure, Stack reads/writes + and actual database queries. Assertions compare externally observable + results and stored bytes where preservation is claimed, not helper internals. +- The Postgres example is executable independently, then exercised by the live + suite with a disposable database and real encryption. Cover the supported + mappings end to end, fresh writes, index definitions and use on a suitable + dataset, the declared rollback window, and refusal of unsupported inputs + before mutation. A skipped credentialed suite is not migration evidence. +- Keep the guide citation gate and extend it to the Postgres evidence. A test + name existing is necessary but insufficient: review that the cited test + actually proves the associated claim. List all exclusions in the guide. +- Harness usability stays at Run Reports and Iteration Results. A correct + Postgres Reference Migration passes; a no-op, a conversion losing rows, an + incorrect column/query mapping, a missing required index and an unexpected + ciphertext rewrite each fail a named observable Oracle check. Retain the + existing DynamoDB self-tests unchanged. +- Use credentialed CI for deterministic compatibility and Fake Migrator + integration tests; keep real Migrators, Editors and Loops opt-in and outside + CI. This supersedes the original blanket CI exclusion below, following the + maintainer's full-CI request for #1535/#1536. + +### Out of Scope + +- Migration to EQL v4, replacing the encryption engine, or taking v4 PRs as a + dependency of the v2-to-v3 guide. +- Universal no-re-encryption claims or support inferred from another store. +- Production backfill services, zero-downtime dual-write orchestration and + every ORM-specific migration workflow. The first Postgres procedure uses + direct SQL and the Stack client. +- Real AWS coverage remains excluded from the harness; distinguish DynamoDB + Local checks from deployed AWS request, GSI and operational guarantees. + +### Further Notes + +The guide is ready when both supported procedures have executable examples, +passing live CI, accurate citations, explicit exclusions and reviewed cutover +instructions. Agent convergence is a subsequent guide-usability milestone, +not a substitute for this evidence or a gate on first guide delivery. +The epic tracks these milestones; the full contract remains in this ADR. +Guide delivery is tracked by #1604 (DynamoDB) and #1603 (Postgres), which can +start from PR #1519 without waiting for the agent harness. #1605 extends the +Postgres Run after #1603 and #1536. Existing #1534–#1536 acceptance remains the +DynamoDB/cross-store baseline; #1537–#1539 integrate the two procedures for the +subsequent usability milestone. + +## Problem Statement + +The Protect.js → Stack DynamoDB upgrade guide (docs/migration) is tied to compatibility tests, but nothing tests whether a reader can actually follow it. A guide can cite passing tests and still leave an agent or engineer stuck: a missing step, a pnpm-only command, an ambiguous instruction about boolean lookups or downcase columns. The only way we find out is when a customer, or an agent in a customer's repo, fails partway through an upgrade. + +## Solution + +A local Migration Harness that tests the guide by having agents follow it, and improves it in a Loop. A Migrator agent upgrades a fresh copy of a small Protect.js Fixture App (DynamoDB and Postgres) using only the guide. A deterministic Oracle judges the result. An Editor agent revises the guide from the Oracle's failures and the Migrator's Friction Log. The Loop repeats until Runs pass consistently with no actionable friction. + +Use the [Migration Harness glossary](../../CONTEXT.md) for domain vocabulary. + +## User Stories + +1. As a guide maintainer, I want to run one Run with a single command, so that I can see whether an agent can follow the current guide. +2. As a guide maintainer, I want every Run to start from a fresh copy of the Fixture App, so that Runs don't contaminate each other. +3. As a guide maintainer, I want Legacy Data written by the unmigrated Protect.js app before the Migrator starts, so that the guide's "no re-encryption" promise is tested against real legacy ciphertext. +4. As a guide maintainer, I want Legacy Data to cover the Fixture App's columns (text equality, downcase text equality, whole-number `number` equality, safe-range `bigint` equality, boolean equality, unindexed text) and a record already copied to Postgres, so that the guide's sections on those columns are exercised. JSON, dates, fractional numbers and the other exclusions below are not covered. +5. As a guide maintainer, I want the Oracle to check the Fixture App's public behaviour after migration, against both stores, on Legacy Data and fresh writes, so that a migration that compiles but breaks lookups fails. +6. As a guide maintainer, I want the Oracle to byte-compare every Legacy Data ciphertext and equality term against a snapshot taken at seeding, after the migrated app's read-only checks and before any mutation, so that a migration that re-encrypts on read fails and legitimate updates do not. +7. As a guide maintainer, I want the Oracle to check that `@cipherstash/protect`, `@cipherstash/protect-dynamodb`, `@cipherstash/schema` and the legacy `@cipherstash/protect-ffi` version are gone and the endpoint shim is removed, while allowing Stack's own `@cipherstash/protect-ffi`, so that a half-finished migration fails and a correct one passes. +8. As a guide maintainer, I want the Oracle to be deterministic with no agent involved, so that the verdicts can be trusted. +9. As a guide maintainer, I want the Migrator never to see the Oracle, so that it can't optimise for the checks instead of following the guide. +10. As a guide maintainer, I want the Migrator confined by an enforced filesystem boundary to its workspace, so that no tool, script or shell command can read Protected Resources. +11. As a guide maintainer, I want an enforced network policy for every command the Migrator runs that permits only the package registry, CipherStash services and the Run's own Migrator Stores, while the agent's model traffic goes through a host-side process whose credentials the Migrator Environment never sees, so that gaps in this guide aren't papered over by other documentation and application code can't reach the model service or Oracle Stores. +12. As a guide maintainer, I want the Migrator to have credentials and Migrator Stores seeded with Legacy Data, separate from Oracle Stores, so that it can verify against data as the guide's step 6 asks without being able to disturb the Oracle's evidence. +13. As a guide maintainer, I want the Migrator's workspace to be a git repo whose first commit is the unmigrated Fixture App, so that the Migrator can diff and roll back, and the harness can capture its changes. +14. As a guide maintainer, I want the Fixture App to use npm, so that pnpm-only instructions in the guide show up as friction. +15. As a guide maintainer, I want the Migrator to record a Friction Log in a fixed template keyed by guide section, so that friction can be compared across Runs and Iterations. +16. As a guide maintainer, I want each Run capped by the configured time and turn limits, so that a stuck Migrator fails instead of burning budget. +17. As a guide maintainer, I want the Migrator on a mid-strength model by default, so that the guide is tested against the kind of agent likely to read it in a customer repo. +18. As a guide maintainer, I want to choose between published npm Stack and an in-tree tarball, resolved once per Loop to an exact version or tarball digest, so that every Run in a Loop tests the same Stack. +19. As a guide maintainer, I want every Run to leave a Run Report with the Oracle results, diff, Friction Log and transcript, so that I can see why it failed. +20. As a guide maintainer, I want parallel Runs isolated by table and database, so that an Iteration can run several Runs at once. +21. As a guide maintainer, I want a hidden Reference Migration that passes every Oracle check, so that the Oracle is demonstrably passable; an individual failure still needs diagnosis before attribution to the guide. +22. As a guide maintainer, I want the Oracle self-tests specified below, so that I know it accepts a correct migration and detects the important failure modes. +23. As a guide maintainer, I want the self-test to use Fake Migrators and spend no tokens, so that I can run it whenever the harness changes. +24. As a guide maintainer, I want an Iteration to run several Runs, then one Editor pass over all their results, so that edits respond to patterns, not to one Run's noise. +25. As a guide maintainer, I want the Editor to change only the guide and a Review List, so that each Iteration changes exactly one thing. +26. As a guide maintainer, I want the Editor forbidden from adding new compatibility claims, so that the guide never asserts something a test does not prove; the citation gate only proves cited names exist. +27. As a guide maintainer, I want claims with no test recorded on a Review List, so that gaps in test coverage become work items, not invented citations. +28. As a guide maintainer, I want the guide's citation test run as a hard gate after every Editor edit, and the edit reverted if it fails, so that the Loop can't break the guide's link to its tests. +29. As a guide maintainer, I want the Editor on a strong model by default, so that revisions are careful. +30. As a guide maintainer, I want the Loop to enforce the normative convergence and maximum-Iteration rules, so that recurring friction, or an Iteration that never really ran, can never count as converged. +31. As a guide maintainer, I want a Loop Summary of pass rates, new friction, kept and reverted edits and the Review List, so that I can review the result before committing. +32. As a guide maintainer, I want nothing auto-committed, so that I review every guide change before it lands. +33. As a guide maintainer, I want skill drift the Editor notices reported rather than edited, so that customer-shipped skills change only through deliberate review. +34. As a repo contributor, I want the harness unreachable from `pnpm test` and absent from CI, so that it never spends tokens or needs credentials in ordinary test runs. +35. As a guide maintainer, I want the Migrator and Editor to be swappable commands with a defined contract, so that the pipeline can be tested with fakes and other agents can be tried later. +36. As a guide maintainer, I want every Run classified by the normative outcome rules below, so that diagnosis determines whether evidence warrants guide edits and infrastructure failures neither trigger edits nor count toward convergence. +37. As a guide maintainer, I want each Run to preserve the normative Run Manifest, so that any Run can be reproduced. +38. As a guide maintainer, I want the isolation acceptance cases specified below, so that isolation is demonstrated rather than assumed. +39. As a guide maintainer, I want friction items reconciled by the normative Iteration rules, so that recurring friction stays open and missing Friction Logs cannot resolve it. +40. As a guide maintainer, I want an Iteration whose Run Slots could not all finish because of exhausted infrastructure retries marked incomplete, so that it can never count as clean. +41. As a guide maintainer, I want the restricted App Host contract specified below, so that executing migrated code cannot expose Protected Resources. +42. As a guide maintainer, I want every Run to produce a valid structured Friction Log, with an explicit empty list when there is no friction, so that a missing or malformed Friction Log fails the Run instead of reading as "no friction". + +## Implementation Decisions + +- Modules: Run driver (infra, workspace, seeding, Migrator invocation, Oracle, Run Report); Oracle (behaviour, no-rewrite and static layers); Reference Migration plus Fake Migrators for the self-test; Migrator adapter (headless Claude in a restricted Migrator Environment); Iteration driver with Editor adapter and citation gate; Loop driver. +- The Fixture App and its glossary already exist in the harness directory. Before invoking a Migrator, remove the README sentence pointing it at a "harness acceptance command" and replace its fixed friction.md instruction with the schema and environment-named Friction Log output path. These are harness workspace preparation steps; the repository Fixture App remains unchanged in this planning PR. +- Store provisioning: provision two Store Sets per Run, one for the Migrator and one for the Oracle. Each set has a dedicated DynamoDB Local container and a per-Run database on its respective shared Postgres container. Clone databases from an EQL v3 template, make each database owned by its per-Run role, with CREATE privileges on the application schema needed by createStores and revoke CONNECT from PUBLIC, including template and maintenance databases; roles receive no memberships granting other access. The harness alone holds admin credentials for provisioning and snapshots; application initialization and seeding use each Store Set's per-Run role, so that role owns the application tables it creates. Migrators may reach only their Migrator Stores; App Hosts may reach only their Oracle Stores, using their respective per-Run roles. +- Local endpoint topology: preserve the Fixture App's loopback-only store-host validation. Each Migrator Environment and App Host has its own loopback forwarders to its assigned store endpoints. Enforce destination and port policy outside application control; never allow all host-loopback ports or expose Docker sockets. A container implementation must provide these namespace-local forwarders rather than passing container DNS names to the Fixture App. +- Seeding: the unmigrated Fixture App initializes and writes Legacy Data and Mutation Data into both Store Sets using each set's per-Run role before the Migrator starts. Mutation Data is excluded from the no-rewrite snapshot. The Oracle snapshots its own Legacy Data immediately after seeding. +- **App Host**: the Oracle never imports or runs migrated code in the harness process. + - Installing the migrated workspace's dependencies, including any lifecycle scripts, and calling its createApp both happen in a per-Run App Host. That is a separate OS-restricted process, with the App Host policy enforced independently of the Migrator Environment policy. + - Its filesystem view is a copy of the migrated workspace only. + - Its network egress permits only the npm registry, CipherStash services and this Run's Oracle Stores, with the Run's Oracle role. + - It exposes the Fixture App README API to the harness over a narrow request/response channel (JSON over stdio), one call per message. + - Protected Resources remain outside the App Host filesystem and credential scope. + - Static checks read the installed workspace copy used by the App Host from the harness without executing its files. Inspect after lifecycle scripts, including scripts that introduce a removed endpoint shim. The App Host's application files are then read-only through verification; record their content hashes and refuse a pass if the files checked differ from those executed. +- Snapshot scope: no-rewrite acceptance covers independently seeded Oracle Stores and the deployed application behaviour exercised by the Oracle. Migrator Stores are disposable exploration state; the current baseline does not claim their contents remain unchanged during exploration. A migration that rewrites deployed legacy bytes still fails the Oracle checks. Any future guarantee about exploratory writes requires separate Migrator-store snapshots and acceptance cases. +- Oracle order, against Oracle Stores only, with every app call made through the App Host: (1) read-only behaviour checks on Legacy Data (get, every find*, getPostgres, findPostgres*); (2) no-rewrite comparison of every Legacy Data DynamoDB `__source`/`__hmac` and Postgres `c`/`hm` against the snapshot; (3) mutating behaviour checks on Mutation Data: put with a new pk absent from Oracle Stores, verify the fresh write and its lookups, then setActive, copyToPostgres and copyToDynamo on Mutation Data, never on Legacy Data; (4) the migration layer. +- Migration layer: checks that hold only for a migrated app, so the unmigrated app is expected to fail every one. + - Static: `@cipherstash/protect`, `@cipherstash/protect-dynamodb` and `@cipherstash/schema` are absent from imports, the manifest and the lockfile; `@cipherstash/protect-ffi` is allowed only at the version the resolved Stack depends on (the legacy 0.18.1 must be gone); the CS_CTS_HOST/CS_ZEROKMS_HOST shim is removed. + - Stored-shape: after the migrated setActive on a Mutation Data record, the item has no `active__hmac` (guide step 5). This is asserted on the stored item, not through findActive: a correct migration implements findActive by decrypting and filtering, which a stale HMAC does not affect. +- Oracle pass means all layers pass. +- Protected Resource policy: exclude the source checkout except explicitly exported copies, Oracle source and assertions, snapshots, Reference Migration, raw artifacts, other Runs' workspaces and credentials, and host-side model credentials from restricted processes. Assigned application credentials are available only to the process that needs them and never to the Editor. The actor-specific store permissions below additionally exclude Oracle Stores from the Migrator and all stores from the Editor. +- Isolation is enforced, not requested, with a host-side broker for the agent. + - The agent process, which talks to the model service and holds its credentials, runs on the host, outside the Migrator Environment. + - Every command it executes (shell, node, npm, psql) runs inside the OS-restricted Migrator Environment, whose filesystem view is limited to the workspace and whose network egress permits only the npm registry, CipherStash services (CTS, ZeroKMS) and the Run's Migrator Stores. The model service is not reachable from the Migrator Environment, and model credentials are not in its environment or filesystem. + - The host model runtime exposes only the harness-owned isolated command tool. Disable built-in file, shell, WebFetch and WebSearch tools, arbitrary MCP servers, plugins, hooks and inherited user/project settings. Test that all application file and command operations traverse the restricted broker and that no alternative host or network tool is available; fail setup if the runtime's actual tool inventory differs from the allowlist. Issue #1534 must select and demonstrate an isolation implementation satisfying the policy and supervision contract before executing untrusted application code; #1537 reuses that verified implementation for agent commands. That choice is an implementation prerequisite, not a configurable backend interface in the first version. + - The tool allowlist stays as a further layer. The Migrator Environment gets CS_* credentials and the Migrator Stores' URLs and role credentials, and sees only the copied guide and the Fixture App. +- Registry documentation: npm installation necessarily makes package documentation available, including tarball READMEs, and registry metadata can contain instructions. Retain broker commands and responses and supervisor file-access evidence so explicit registry documentation requests and reads of installed documentation are attributable. Record this exposure in the Run Report and flag observed supplementary-documentation use for review. A passing Oracle alone establishes application correctness, not that the copied guide was sufficient; a guide-only claim requires review of that evidence, and unknown or incomplete documentation-access evidence cannot establish guide-only success. Do not claim that network allowlisting or a command-name filter excludes all documentation. +- The Migrator is headless `claude -p`: Sonnet by default, `acceptEdits`, with configurable limits defaulting to 40 minutes and 200 turns. +- Stack source: published npm, default range `^1.2.1`, or a tarball packed from the tree. Resolved once per Loop (or per standalone Run or Iteration) to an exact version or tarball digest, which every Run installs. +- Run Manifest: every Run Report records the exact Stack version or tarball digest, guide content hash, Fixture App revision, model identifiers and agent configuration (allowlist, limits, Migrator Environment and App Host policy identifiers). +- Runtime supervision: every real Run and Editor invocation uses a host-owned supervisor outside the restricted processes. The selected implementation must deliver filesystem and network access events for all descendant processes through an authenticated, actor-tagged event stream inaccessible to the application. Events distinguish denied access from successful access, include resolved resource identity and policy decision, and are correlated with the actor's permitted resources. An implementation without this capability, or a broken event stream, fails provisioning as `infrastructure`; it must not claim breach detection from agent output. A successful forbidden access is successful access to a path or network destination outside the actor's policy, established by the supervisor's trusted event stream. On receipt, the supervisor terminates the actor and every descendant, including detached processes and children in new sessions, prevents later app/tool calls and aborts the Loop; do not promise zero latency before the event arrives. The same rule applies to Migrator, App Host and Editor. Use a per-actor container/cgroup or prevent descendants escaping the teardown boundary; killing a process group alone is insufficient. Timeout cleanup obeys the same descendant-complete rule. Put synthetic protected files and forbidden listener canaries outside permitted views for startup probes in every real invocation; canaries contain no real secrets. Exercise the same supervisor in self-tests, including a controlled policy mismatch that emits a successful forbidden-access event. No universal covert-access detection is claimed. +- Isolation observations: a denied access is recorded separately from a successful forbidden access. Filesystem/network events and Postgres CONNECT logs supply trusted evidence where applicable. Reading an environment variable produces no filesystem or network event, and an empty DynamoDB listing alone does not establish isolation: assert model credential canaries absent and other Runs' tables absent using harness-owned probes and store inspection. Do not trust a Fake Migrator's self-reported verdict. Recovered denied exploration can still yield pass or friction-only under the normal outcome rules. +- Failure classification: retain all observed failures, and select one primary outcome in the following order. Outcomes are independent of guide attribution. + 1. `isolation-violation`: the supervisor establishes a successful forbidden access (for example a protected canary was read or a forbidden connection succeeded). Apply the runtime-supervision stop rule, retain available evidence and clean up. This fails the Run, is not retried, and aborts the Loop for human investigation; it is not sent to the Editor. A denied attempt alone never produces this outcome. + 2. `infrastructure`: verified provisioning or enforcement setup failure, including inability to establish required isolation. Stop dependent stages; an application denial is not infrastructure. Pre-Migrator dependency installation, seeding, snapshot or unmigrated Fixture App initialization failures occur before any migration and are harness setup failures in this category, including ordinary setup exceptions; report their stage and cause explicitly. + 3. `agent-limit`: time/turn limit, crash or non-zero agent exit. + 4. `install`: an unrecovered dependency installation failure in the harness-controlled migrated App Host installation stage. Pre-Migrator installation failures are `infrastructure`, eligible for the infrastructure retry policy and never consumed as completed migration evidence. Failed npm commands during a Migrator session are transcript evidence, not `install` outcomes; if the Migrator recovers, subsequent checks decide the result. A finished Migrator leaving an un-installable app fails the App Host installation. An agent crash instead gives `agent-limit`. + 5. `invalid-friction-log`: missing or schema-invalid Friction Log after a finished Migrator, even if Oracle checks also fail. + 6. `behaviour`: Oracle failure after a finished Migrator. + 7. `friction-only`: Oracle passed and the valid Friction Log contains actionable friction. + 8. `pass`: Oracle passed, the Friction Log is valid and has no actionable friction. +- Run stages are provisioning, unmigrated dependency installation, seeding/snapshot, Migrator, Friction Log validation, App Host installation and Oracle checks, then Run Report. A failed prerequisite skips dependent stages and records them as skipped. Independent diagnostics may continue except after a successful forbidden access. A finished Migrator with an invalid Friction Log may still receive Oracle diagnostics. Primary outcome is selected from unresolved stage failures and successful forbidden accesses by the precedence above, never by the last stage to fail. +- Editor eligibility: a Run contributes candidate guide evidence only if the Migrator was invoked and produced an exported Run Report, has no successful forbidden access and has a non-infrastructure outcome. Pre-Migrator install/setup failures cannot reach the Editor. If no Run is eligible, skip the Editor and record why; the Iteration is not clean. Infrastructure Runs are excluded from Editor input and retried up to a configurable limit. An Iteration is complete only when every Run Slot ends in a non-infrastructure outcome. Exhausted retries make it incomplete: no Editor pass, no clean result, a broken clean streak, and one Iteration consumed toward the maximum. Secondary failures remain visible regardless of primary outcome. +- Guide section identity: parse Markdown ATX headings using lowercase ASCII slugs (non-alphanumeric runs become hyphens), with duplicate slugs suffixed by occurrence number; text before the first heading is `preamble`. Record IDs and line ranges against the input guide hash. A renamed or moved section is handled as a deletion and insertion; no persistent section aliases are maintained. +- Evidence identity: the harness assigns immutable IDs to redacted evidence records as `run-id/kind/ordinal`; records contain the producing stage, kind, stable check or tool-call ID, payload digest, attribution-usable flag and guide revision. Kinds include `oracle-check`, `friction-item`, `agent-tool`, `stage-error` and `log-validation`. The Editor cannot mint or alter the evidence catalog. Every export carries the same IDs across inline summaries and opened artifacts. +- Attribution gate: the Editor returns a schema-validated Review List with `needs-test`, `skill-drift`, `diagnosis` and `edit-mapping` entries. Diagnoses contain ID, eligible Run IDs, existing evidence IDs, original guide section ID, attribution (`guide-gap`, `migrator-error`, `harness-defect`, `unknown`) and rationale. A `guide-gap` requires at least one attribution-usable evidence record other than `log-validation` and an eligible Run; an invalid Friction Log alone is mechanically insufficient. +- Edit mapping: the harness parses headings in the input guide into section IDs and maps changed lines using a deterministic unified diff with zero context. Each changed hunk is identified by its ordinal plus before/after guide hashes. An edit-mapping entry names that hunk, one or more guide-gap diagnosis IDs and all touched original section IDs. Insertions use the preceding original section (document start is `preamble`); deletion and heading changes use the original sections covering removed lines. Moves, heading renames and restructures require mappings for both the deletion and insertion hunks under the same rules. Reject missing evidence, unaccounted hunks or any touched original section without a covering diagnosis. This checks provenance and coverage, not semantic truth; human review still assesses attribution and claims. +- Command contract for swappable Migrator and Editor commands: input is the working directory plus environment variables naming the guide, workspace, store URLs (Migrator) or Iteration Results directory (Editor), and the output paths; output is files at those paths (Friction Log for the Migrator; edited guide and Review List for the Editor); exit 0 means finished, non-zero means the agent itself failed; the harness enforces the time limit by terminating the actor and all descendants under the runtime-supervision contract and records `agent-limit`. +- The Friction Log is a schema-validated list with an explicit empty list for no friction. Each entry contains the input guide section ID, a short issue slug, an actionable/informational flag, what was unclear/wrong/missing and what the Migrator did instead. The issue slug is lowercase ASCII words joined by hyphens describing the issue. The friction identifier is the pair of input guide section ID and short issue slug. Every Migrator starts without prior Friction Logs, friction identifiers, diagnoses or workarounds in its prompt or workspace; the harness reconciles identifiers after collecting the independent Runs. Matching pairs identify recurring friction; different pairs remain separate. Heading changes or different issue wording can produce new identifiers, which remain visible in the Loop Summary for human review rather than being silently merged. Such identity changes cannot make an Iteration clean while any Run reports actionable friction. A missing/malformed Friction Log gives `invalid-friction-log` according to outcome precedence. +- Friction is reconciled per complete Iteration. An identifier is open if any Run in that Iteration reports it as actionable. It is resolved only when a complete Iteration in which every Run Slot produced a valid Friction Log reports it from no Run. A Run without a valid Friction Log never resolves anything by omission. Resolution needs no guide edit, so transient friction clears on a confirmation Iteration of the same revision. +- Evidence export: before the Editor runs, Iteration Results contain redacted Run Reports and the evidence catalog. After the Editor finishes, the harness adds the edit disposition, including acceptance or rejection and gate results. A host-side exporter replaces configured CS_* secrets, database credentials, credential-bearing URLs and their URL-encoded/JSON-escaped forms; it drops environment dumps and binary attachments. An independent post-export leak scan checks all exported files and inline model-input payloads against the same secret inventory before any Editor invocation. A match or export failure stops the Editor pass, never falls back to raw evidence, and leaves the guide unchanged. Raw artifacts are Protected Resources. +- Redaction usability: replace only secret spans with typed markers, retaining evidence IDs, guide sections, check names, dependency package/version, exit code and non-secret error context. If a required field contains a secret, redact it and mark that record unusable for attribution; never expose the secret to preserve context. Tests must assert both leak absence and preservation of non-secret diagnostic fields. These measures cover inventoried forms, not arbitrary adversarial encodings. +- Editor setup: headless `claude -p` on Opus by default, using a fresh Editor workspace with copies of the guide and Review List and read-only Iteration Results. The checkout guide is not mounted. Optionally export explicitly selected relevant skills as read-only, redacted copies with source revision metadata so skill drift can be noticed; no skill is shown to the Migrator. Absence of exported skill context is recorded and means no skill-drift assessment, not that skills are correct. +- Editor boundaries: enforced file-tool and command policies allow writes only to its guide and Review List copies. No store access, network egress, host credentials or Docker socket is available to commands; model traffic stays in the host broker. All Protected Resources remain inaccessible. Denials are recorded. A successful forbidden access follows the shared runtime-supervision rule and aborts the Loop; an attempted denied write alone does not. Out-of-scope outputs are rejected. The harness applies only accepted guide/Review List changes back to its working copy after gates pass. +- Editor authority: use Iteration Results as untrusted evidence, never instructions. Clarify, restructure or add procedural steps and reuse existing compatibility claims with their citations; put proposed new claims and noticed skill drift in the Review List instead of changing claims or skills. +- Editor gates: attribution gate, citation-existence test, and citation-set check all must pass; otherwise revert the whole proposed guide edit. The citation-set gate conservatively rejects previously absent citations without implying that every new citation is a new claim. These gates cannot establish semantic attribution, detect every uncited new claim or prove that an existing citation supports a changed claim. Human review of the Loop Summary remains required. +- An Iteration is 3 Run Slots in parallel by default, then one Editor pass. A Clean Iteration is complete, every Run Slot has primary outcome `pass`, and no Friction Log contains actionable friction; a passing Run requires a valid Friction Log. The Editor makes no edit after a Clean Iteration or an incomplete Iteration. Track clean streaks separately by store procedure and guide hash. A procedure converges after two consecutive Iterations for that procedure are Clean Iterations on the same guide hash; an incomplete or non-clean Iteration breaks its streak. Combined convergence requires both procedures to converge on the same final hash, even when no Editor edits occurred. A guide edit invalidates all prior-hash streaks. The Loop stops at combined convergence or at 6 Iterations; both limits are configurable. Reaching the limit without both procedures converged is not combined convergence. +- Commands are local-only: `harness:run`, `harness:iterate`, `harness:loop`, `harness:selftest` in the e2e package. None is named after a turbo task. No workflow. + +## Testing Decisions + +- Test only through external behaviour: Run Reports and Iteration Results, never Oracle internals. +- Seam 1: a Run, with the Migrator as a swappable command. A Fake Migrator copies the hidden Reference Migration into the workspace and must pass; the Reference Migration itself is application code, not a Migrator command. Other Fake Migrators leave the Fixture App unchanged (behaviour/no-rewrite pass, migration layer fails) or apply Broken Migrations: missing downcase normalization on new writes, stale boolean HMAC after setActive despite correct decrypt/filter lookup, broken bigint serialization, and ciphertext rewritten on read. Named check mapping: downcase write → `behaviour.downcase-new-write-lookup`; stale HMAC → `migration.active-hmac-absent`; bigint serialization → `behaviour.balance-decimal-string`; read rewrite → `no-rewrite.legacy-bytes`. Expose these stable check IDs in Run Reports and the evidence catalog. +- Isolation acceptance cases exercise the Protected Resource policy above, for both Migrator and App Host filesystem probes. Trusted harness assertions validate probe results; the supervisor must collect the required filesystem and network access events. Cases include filesystem denial, forbidden-host/model-service connections, a Migrator denied access to its own Run's Oracle Stores and every other Run's Store Sets, other-Run Postgres CONNECT denial with server-side log evidence, and own DynamoDB endpoint containing no other Run's tables. Separate canary checks establish that model credentials are absent from command environments and mounted files; reading an absent variable is not an access violation. +- Local topology tests, in both Migrator Environments and App Hosts, permit assigned loopback forwarders but deny a listener on an unrelated host-loopback port, other Runs' forwarded ports, and Docker socket access. Run the unchanged Fixture App through assigned endpoints to prove its loopback validation is satisfied. +- App Host cases execute Broken Migrations whose createApp or dependency lifecycle script probes Protected Resources or forbidden hosts. The supervisor independently records denied filesystem and network access, and the harness confirms no protected content or connection was obtained. A caught denial alone does not fail otherwise valid application behaviour; an uncaught exception may fail installation or behaviour. A controlled policy mismatch, using the same active supervisor and canary resources as real Runs, must detect a successful protected canary read, produce `isolation-violation`, stop further calls and abort the Loop. +- Additional acceptance cases cover an App Host lifecycle script introducing the endpoint shim into the installed copy, a detached descendant surviving a process-group kill, explicit registry README retrieval and installed README reads, and a no-edit Loop where only one store procedure converges. These must respectively fail migration checks, prove complete teardown, record supplementary-documentation use, and refuse combined convergence. +- Editor isolation cases cover every Protected Resource, including other workspaces, and denied writes outside the guide and Review List. Also deny store, arbitrary-host and model-service egress from Editor commands. Verify no out-of-scope file changes survive; rejected Editor output preserves the prior guide. +- Redaction tests place unique credential canaries into transcript, diff, Friction Log, error text and manifest inputs, including URL-encoded and JSON-escaped variants. Assert exported Iteration Results and model-input payloads contain none of those canaries, and that raw artifacts cannot be opened by the Editor. Export failure or a secret found by the post-export leak scan must prevent an Editor invocation. Verify package/version, exit codes, section IDs and non-secret error context survive redaction, and secret-bearing required fields are marked unusable. +- Outcome precedence tests cover every category and every adjacent pair that can coexist, using controlled failures visible at the Run seam; mutually exclusive or skipped categories are checked for correct exclusion instead. Include a Migrator crash after a failed npm tool command (`agent-limit`, no `install` stage failure), a recovered npm command followed by successful Oracle checks (pass or friction-only), App Host install failure plus invalid Friction Log, absent Friction Log plus Oracle failure, pre-seeding install failure with dependent stages skipped, ordinary denied exploration followed by a valid migration (no isolation-violation), seeding and snapshot exceptions (`infrastructure`, no Editor), pre-Migrator install failure (no Editor), and a successful forbidden-access event followed by an attempted later call (later call never runs). No Fake Migrator install-report channel is required: install failures are injected through the harness-controlled install stages. +- Attribution gate tests supply Editor outputs with missing diagnosis fields, invented evidence IDs, log-validation-only evidence, unknown/mismatched section or hunk IDs, heading rename/move without complete deletion and insertion mappings, a diff hunk without a diagnosis, and `migrator-error`, `harness-defect` or `unknown` attribution for a changed hunk: each must preserve the prior guide. A structurally valid guide-gap diagnosis linked to exported evidence permits a correction, including a mapped multi-section restructure. An exported skill copy permits a skill-drift item but cannot be edited. No test claims to prove the truth of its rationale. +- Friction Log validation: a Fake Migrator that exits 0 with no Friction Log, and one that writes a malformed one, must give the `invalid-friction-log` outcome even when the migration itself is correct (a Fake Migrator copying the Reference Migration but writing no Friction Log). +- Seam 2: an Iteration, with the Editor as a swappable command. A Fake Editor that adds a fabricated citation must be reverted; a clean edit must be kept. Infrastructure-classified Runs must be excluded from Editor input. Stop-condition tests use canned Iteration Results, including recurring friction (never clean), two Clean Iterations on different guide revisions (not converged), an Iteration with exhausted infrastructure retries (incomplete, breaks the streak), all Runs infrastructure-failed (incomplete, not clean), friction reported by one of three Runs (still open), transient friction absent from a full confirmation Iteration on the same revision (resolved), and open friction omitted by a Run with no valid Friction Log (still open, and the Iteration is not clean). +- A Fake Editor that adds a real but previously uncited test citation must be reverted by the citation-set check. Uncited new claims and new claims attached to existing citations are left to human review of the guide diff; no test claims to catch them. +- Tests that need credentials and Docker are gated like the compat suite. +- Prior art: the credential-gated compat and crossover vitest suites in the e2e package, and the guide citation test (protect-upgrade-guide) used as the Editor gate. + +## Out of Scope + +- Running the harness in CI. +- The baseline Fixture App's Postgres is already EQL v3. Upgrading a v2 Postgres database is covered by the priority amendment and its separate extension, not by this baseline. +- JSON (`dataType('json')`) columns, date columns, lock contexts, nested attributes, and index kinds beyond equality. +- Real AWS DynamoDB; DynamoDB Local only. +- The Editor editing skills, the Fixture App, the Oracle or the compat tests. +- Auto-committing guide changes or opening PRs. +- Upgrade guides beyond the two v2-to-v3 store procedures in the priority amendment. + +## Further Notes + +Tickets: #1534, #1535, #1536, #1537, #1538, #1539. + +## Contract changes from the issue snapshot + +This ADR is the source of truth; #1540 tracks the epic. The `report` outcome is named `invalid-friction-log`, and the broader Review List replaces the needs-test list. The Reference Migration establishes passability rather than guide attribution. Clean means no actionable friction. Explicit supervision, Editor restrictions, evidence redaction, attribution provenance, Mutation Data and local topology make the original isolation and guide-edit requirements concrete. The command seam supports both deterministic fakes and alternate agent implementations. Denied attempts are recorded but do not themselves fail a Run; this deliberately replaces the issue snapshot's denial-implies-failure rule, reserving `isolation-violation` for a successful forbidden access. Friction identifiers use the original guide-section-plus-issue-slug pair; the proposed harness-assigned catalog IDs, prior-friction prompt input and section aliases are removed so earlier workarounds cannot mask guide gaps. diff --git a/e2e/migration-harness/fixture/README.md b/e2e/migration-harness/fixture/README.md new file mode 100644 index 0000000000..da33779da6 --- /dev/null +++ b/e2e/migration-harness/fixture/README.md @@ -0,0 +1,36 @@ +# Customer records + +This application uses Protect.js to encrypt customer records in DynamoDB Local. +It copies the `email`, `age` and `notes` ciphertexts into Postgres EQL v3 columns +and can copy them back. Postgres is already EQL v3; upgrading an EQL v2 database +is outside this exercise. + +Migrate the application using `migration-guide.md`. Edit `src/app.mjs`, +`src/stores.mjs` and the package manifest/lockfile. Keep the exported API below +so the harness can check the same behavior before and after the migration. +Record unclear instructions and failed approaches in `friction.md`. + +`createApp(env)` needs the four `CS_*` credentials, `HARNESS_DYNAMO_URL`, +`HARNESS_TABLE`, and `DATABASE_URL`. The harness creates the databases and +supplies these values. Call `close()` when finished. + +- `put(customer)`, `get(pk)`: encrypted DynamoDB write/read. Missing reads return `null`. +- `findEmail(value)`, `findEmailLower(value)`, `findAge(value)`, + `findBalance(value)`, `findActive(value)`: return matching decrypted customers. + Email is case sensitive; emailLower is case insensitive. Keep active encrypted; + a paginated scan followed by decryption and filtering is acceptable for this small app. +- `setActive(pk, active)`: update only the active field of an existing customer. +- `copyToPostgres(pk)`, `copyToDynamo(pk)`: copy ciphertext without re-encryption. + Copying back preserves the existing DynamoDB-only fields. +- `getPostgres(pk)`, `findPostgresEmail(value)`, `findPostgresAge(value)`: + return decrypted records containing only `pk`, `email`, `age` and `notes`. + +A customer has `pk`, `email`, `emailLower`, `age`, `balance`, `active`, and +`notes`. At this public API, `balance` is a decimal integer **string** for JSON +compatibility; the legacy encryption boundary converts it to a safe JS number. +The migration may lowercase new `emailLower` plaintext, as described by the +guide. Existing records must remain readable and queryable without rewriting +their ciphertext. JSON documents are a separate future scenario. + +`npm run check` checks JavaScript syntax. It is not a database or encryption test; +use the harness acceptance command for those checks. diff --git a/e2e/migration-harness/fixture/package.json.template b/e2e/migration-harness/fixture/package.json.template new file mode 100644 index 0000000000..3332536939 --- /dev/null +++ b/e2e/migration-harness/fixture/package.json.template @@ -0,0 +1,17 @@ +{ + "name": "protect-migration-customer-app", + "version": "1.0.0", + "private": true, + "type": "module", + "engines": { "node": ">=22" }, + "scripts": { + "check": "node --check src/app.mjs && node --check src/stores.mjs" + }, + "dependencies": { + "@aws-sdk/client-dynamodb": "3.1163.0", + "@aws-sdk/lib-dynamodb": "3.1163.0", + "@cipherstash/protect": "10.2.1", + "@cipherstash/protect-dynamodb": "6.0.1", + "postgres": "3.4.8" + } +} diff --git a/e2e/migration-harness/fixture/src/app.mjs b/e2e/migration-harness/fixture/src/app.mjs new file mode 100644 index 0000000000..84e8bfcdd3 --- /dev/null +++ b/e2e/migration-harness/fixture/src/app.mjs @@ -0,0 +1,183 @@ +import { csColumn, csTable, protect } from '@cipherstash/protect' +import { protectDynamoDB } from '@cipherstash/protect-dynamodb' +import { createStores } from './stores.mjs' + +const customers = csTable('customers', { + email: csColumn('email').equality(), + emailLower: csColumn('emailLower').equality([{ kind: 'downcase' }]), + age: csColumn('age').dataType('number').equality(), + balance: csColumn('balance').dataType('bigint').equality(), + active: csColumn('active').dataType('boolean').equality(), + notes: csColumn('notes'), +}) +const postgresColumns = ['email', 'age', 'notes'] + +function unwrap(result) { + if (result.failure) throw new Error(result.failure.message) + return result.data +} + +function legacyBalance(value) { + if (typeof value !== 'string' || !/^-?(0|[1-9]\d*)$/.test(value)) { + throw new Error('Balance must be a decimal integer string') + } + const number = Number(value) + if (!Number.isSafeInteger(number)) + throw new Error('Legacy balance exceeds the safe integer range') + return number +} + +function publicCustomer(model) { + if ('balance' in model) return { ...model, balance: String(model.balance) } + return model +} + +let legacyClientQueue = Promise.resolve() + +function legacyClient(env) { + // Protect reads global host settings; keep each override until restoration. + const client = legacyClientQueue.then(() => initializeLegacyClient(env)) + legacyClientQueue = client.then( + () => {}, + () => {}, + ) + return client +} + +async function initializeLegacyClient(env) { + for (const key of [ + 'CS_WORKSPACE_CRN', + 'CS_CLIENT_ID', + 'CS_CLIENT_KEY', + 'CS_CLIENT_ACCESS_KEY', + ]) { + if (!env[key]) throw new Error(`Missing ${key}`) + } + const region = env.CS_WORKSPACE_CRN.split(':')[1] + const saved = { + CS_CTS_HOST: process.env.CS_CTS_HOST, + CS_ZEROKMS_HOST: process.env.CS_ZEROKMS_HOST, + } + process.env.CS_CTS_HOST = + env.CS_CTS_HOST ?? `https://${region}.cts.cipherstashmanaged.net` + process.env.CS_ZEROKMS_HOST = + env.CS_ZEROKMS_HOST ?? `https://${region}.viturhosted.net` + try { + return await protect({ + schemas: [customers], + workspaceCrn: env.CS_WORKSPACE_CRN, + clientId: env.CS_CLIENT_ID, + clientKey: env.CS_CLIENT_KEY, + accessKey: env.CS_CLIENT_ACCESS_KEY, + }) + } finally { + for (const [key, value] of Object.entries(saved)) { + if (value === undefined) delete process.env[key] + else process.env[key] = value + } + } +} + +export async function createApp(env = process.env) { + const client = await legacyClient(env) + const encrypted = protectDynamoDB({ protectClient: client }) + const stores = await createStores(env) + + async function decrypt(item) { + return item === null + ? null + : publicCustomer(unwrap(await encrypted.decryptModel(item, customers))) + } + + async function term(column, value) { + const [hmac] = unwrap( + await encrypted.createSearchTerms([ + { value, column: customers[column], table: customers }, + ]), + ) + return hmac + } + + async function find(column, value) { + const items = await stores.query(column, await term(column, value)) + return Promise.all(items.map(decrypt)) + } + + function fromPostgres(row) { + if (row === null) return null + return Object.assign( + { pk: row.pk }, + ...postgresColumns.map((column) => ({ + [`${column}__source`]: row[column].c, + ...(typeof row[column].hm === 'string' + ? { [`${column}__hmac`]: row[column].hm } + : {}), + })), + ) + } + + async function findPostgres(column, value) { + const rows = await stores.findPostgres(column, { + v: 3, + i: { t: 'customers', c: column }, + hm: await term(column, value), + }) + return Promise.all(rows.map((row) => decrypt(fromPostgres(row)))) + } + + return { + async put(customer) { + const item = unwrap( + await encrypted.encryptModel( + { ...customer, balance: legacyBalance(customer.balance) }, + customers, + ), + ) + await stores.put(item) + }, + async get(pk) { + return decrypt(await stores.get(pk)) + }, + findEmail: (value) => find('email', value), + findEmailLower: (value) => find('emailLower', value), + findAge: (value) => find('age', value), + findBalance: (value) => find('balance', legacyBalance(value)), + findActive: (value) => find('active', value), + async setActive(pk, active) { + const attributes = unwrap( + await encrypted.encryptModel({ active }, customers), + ) + await stores.updateActive(pk, attributes) + }, + async copyToPostgres(pk) { + const item = await stores.get(pk) + if (!item) throw new Error('Customer not found') + const row = Object.fromEntries( + postgresColumns.map((column) => [ + column, + { + v: 3, + i: { t: 'customers', c: column }, + c: item[`${column}__source`], + ...(typeof item[`${column}__hmac`] === 'string' + ? { hm: item[`${column}__hmac`] } + : {}), + }, + ]), + ) + await stores.putPostgres({ pk, ...row }) + }, + async getPostgres(pk) { + return decrypt(fromPostgres(await stores.getPostgres(pk))) + }, + findPostgresEmail: (value) => findPostgres('email', value), + findPostgresAge: (value) => findPostgres('age', value), + async copyToDynamo(pk) { + const row = await stores.getPostgres(pk) + if (!row) throw new Error('Customer not found') + const existing = await stores.get(pk) + await stores.put({ ...existing, ...fromPostgres(row) }) + }, + close: () => stores.close(), + } +} diff --git a/e2e/migration-harness/fixture/src/stores.mjs b/e2e/migration-harness/fixture/src/stores.mjs new file mode 100644 index 0000000000..88b38dacaa --- /dev/null +++ b/e2e/migration-harness/fixture/src/stores.mjs @@ -0,0 +1,183 @@ +import { + CreateTableCommand, + DescribeTableCommand, + DynamoDBClient, + waitUntilTableExists, +} from '@aws-sdk/client-dynamodb' +import { + DeleteCommand, + DynamoDBDocumentClient, + GetCommand, + PutCommand, + QueryCommand, + ScanCommand, + UpdateCommand, +} from '@aws-sdk/lib-dynamodb' +import postgres from 'postgres' + +export async function createStores(env = process.env) { + for (const key of ['HARNESS_DYNAMO_URL', 'HARNESS_TABLE', 'DATABASE_URL']) { + if (!env[key]) throw new Error(`Missing ${key}`) + } + const endpoint = new URL(env.HARNESS_DYNAMO_URL) + const database = new URL(env.DATABASE_URL) + if ( + ![endpoint, database].every((url) => + ['localhost', '127.0.0.1', '[::1]'].includes(url.hostname), + ) + ) { + throw new Error('Fixture stores must be local disposable databases') + } + const raw = new DynamoDBClient({ + endpoint: endpoint.href, + region: 'us-east-1', + credentials: { + accessKeyId: 'migrationfixture', + secretAccessKey: 'migrationfixture', + }, + }) + const dynamo = DynamoDBDocumentClient.from(raw) + const TableName = env.HARNESS_TABLE + const sql = postgres(env.DATABASE_URL, { prepare: false, onnotice: () => {} }) + + async function pages(Command, input) { + const items = [] + let cursor + do { + const page = await dynamo.send( + new Command({ + TableName, + Limit: 2, + ...input, + ...(cursor ? { ExclusiveStartKey: cursor } : {}), + }), + ) + items.push(...(page.Items ?? [])) + cursor = page.LastEvaluatedKey + } while (cursor) + return items.sort((a, b) => a.pk.localeCompare(b.pk)) + } + + async function scan() { + return pages(ScanCommand, { ConsistentRead: true }) + } + + return { + async init() { + try { + await raw.send(new DescribeTableCommand({ TableName })) + } catch (error) { + if (error.name !== 'ResourceNotFoundException') throw error + await raw.send( + new CreateTableCommand({ + TableName, + BillingMode: 'PAY_PER_REQUEST', + AttributeDefinitions: [ + { AttributeName: 'pk', AttributeType: 'S' }, + { AttributeName: 'email__hmac', AttributeType: 'S' }, + ], + KeySchema: [{ AttributeName: 'pk', KeyType: 'HASH' }], + GlobalSecondaryIndexes: [ + { + IndexName: 'email-index', + KeySchema: [{ AttributeName: 'email__hmac', KeyType: 'HASH' }], + Projection: { ProjectionType: 'ALL' }, + }, + ], + }), + ) + } + await waitUntilTableExists( + { client: raw, maxWaitTime: 60 }, + { TableName }, + ) + await sql`CREATE TABLE IF NOT EXISTS customers ( + pk text PRIMARY KEY, + email public.eql_v3_text_eq, + age public.eql_v3_integer_eq, + notes public.eql_v3_text + )` + }, + async put(item) { + await dynamo.send(new PutCommand({ TableName, Item: item })) + }, + async get(pk) { + const result = await dynamo.send( + new GetCommand({ TableName, Key: { pk }, ConsistentRead: true }), + ) + return result.Item ?? null + }, + scan, + async query(column, hmac) { + if ( + !['email', 'emailLower', 'age', 'balance', 'active'].includes(column) + ) { + throw new Error('Unsupported lookup column') + } + const expression = { + ExpressionAttributeNames: { '#term': `${column}__hmac` }, + ExpressionAttributeValues: { ':term': hmac }, + } + return column === 'email' + ? pages(QueryCommand, { + ...expression, + IndexName: 'email-index', + KeyConditionExpression: '#term = :term', + }) + : pages(ScanCommand, { + ...expression, + ConsistentRead: true, + FilterExpression: '#term = :term', + }) + }, + async updateActive(pk, attributes) { + await dynamo.send( + new UpdateCommand({ + TableName, + Key: { pk }, + ConditionExpression: 'attribute_exists(pk)', + UpdateExpression: + 'SET active__source = :source, active__hmac = :hmac', + ExpressionAttributeValues: { + ':source': attributes.active__source, + ':hmac': attributes.active__hmac, + }, + }), + ) + }, + async putPostgres(row) { + await sql`INSERT INTO customers (pk, email, age, notes) + VALUES (${row.pk}, ${sql.json(row.email)}::jsonb, ${sql.json(row.age)}::jsonb, ${sql.json(row.notes)}::jsonb) + ON CONFLICT (pk) DO UPDATE SET email = excluded.email, age = excluded.age, notes = excluded.notes` + }, + async getPostgres(pk) { + const rows = + await sql`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes + FROM customers WHERE pk = ${pk}` + return rows[0] ?? null + }, + async findPostgres(column, term) { + if (column === 'email') { + return sql`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes + FROM customers WHERE eql_v3.eq(email, ${sql.json(term)}::jsonb::eql_v3.query_text_eq) ORDER BY pk` + } + if (column === 'age') { + return sql`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes + FROM customers WHERE eql_v3.eq(age, ${sql.json(term)}::jsonb::eql_v3.query_integer_eq) ORDER BY pk` + } + throw new Error('Unsupported Postgres lookup column') + }, + async clear() { + for (const item of await scan()) { + await dynamo.send( + new DeleteCommand({ TableName, Key: { pk: item.pk } }), + ) + } + await sql`DELETE FROM customers` + }, + async close() { + raw.destroy() + await sql.end() + }, + } +} diff --git a/e2e/package.json b/e2e/package.json index 33f5993a7f..e4ea25fedc 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -6,15 +6,23 @@ "type": "module", "scripts": { "test:e2e": "vitest run", - "typecheck": "tsc --noEmit -p tsconfig.json" + "test:protect-compat": "vitest run --config vitest.protect-compat.config.ts", + "typecheck": "tsc --noEmit -p tsconfig.json", + "test:protect-crossover": "vitest run --config vitest.protect-crossover.config.ts" }, "dependencies": { - "stash": "workspace:*", "@cipherstash/stack": "workspace:*", - "@cipherstash/wizard": "workspace:*" + "@cipherstash/wizard": "workspace:*", + "stash": "workspace:*" }, "devDependencies": { + "@cipherstash/protect": "10.2.1", + "@cipherstash/protect-dynamodb": "6.0.1", + "@cipherstash/stack-0.19": "npm:@cipherstash/stack@0.19.0", + "@cipherstash/test-kit": "workspace:*", "@types/semver": "7.8.0", + "dotenv": "17.4.2", + "postgres": "^3.4.8", "semver": "^7.8.0", "typescript": "catalog:repo", "vitest": "catalog:repo", diff --git a/e2e/tests/helpers/legacy-protect.ts b/e2e/tests/helpers/legacy-protect.ts new file mode 100644 index 0000000000..8e067ea405 --- /dev/null +++ b/e2e/tests/helpers/legacy-protect.ts @@ -0,0 +1,57 @@ +/** + * Shared plumbing for the suites that pin compatibility with the Protect.js + * stack customers still run: `@cipherstash/protect@10.2.1` (→ + * `@cipherstash/protect-ffi@0.18.1` → cipherstash-client 0.28) and + * `@cipherstash/protect-dynamodb@6.0.1`. + */ +import { fileURLToPath } from 'node:url' +import { config } from 'dotenv' +import { legacyProtect } from '../../migration-guide/legacy.ts' + +// A local `.env` in `e2e/` or at the repo root, as AGENTS.md describes. CI +// injects the variables directly; an existing value always wins. +config({ + path: ['../../.env', '../../../.env'].map((p) => + fileURLToPath(new URL(p, import.meta.url)), + ), + quiet: true, +}) + +export const authConfigured = Boolean( + process.env.CS_WORKSPACE_CRN && + process.env.CS_CLIENT_ID && + process.env.CS_CLIENT_KEY && + process.env.CS_CLIENT_ACCESS_KEY, +) + +/** + * Build Protect's native client (cipherstash-client 0.28) for the same + * workspace Stack uses. + * + * Unlike today's clients, 0.28 does not derive its service hosts from the + * workspace CRN: with no override it defaults to the legacy + * `ap-southeast-2.aws.auth.viturhosted.net`, so a workspace in another region + * gets a 401 from CTS. So point `CS_CTS_HOST` / `CS_ZEROKMS_HOST` at the CRN's + * region while the client is built, using the URLs current clients derive by + * service discovery (cts-common's `CtsServiceDiscovery` and + * `ZeroKmsServiceDiscovery`), then restore them: the hosts are read at + * construction, and Stack's client must keep deriving its own. Credentials + * are passed explicitly, as a Protect app configured from these variables + * would. + */ +export { legacyProtect } + +/** Unwrap a `{ data } | { failure }` result, failing the test on `failure`. */ +export function ok( + result: { data: T; failure?: undefined } | { failure: unknown }, + label: string, +): T { + if ('failure' in result && result.failure !== undefined) { + const failure = result.failure as { message?: unknown } + // An Error's message is not enumerable, so JSON.stringify alone drops it. + throw new Error( + `${label} failed: ${String(failure?.message ?? '')} ${JSON.stringify(failure)}`, + ) + } + return (result as { data: T }).data +} diff --git a/e2e/tests/protect-crossover.e2e.test.ts b/e2e/tests/protect-crossover.e2e.test.ts new file mode 100644 index 0000000000..c25dc76ba3 --- /dev/null +++ b/e2e/tests/protect-crossover.e2e.test.ts @@ -0,0 +1,406 @@ +/** + * Cross-store proof: one encrypted value moves between DynamoDB and Postgres + * WITHOUT being re-encrypted, in either direction, and stays decryptable and + * equality-queryable in both stores. + * + * An encrypted scalar is two strings in both stores: + * + * DynamoDB (protect-dynamodb 6.x, Stack 1.x) Postgres (EQL v3 column) + * ------------------------------------------ ------------------------ + * __source <-> c (the ciphertext) + * __hmac <-> hm (the equality term) + * + * The rest of the Postgres envelope is `v: 3` and `i: { t, c }` (table and + * column identity), which carries no secret and is rebuilt from the schema. + * So moving a value is copying two strings; no key is used and nothing is + * decrypted on the way. Every test here asserts the ciphertext arrives + * byte-identical, then proves the receiving store can still decrypt it and + * find it by equality. + * + * Origins covered: + * - items written by the REAL `@cipherstash/protect-dynamodb@6.0.1` (via + * `@cipherstash/protect@10.2.1`, protect-ffi 0.18.1), what the customer + * has today; + * - raw payloads from `@cipherstash/protect@10.2.1`'s `encrypt` (EQL v2); + * - rows and items written by the in-tree Stack 1.x. + * + * Needs the four `CS_*` credential variables and `DATABASE_URL` pointing at a + * Postgres the suite may create tables in. EQL v3 is installed through the + * real `stash eql install` (built by turbo's `^build`). Missing configuration + * fails the file rather than skipping it: this proves a claim made to + * customers. Runs from `vitest.protect-crossover.config.ts` as the + * `test:protect-crossover` task. + * + * `docs/migration/protect-dynamodb-to-stack.md` cites these tests by name, and + * `protect-upgrade-guide.e2e.test.ts` fails when a cited name stops existing: + * renaming or removing a test means updating the guide's claim with it. + */ +import { csColumn, csTable } from '@cipherstash/protect' +import { protectDynamoDB } from '@cipherstash/protect-dynamodb' +import { encryptedDynamoDB } from '@cipherstash/stack/dynamodb' +import { Encryption, encryptedTable, types } from '@cipherstash/stack/v3' +import { installEqlV3 } from '@cipherstash/test-kit/install' +import postgres from 'postgres' +import { afterAll, beforeAll, describe, expect, it } from 'vitest' +import { authConfigured, legacyProtect, ok } from './helpers/legacy-protect' + +if (!authConfigured || !process.env.DATABASE_URL) { + throw new Error( + 'protect-crossover: CS_WORKSPACE_CRN, CS_CLIENT_ID, CS_CLIENT_KEY, CS_CLIENT_ACCESS_KEY and DATABASE_URL must all be set (in the environment, e2e/.env or the repo-root .env)', + ) +} +const DATABASE_URL = process.env.DATABASE_URL + +// --------------------------------------------------------------------------- +// Schemas. Same property keys and DB column names in every generation. +// --------------------------------------------------------------------------- + +const legacyUsers = csTable('users', { + email: csColumn('email').equality(), + age: csColumn('age').dataType('number').equality(), + notes: csColumn('notes'), +}) + +const users = encryptedTable('users', { + email: types.TextEq('email'), + age: types.IntegerEq('age'), + notes: types.Text('notes'), +}) + +const COLUMNS = ['email', 'age', 'notes'] as const +type Column = (typeof COLUMNS)[number] +type Model = { pk: string; email: string; age: number; notes: string } +type Item = Record +type Envelope = { + v: 3 + i: { t: string; c: string } + c: string + hm?: string +} + +// --------------------------------------------------------------------------- +// The whole migration surface: two pure copies. No client, no key. +// --------------------------------------------------------------------------- + +/** A DynamoDB attribute pair → the EQL v3 envelope a Postgres column stores. */ +function toEnvelope(item: Item, column: Column): Envelope { + const hm = item[`${column}__hmac`] + return { + v: 3, + i: { t: users.tableName, c: column }, + c: item[`${column}__source`] as string, + ...(typeof hm === 'string' ? { hm } : {}), + } +} + +/** An EQL envelope (v2 or v3) → the DynamoDB attribute pair. */ +function toAttributes( + payload: { c?: unknown; hm?: unknown }, + column: Column, +): Item { + return { + [`${column}__source`]: payload.c, + ...(typeof payload.hm === 'string' + ? { [`${column}__hmac`]: payload.hm } + : {}), + } +} + +const itemToRow = (item: Item) => + Object.fromEntries(COLUMNS.map((col) => [col, toEnvelope(item, col)])) + +const rowToItem = ( + pk: string, + row: Record, +): Item => + Object.assign({ pk }, ...COLUMNS.map((col) => toAttributes(row[col], col))) + +/** The ciphertexts of an item or row, keyed by column, for byte comparison. */ +const ciphertextsOfItem = (item: Item) => + Object.fromEntries(COLUMNS.map((col) => [col, item[`${col}__source`]])) +const ciphertextsOfRow = (row: Record) => + Object.fromEntries(COLUMNS.map((col) => [col, row[col].c])) + +const corpus: Model[] = [ + { pk: 'user#1', email: 'ada@example.com', age: 36, notes: 'engines' }, + { pk: 'user#2', email: 'grace@example.com', age: 85, notes: 'compilers' }, + { pk: 'user#3', email: 'alan@example.com', age: 36, notes: 'machines' }, +] + +describe('cross-store: DynamoDB <-> Postgres with no re-encryption', () => { + const sql = postgres(DATABASE_URL, { prepare: false, onnotice: () => {} }) + const tableName = `crossover_${Date.now()}_${Math.random().toString(36).slice(2, 8)}` + + let legacyClient: Awaited> + let legacy: ReturnType + let client: Awaited> + let stack: ReturnType + /** Items exactly as protect-dynamodb 6.0.1 PutItem'd them, by pk. */ + const legacyItems = new Map() + + /** Insert one row; payloads are bound as raw objects, never pre-stringified. */ + async function insert(pk: string, row: Record) { + await sql.unsafe( + `INSERT INTO ${tableName} (pk, email, age, notes) VALUES ($1, $2::jsonb, $3::jsonb, $4::jsonb)`, + [pk, row.email, row.age, row.notes] as never[], + ) + } + + async function selectRow(pk: string): Promise> { + const [row] = await sql.unsafe( + `SELECT email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes FROM ${tableName} WHERE pk = $1`, + [pk], + ) + expect(row, `row ${pk}`).toBeDefined() + return row as unknown as Record + } + + /** The pks an SQL equality query finds, using a term Stack 1.x mints. */ + async function findBy( + column: 'email' | 'age', + value: string | number, + ): Promise { + const term = ok( + await client.encryptQuery( + value as never, + { table: users, column: users[column] } as never, + ), + `encryptQuery ${column}`, + ) + const domain = column === 'email' ? 'query_text_eq' : 'query_integer_eq' + const rows = await sql.unsafe( + `SELECT pk FROM ${tableName} WHERE eql_v3.eq("${column}", $1::jsonb::eql_v3.${domain})`, + [term as never], + ) + // Sorted here, not by ORDER BY: the database collation decides where '#' + // and digits fall, and the expectations are in JavaScript's order. + return rows.map((r) => (r as unknown as { pk: string }).pk).sort() + } + + beforeAll(async () => { + await installEqlV3(DATABASE_URL, 'postgres') + await sql.unsafe(` + CREATE TABLE ${tableName} ( + pk text PRIMARY KEY, + email public.eql_v3_text_eq, + age public.eql_v3_integer_eq, + notes public.eql_v3_text + )`) + + legacyClient = await legacyProtect([legacyUsers]) + legacy = protectDynamoDB({ protectClient: legacyClient }) + client = await Encryption({ schemas: [users] }) + stack = encryptedDynamoDB({ encryptionClient: client }) + + const written = ok( + await legacy.bulkEncryptModels(corpus, legacyUsers), + 'protect-dynamodb bulkEncryptModels', + ) as Item[] + for (const item of written) legacyItems.set(item.pk as string, item) + }, 180_000) + + afterAll(async () => { + await sql.unsafe(`DROP TABLE IF EXISTS ${tableName}`) + await sql.end() + }) + + // ------------------------------------------------------------------------- + // DynamoDB → Postgres + // ------------------------------------------------------------------------- + + describe('protect-dynamodb 6.0.1 items → Postgres EQL v3 columns', () => { + beforeAll(async () => { + for (const item of legacyItems.values()) { + await insert(item.pk as string, itemToRow(item)) + } + }) + + it('the EQL v3 column domains accept the copied attributes', async () => { + const [{ count }] = await sql.unsafe( + `SELECT count(*)::int AS count FROM ${tableName}`, + ) + expect(count).toBe(corpus.length) + }) + + it('stores the DynamoDB ciphertext and HMAC byte-for-byte', async () => { + for (const item of legacyItems.values()) { + const row = await selectRow(item.pk as string) + expect(ciphertextsOfRow(row), item.pk as string).toEqual( + ciphertextsOfItem(item), + ) + expect(row.email.hm).toBe(item.email__hmac) + expect(row.age.hm).toBe(item.age__hmac) + } + }) + + it('Stack 1.x decrypts the Postgres rows', async () => { + for (const model of corpus) { + const row = await selectRow(model.pk) + const decrypted = ok( + await client.decryptModel({ pk: model.pk, ...row } as never), + `decryptModel ${model.pk}`, + ) + expect(decrypted).toEqual(model) + } + }) + + it('SQL equality queries find exactly the right rows', async () => { + for (const model of corpus) { + expect(await findBy('email', model.email)).toEqual([model.pk]) + expect(await findBy('age', model.age)).toEqual( + corpus + .filter((m) => m.age === model.age) + .map((m) => m.pk) + .sort(), + ) + } + expect(await findBy('email', 'nobody@example.com')).toEqual([]) + }) + + it('round trip DynamoDB → Postgres → DynamoDB returns the original item exactly', async () => { + for (const item of legacyItems.values()) { + const back = rowToItem( + item.pk as string, + await selectRow(item.pk as string), + ) + expect(back).toEqual(item) + } + }) + }) + + // ------------------------------------------------------------------------- + // Postgres → DynamoDB + // ------------------------------------------------------------------------- + + describe('Stack 1.x Postgres rows → DynamoDB items', () => { + const model: Model = { + pk: 'user#10', + email: 'barbara@example.com', + age: 36, + notes: 'abstraction', + } + let row: Record + let item: Item + + beforeAll(async () => { + const encrypted = ok( + await client.encryptModel(model, users), + 'encryptModel (Postgres row)', + ) as Record + await insert(model.pk, encrypted) + row = await selectRow(model.pk) + item = rowToItem(model.pk, row) + }) + + it('copies the ciphertext and HMAC byte-for-byte', () => { + expect(ciphertextsOfItem(item)).toEqual(ciphertextsOfRow(row)) + expect(item.email__hmac).toBe(row.email.hm) + expect(item.age__hmac).toBe(row.age.hm) + expect(item).not.toHaveProperty('notes__hmac') + }) + + it('Stack 1.x encryptedDynamoDB decrypts the item', async () => { + expect( + ok(await stack.decryptModel(item, users), 'stack decryptModel'), + ).toEqual(model) + }) + + it('protect-dynamodb 6.0.1 decrypts the item too', async () => { + expect( + ok( + await legacy.decryptModel(item, legacyUsers), + 'protect-dynamodb decryptModel', + ), + ).toEqual(model) + }) + + it('the item carries the same __hmac a native DynamoDB write would, so existing key conditions match it', async () => { + const native = ok( + await stack.encryptModel(model, users), + 'stack encryptModel (DynamoDB)', + ) as Item + expect(item.email__hmac).toBe(native.email__hmac) + expect(item.age__hmac).toBe(native.age__hmac) + const [legacyTerm] = ok( + await legacy.createSearchTerms([ + { value: model.email, column: legacyUsers.email, table: legacyUsers }, + ]), + 'protect-dynamodb createSearchTerms', + ) + expect(item.email__hmac).toBe(legacyTerm) + }) + + it('one SQL query finds the Stack row beside the protect-dynamodb rows', async () => { + expect(await findBy('age', 36)).toEqual( + ['user#1', 'user#10', 'user#3'].sort(), + ) + }) + }) + + // ------------------------------------------------------------------------- + // Raw protect 10.2.1 payloads (EQL v2) → both stores + // ------------------------------------------------------------------------- + + describe('raw @cipherstash/protect 10.2.1 payloads → both stores', () => { + const model: Model = { + pk: 'user#20', + email: 'edsger@example.com', + age: 72, + notes: 'goto considered harmful', + } + let payloads: Record + + beforeAll(async () => { + const entries = await Promise.all( + COLUMNS.map(async (col) => [ + col, + ok( + await legacyClient.encrypt(model[col] as never, { + table: legacyUsers, + column: legacyUsers[col], + }), + `protect encrypt ${col}`, + ), + ]), + ) + payloads = Object.fromEntries(entries) + expect(payloads.email.v).toBe(2) + }) + + it('becomes a DynamoDB item Stack 1.x decrypts with the legacy email equality term', async () => { + const item = rowToItem(model.pk, payloads) + expect( + ok(await stack.decryptModel(item, users), 'stack decryptModel'), + ).toEqual(model) + // The copied email term matches protect-dynamodb's equality query. + expect(item.email__hmac).toBe( + ok( + await legacy.createSearchTerms([ + { + value: model.email, + column: legacyUsers.email, + table: legacyUsers, + }, + ]), + 'createSearchTerms', + )[0], + ) + }) + + it('becomes a Postgres EQL v3 row that SQL finds and Stack 1.x decrypts', async () => { + // The same two copies as every other test: payload → attributes → + // EQL v3 envelope. + await insert(model.pk, itemToRow(rowToItem(model.pk, payloads))) + const stored = await selectRow(model.pk) + expect(ciphertextsOfRow(stored)).toEqual(ciphertextsOfRow(payloads)) + + expect(await findBy('email', model.email)).toEqual([model.pk]) + expect( + ok( + await client.decryptModel({ pk: model.pk, ...stored } as never), + 'decryptModel', + ), + ).toEqual(model) + }) + }) +}) diff --git a/e2e/tests/protect-dynamodb-compat.e2e.test.ts b/e2e/tests/protect-dynamodb-compat.e2e.test.ts new file mode 100644 index 0000000000..7b176cc4a8 --- /dev/null +++ b/e2e/tests/protect-dynamodb-compat.e2e.test.ts @@ -0,0 +1,1043 @@ +/** + * Cross-version proof: DynamoDB items written by the REAL Protect.js stack a + * customer runs today read back, and stay queryable, under Stack 1.x. + * + * Writer: `@cipherstash/protect@10.2.1` + `@cipherstash/protect-dynamodb@6.0.1` + * (→ `@cipherstash/protect-ffi@0.18.1` → cipherstash-client 0.28), installed + * from npm as pinned devDependencies of this package. Reader: the in-tree + * `@cipherstash/stack` (→ the in-tree protect-ffi → cipherstash-client 0.42). + * + * A final, DEPRECATED block also pins `@cipherstash/stack@0.19.0` (aliased as + * `@cipherstash/stack-0.19`) to show that the old Protect → 0.19 → 1.x route + * still lands in the same place. That hop is no longer required. + * + * Every other v2 test in the repo mints its "v2" fixtures with TODAY's + * protect-ffi in v2 mode, so compatibility with ciphertext written by the old + * native client rested on the record format being unchanged — argued from + * source, pinned by nothing. This file pins it. + * + * Items are minted at test time, never committed: ciphertext and HMACs are bound + * to the workspace keyset, so a committed fixture would decrypt in exactly one + * workspace (the trap #1200 hit with pinned SteVec selectors). No DynamoDB is + * involved either — both adapters' `encryptModel` / `decryptModel` are pure + * transforms between a model and the item that would be `PutItem`'d. + * + * Needs the four `CS_*` credential variables. A `stash auth login` profile is + * not enough: Protect 10.2.1 is configured from explicit credentials. + * Without them the file fails rather than skips: it proves a migration claim + * made to customers, so a run that proved nothing must not read as a pass. + * That is why the default `vitest.config.ts` leaves it out (turbo's strict env + * mode hides the credentials from `test:e2e`) and it runs from its own config + * as the `test:protect-compat` task, a step of its own (with + * `--env-mode=loose`) in the `e2e-tests` job in `tests.yml`. + * + * `docs/migration/protect-dynamodb-to-stack.md` cites these tests by name, and + * `protect-upgrade-guide.e2e.test.ts` fails when a cited name stops existing: + * renaming or removing a test means updating the guide's claim with it. + */ +import { csColumn, csTable, type protect } from '@cipherstash/protect' +import { protectDynamoDB } from '@cipherstash/protect-dynamodb' +import { encryptedDynamoDB } from '@cipherstash/stack/dynamodb' +import { Encryption, encryptedTable, types } from '@cipherstash/stack/v3' +import { Encryption as Encryption019 } from '@cipherstash/stack-0.19' +import { encryptedDynamoDB as encryptedDynamoDB019 } from '@cipherstash/stack-0.19/dynamodb' +import { + encryptedColumn as encryptedColumn019, + encryptedTable as encryptedTable019, +} from '@cipherstash/stack-0.19/schema' +import { beforeAll, beforeEach, describe, expect, it } from 'vitest' +import { authConfigured, legacyProtect, ok } from './helpers/legacy-protect' + +// --------------------------------------------------------------------------- +// The schemas: the customer's v2 table, and its v3 mapping. +// +// Property keys and DB column names are identical on both sides, as the +// migration guidance requires: Stack finds `__source` by property key. +// --------------------------------------------------------------------------- + +const legacyUsers = csTable('users', { + email: csColumn('email').equality(), + emailLower: csColumn('emailLower').equality([{ kind: 'downcase' }]), + age: csColumn('age').dataType('number').equality(), + balance: csColumn('balance').dataType('bigint').equality(), + birthday: csColumn('birthday').dataType('date').equality(), + active: csColumn('active').dataType('boolean').equality(), + notes: csColumn('notes'), +}) + +/** The domain mapping the migration doc recommends, one v3 domain per column. */ +const users = encryptedTable('users', { + email: types.TextEq('email'), + emailLower: types.TextEq('emailLower'), + age: types.IntegerEq('age'), + balance: types.BigintEq('balance'), + active: types.Boolean('active'), + notes: types.Text('notes'), +}) + +/** + * The same columns under DIFFERENT v3 domains, to pin which choices keep the + * stored `__hmac` and which lose it. Only used for `encryptQuery`. + */ +const alternates = encryptedTable('users_alt', { + age: types.DoubleEq('age'), +}) + +/** A v3 table may not name one DB column twice, so the *Ord domain lives apart. */ +const ordered = encryptedTable('users_ord', { + age: types.IntegerOrd('age'), +}) + +/** + * Renamed table AND renamed DB column names, same property keys. The doc claims + * neither name is needed to decrypt: the column name is bound into the record + * as AEAD associated data, but it travels inside the ciphertext. + */ +const renamed = encryptedTable('people_v3', { + email: types.TextEq('email_address'), + notes: types.Text('free_text'), +}) + +/** Protect's `dataType('json')` column, and the v3 domain it backfills to. */ +const legacyDocs = csTable('docs', { + profile: csColumn('profile').dataType('json'), +}) +const docs = encryptedTable('docs', { profile: types.Json('profile') }) + +const model = { + pk: 'user#1', + email: 'ada@example.com', + emailLower: 'Ada@Example.com', + age: 36, + // protect 10.2.1 takes a bigint column's value only as a JS number (a JS + // bigint or a string is rejected), so stay inside Number.MAX_SAFE_INTEGER. + balance: 1_234_567_890_123, + active: true, + notes: 'first programmer', +} + +// A skip would read as a pass, so missing credentials fail the file. +if (!authConfigured) { + throw new Error( + 'protect-dynamodb-compat: CS_WORKSPACE_CRN, CS_CLIENT_ID, CS_CLIENT_KEY and CS_CLIENT_ACCESS_KEY must all be set (in the environment, e2e/.env or the repo-root .env)', + ) +} + +describe('protect-dynamodb 6.0.1 items under Stack 1.x', () => { + let legacyClient: Awaited> + let legacy: ReturnType + let stack: ReturnType + let client: Awaited> + /** One item exactly as protect-dynamodb 6.0.1 would `PutItem` it. */ + let item: Record + + /** The `hm` term Stack 1.x mints for a value, or undefined if none. */ + const hmOf = async ( + value: unknown, + table: typeof users | typeof alternates | typeof ordered | typeof renamed, + column: unknown, + ): Promise => { + const term = ok( + await client.encryptQuery( + value as never, + { + table, + column, + } as never, + ), + 'encryptQuery', + ) + return (term as { hm?: string } | null)?.hm + } + + beforeAll(async () => { + legacyClient = await legacyProtect([legacyUsers, legacyDocs]) + legacy = protectDynamoDB({ protectClient: legacyClient }) + + client = await Encryption({ + schemas: [users, alternates, ordered, renamed, docs], + }) + stack = encryptedDynamoDB({ encryptionClient: client }) + + item = ok( + await legacy.encryptModel(model, legacyUsers), + 'protect-dynamodb encryptModel', + ) + }, 60_000) + + it('stores only __source and __hmac — no EQL version on disk', () => { + expect(Object.keys(item).sort()).toEqual( + [ + 'pk', + 'email__source', + 'email__hmac', + 'emailLower__source', + 'emailLower__hmac', + 'age__source', + 'age__hmac', + 'balance__source', + 'balance__hmac', + 'active__source', + 'active__hmac', + 'notes__source', + ].sort(), + ) + for (const [key, value] of Object.entries(item)) { + if (key === 'pk') continue + expect(typeof value, key).toBe('string') + } + }) + + // ------------------------------------------------------------------------- + // Q1 — does v2 ciphertext decrypt under v3 tooling? + // ------------------------------------------------------------------------- + + describe('Q1: decrypt', () => { + it('reads the item with storedEqlVersion: 2', async () => { + const decrypted = ok( + await stack.decryptModel(item, users, { storedEqlVersion: 2 }), + 'stack decryptModel (v2)', + ) + expect(decrypted).toMatchObject({ + pk: 'user#1', + email: model.email, + emailLower: model.emailLower, + age: model.age, + active: true, + notes: model.notes, + }) + expect(decrypted.balance).toBe(BigInt(model.balance)) + }) + + it('reads the same item with no storedEqlVersion at all (scalars carry no version)', async () => { + const asV2 = ok( + await stack.decryptModel(item, users, { storedEqlVersion: 2 }), + 'v2 read', + ) + const asV3 = ok(await stack.decryptModel(item, users), 'v3 read') + expect(asV3).toEqual(asV2) + // No leftover `*__source` key: nothing was silently passed through. + expect(Object.keys(asV3).filter((k) => k.endsWith('__source'))).toEqual( + [], + ) + }) + + it('agrees with what protect-dynamodb itself decrypts', async () => { + const fromLegacy = ok( + await legacy.decryptModel(item, legacyUsers), + 'protect-dynamodb decryptModel', + ) + const fromStack = ok( + await stack.decryptModel(item, users, { storedEqlVersion: 2 }), + 'stack decryptModel', + ) + for (const key of [ + 'email', + 'emailLower', + 'age', + 'active', + 'notes', + ] as const) { + expect(fromStack[key], key).toEqual(fromLegacy[key]) + } + }) + + it('changes the JS type of a bigint column, but not its value', async () => { + const fromLegacy = ok( + await legacy.decryptModel(item, legacyUsers), + 'protect-dynamodb decryptModel', + ) + const fromStack = ok( + await stack.decryptModel(item, users, { storedEqlVersion: 2 }), + 'stack decryptModel', + ) + + // Stack 1.x: a native bigint. Protect: a number. Same value. + expect(typeof fromStack.balance).toBe('bigint') + expect(typeof fromLegacy.balance).not.toBe('bigint') + expect(BigInt(fromLegacy.balance as number | string)).toBe( + fromStack.balance, + ) + }) + + it('passes raw ciphertext through, with no failure, when a property key was renamed', async () => { + const drifted = encryptedTable('users', { + emailAddress: types.TextEq('email'), + }) + const driftClient = await Encryption({ schemas: [drifted] }) + const decrypted = ok( + await encryptedDynamoDB({ + encryptionClient: driftClient, + }).decryptModel( + { pk: item.pk, email__source: item.email__source }, + drifted, + { storedEqlVersion: 2 }, + ), + 'drifted decryptModel', + ) + expect(decrypted).not.toHaveProperty('emailAddress') + expect(decrypted.email__source).toBe(item.email__source) + }) + + it('reads on the bulk path too', async () => { + const [decrypted] = ok( + await stack.bulkDecryptModels([item], users, { storedEqlVersion: 2 }), + 'stack bulkDecryptModels', + ) + expect(decrypted).toMatchObject({ email: model.email, age: model.age }) + }) + + it('fails, never returns wrong plaintext, when the ciphertext is tampered with', async () => { + const source = item.email__source as string + // Flip one character well inside the Base85 body. + const at = Math.floor(source.length / 2) + const flipped = source[at] === 'A' ? 'B' : 'A' + const tampered = { + ...item, + email__source: source.slice(0, at) + flipped + source.slice(at + 1), + } + // Control: the untampered item decrypts, so a failure below comes + // from the tampering and not from the service. + ok( + await stack.decryptModel(item, users, { storedEqlVersion: 2 }), + 'control decryptModel', + ) + const result = await stack.decryptModel(tampered, users, { + storedEqlVersion: 2, + }) + expect(result.failure).toBeDefined() + }) + }) + + // ------------------------------------------------------------------------- + // Q2 — are the HMACs the same? + // ------------------------------------------------------------------------- + + describe('Q2: __hmac', () => { + it.each([ + ['email', 'TextEq', model.email, users.email], + ['age', 'IntegerEq', model.age, users.age], + ['balance', 'BigintEq', BigInt(model.balance), users.balance], + ] as const)( + '%s: Stack %s encryptQuery reproduces the stored __hmac', + async (attr, _domain, value, column) => { + const stored = item[`${attr}__hmac`] + expect(stored).toMatch(/^[0-9a-f]{64}$/) + expect(await hmOf(value, users, column)).toBe(stored) + }, + ) + + it('matches protect-dynamodb createSearchTerms for the same value', async () => { + const [legacyTerm] = ok( + await legacy.createSearchTerms([ + { + value: model.email, + column: legacyUsers.email, + table: legacyUsers, + }, + ]), + 'createSearchTerms', + ) + expect(legacyTerm).toBe(item.email__hmac) + expect(await hmOf(model.email, users, users.email)).toBe(legacyTerm) + }) + + it('IntegerEq and DoubleEq queries match the legacy whole-number HMAC', async () => { + expect(await hmOf(model.age, users, users.age)).toBe(item.age__hmac) + expect(await hmOf(model.age, alternates, alternates.age)).toBe( + item.age__hmac, + ) + }) + + it('DoubleEq preserves fractional number reads, writes and equality terms', async () => { + for (const age of [36.5, -0.125]) { + const old: Record = ok( + await legacy.encryptModel({ pk: 'fraction', age }, legacyUsers), + 'legacy fractional write', + ) + // Without this, the comparisons below pass on undefined === undefined. + expect(old.age__hmac).toEqual(expect.any(String)) + expect( + ok(await stack.decryptModel(old, alternates), 'fractional read').age, + ).toBe(age) + expect(await hmOf(age, alternates, alternates.age)).toBe(old.age__hmac) + const fresh = ok( + await stack.encryptModel({ pk: 'fraction', age }, alternates), + 'Stack fractional write', + ) + expect(fresh.age__hmac).toBe(old.age__hmac) + expect( + ok( + await legacy.decryptModel(fresh, legacyUsers), + 'fractional rollback', + ).age, + ).toBe(age) + } + }) + + it('a numeric *Ord domain emits no HMAC at all', async () => { + expect(await hmOf(model.age, ordered, ordered.age)).toBe(undefined) + }) + + it('protect 10.2.1 rejects the tested date inputs', async () => { + for (const value of [ + '1990-04-05', + '1990-04-05T00:00:00Z', + new Date('1990-04-05'), + Date.UTC(1990, 3, 5), + ]) { + const result = await legacyClient.encrypt(value as never, { + table: legacyUsers, + column: legacyUsers.birthday, + }) + expect( + (result as { failure?: { message?: string } }).failure?.message, + String(value), + ).toMatch(/Unsupported conversion from "(String|Number)" to Date/) + } + }) + + it('a v3 Boolean writes no __hmac, though protect-dynamodb wrote one', async () => { + expect(item.active__hmac).toMatch(/^[0-9a-f]{64}$/) + const written = ok( + await stack.encryptModel({ pk: 'user#4', active: true }, users), + 'stack encryptModel (boolean)', + ) + expect(written.active__source).toBeDefined() + expect(written).not.toHaveProperty('active__hmac') + }) + + it('a v2 downcase filter is reproduced only by lowercasing first', async () => { + const stored = item.emailLower__hmac + expect(await hmOf(model.emailLower, users, users.emailLower)).not.toBe( + stored, + ) + expect( + await hmOf(model.emailLower.toLowerCase(), users, users.emailLower), + ).toBe(stored) + }) + }) + + describe('downcase on the write path', () => { + it('a Stack write keeps mixed-case plaintext only by giving up the legacy HMAC', async () => { + const stored = item.emailLower__hmac + const mixed = ok( + await stack.encryptModel( + { pk: 'user#5', emailLower: model.emailLower }, + users, + ), + 'stack encryptModel (mixed case)', + ) + expect(mixed.emailLower__hmac).not.toBe(stored) + + const lowered = ok( + await stack.encryptModel( + { pk: 'user#5', emailLower: model.emailLower.toLowerCase() }, + users, + ), + 'stack encryptModel (lowercased)', + ) + expect(lowered.emailLower__hmac).toBe(stored) + // ...and the original case is gone from the stored plaintext. + const read = ok( + await stack.decryptModel(lowered, users), + 'stack decryptModel (lowercased)', + ) + expect(read.emailLower).toBe(model.emailLower.toLowerCase()) + }) + }) + + // ------------------------------------------------------------------------- + // Q3 — is table / column bound into the encryption? + // ------------------------------------------------------------------------- + + describe('Q3: binding', () => { + it('decrypts under a renamed table and renamed DB column names', async () => { + const subset = { + pk: item.pk, + email__source: item.email__source, + email__hmac: item.email__hmac, + notes__source: item.notes__source, + } + const decrypted = ok( + await stack.decryptModel(subset, renamed, { storedEqlVersion: 2 }), + 'renamed decryptModel', + ) + expect(decrypted).toMatchObject({ + email: model.email, + notes: model.notes, + }) + }) + + it('the HMAC is bound to neither table nor column', async () => { + expect(await hmOf(model.email, renamed, renamed.email)).toBe( + item.email__hmac, + ) + }) + }) + + // ------------------------------------------------------------------------- + // Rollback — Stack 1.x writes, the old reader reads. + // ------------------------------------------------------------------------- + + describe('rollback', () => { + it('an item written by Stack 1.x reads back through protect-dynamodb 6.0.1', async () => { + const written = ok( + await stack.encryptModel( + { + pk: 'user#2', + email: 'grace@example.com', + age: 85, + notes: 'compiler', + }, + users, + ), + 'stack encryptModel', + ) + const read = ok( + await legacy.decryptModel(written, legacyUsers), + 'protect-dynamodb decryptModel', + ) + expect(read).toMatchObject({ + pk: 'user#2', + email: 'grace@example.com', + age: 85, + notes: 'compiler', + }) + }) + + it('Stack 1.x writes the same __hmac protect-dynamodb wrote', async () => { + const written = ok( + await stack.encryptModel({ pk: 'user#3', email: model.email }, users), + 'stack encryptModel', + ) + expect(written.email__hmac).toBe(item.email__hmac) + }) + }) + + // ------------------------------------------------------------------------- + // Acceptance: the migration a customer runs, end to end. The "table" is a + // Map: both adapters' items are flat string attributes, so PutItem / + // UpdateItem persistence is a copy, and an equality query on an encrypted + // attribute is a match on its `__hmac`. + // ------------------------------------------------------------------------- + + describe('acceptance: legacy write → mixed update → backfill → query → rollback', () => { + // Fresh per test: a row left by one test would add a match to another's + // exact-count query, so results would depend on test order. + const table = new Map>() + beforeEach(() => table.clear()) + const queryBy = (attr: string, hm: string | undefined) => + [...table.values()].filter((row) => row[`${attr}__hmac`] === hm) + + it('runs the migration and keeps every generation readable and queryable', async () => { + // 1. Legacy write, as protect-dynamodb 6.0.1 left it. + table.set('user#1', { ...item }) + + // 2. Mixed-generation item: Stack 1.x updates two attributes in place + // (UpdateItem SET), the rest stay as protect-dynamodb wrote them. + const update = ok( + await stack.encryptModel( + { pk: 'user#1', email: 'ada.lovelace@example.com', age: 37 }, + users, + ), + 'stack encryptModel (partial update)', + ) + table.set('user#1', { ...table.get('user#1'), ...update }) + + // One read call, no per-attribute version routing: scalars carry no + // version, so the same call reads both generations. + const mixed = ok( + await stack.decryptModel( + table.get('user#1') as Record, + users, + ), + 'stack decryptModel (mixed)', + ) + expect(mixed).toMatchObject({ + email: 'ada.lovelace@example.com', + age: 37, + emailLower: model.emailLower, + active: true, + notes: model.notes, + balance: BigInt(model.balance), + }) + + // Queries hit both generations' HMACs. + expect( + queryBy( + 'email', + await hmOf('ada.lovelace@example.com', users, users.email), + ), + ).toHaveLength(1) + expect( + queryBy( + 'emailLower', + await hmOf(model.emailLower.toLowerCase(), users, users.emailLower), + ), + ).toHaveLength(1) + + // 3. Backfill: read, normalise what v3 no longer filters, re-encrypt + // with Stack 1.x, persist (PutItem replaces the whole item). + const before = table.get('user#1') as Record + const rewritten = ok( + await stack.encryptModel( + { ...mixed, emailLower: String(mixed.emailLower).toLowerCase() }, + users, + ), + 'stack encryptModel (backfill)', + ) as Record + table.set('user#1', rewritten) + + // 4. Verify the persisted item: values back, and every query a caller + // could run before the backfill still finds it. + const after = ok( + await stack.decryptModel(rewritten, users), + 'stack decryptModel (backfilled)', + ) + expect(after).toMatchObject({ + email: 'ada.lovelace@example.com', + age: 37, + emailLower: model.emailLower.toLowerCase(), + active: true, + notes: model.notes, + balance: BigInt(model.balance), + }) + for (const attr of ['email', 'emailLower', 'age', 'balance']) { + expect(rewritten[`${attr}__hmac`], attr).toBe(before[`${attr}__hmac`]) + } + // The one query the backfill cannot keep: a v3 Boolean has no HMAC. + expect(rewritten).not.toHaveProperty('active__hmac') + expect(queryBy('active', before.active__hmac as string)).toHaveLength(0) + + // 5. Rollback: the old reader still reads the backfilled item. + const rolledBack = ok( + await legacy.decryptModel(rewritten, legacyUsers), + 'protect-dynamodb decryptModel (backfilled)', + ) + expect(rolledBack).toMatchObject({ + email: 'ada.lovelace@example.com', + age: 37, + emailLower: model.emailLower.toLowerCase(), + active: true, + notes: model.notes, + }) + expect(Number(rolledBack.balance)).toBe(model.balance) + }) + + // Only the `encryptModel` check is Stack behaviour. The steps after it + // show the DynamoDB consequence on the in-memory table: SET alone keeps + // the stale legacy __hmac, and SET + REMOVE drops it. + it('a Stack Boolean update writes no __hmac, so a partial update must REMOVE the legacy one', async () => { + const legacyTrue = item.active__hmac as string + expect(legacyTrue).toMatch(/^[0-9a-f]{64}$/) + + const update = ok( + await stack.encryptModel({ pk: 'user#6', active: false }, users), + 'stack encryptModel (boolean update)', + ) as Record + expect(update).not.toHaveProperty('active__hmac') + + // SET only: the new ciphertext says false, the old HMAC still says + // true, so an equality query for `true` finds an item that is false. + table.set('user#6', { ...item, pk: 'user#6', ...update }) + const setOnly = ok( + await stack.decryptModel( + table.get('user#6') as Record, + users, + ), + 'stack decryptModel (SET only)', + ) + expect(setOnly.active).toBe(false) + expect(queryBy('active', legacyTrue).map((row) => row.pk)).toContain( + 'user#6', + ) + + // SET + REMOVE active__hmac: the stale match is gone. + const { active__hmac: _stale, ...removed } = table.get( + 'user#6', + ) as Record + table.set('user#6', removed) + expect(queryBy('active', legacyTrue).map((row) => row.pk)).not.toContain( + 'user#6', + ) + }) + }) + + // ------------------------------------------------------------------------- + // No re-encryption: the upgrade is a code change only. A corpus written by + // protect-dynamodb 6.0.1 is frozen, the app moves to Stack 1.x, and every + // read and equality query keeps working against the stored bytes. The + // backfill in the acceptance test above is optional; this block runs the + // same app WITHOUT it. The proof that no rewrite is needed is that the reads + // and queries pass against bytes nothing has rewritten; the last test only + // confirms that Stack's reads left those bytes as they were. + // ------------------------------------------------------------------------- + + describe('no re-encryption: a code-only upgrade over untouched legacy items', () => { + type Row = { + pk: string + email: string + emailLower: string + age: number + balance: number + active: boolean + notes: string + } + // Shared values (age 36, a lowercase-equal emailLower) so a query has to + // return exactly the right SET of rows, not just a single hit. The + // balances cover zero, a negative and Number.MAX_SAFE_INTEGER, the largest + // value protect 10.2.1 could store exactly (see `model.balance`). + const corpus: Row[] = [ + { + pk: 'user#10', + email: 'grace@example.com', + emailLower: 'Grace@Example.com', + age: 36, + balance: 0, + active: true, + notes: 'compilers', + }, + { + pk: 'user#11', + email: 'alan@example.com', + emailLower: 'ALAN@example.com', + age: 41, + balance: Number.MAX_SAFE_INTEGER, + active: false, + notes: 'computability', + }, + { + pk: 'user#12', + email: 'edsger@example.com', + emailLower: 'grace@example.com', + age: 36, + balance: -42, + active: true, + notes: 'structured programming', + }, + ] + /** What Stack 1.x returns for a row: identical, bigint as a JS bigint. */ + const expected = (row: Row) => ({ ...row, balance: BigInt(row.balance) }) + + /** The table as protect-dynamodb left it. Items are frozen. */ + const table = new Map>>() + let snapshot: string + const stored = () => [...table.values()] + const queryBy = ( + rows: Readonly>[], + attr: string, + hm: string | undefined, + ) => + rows + .filter((row) => hm !== undefined && row[`${attr}__hmac`] === hm) + .map((row) => row.pk as string) + .sort() + + beforeAll(async () => { + // Written before the upgrade, through both protect-dynamodb write paths. + const [first, ...rest] = corpus + const written = [ + ok( + await legacy.encryptModel(first, legacyUsers), + 'protect-dynamodb encryptModel', + ), + ...ok( + await legacy.bulkEncryptModels(rest, legacyUsers), + 'protect-dynamodb bulkEncryptModels', + ), + ] as Record[] + for (const row of written) table.set(row.pk as string, Object.freeze(row)) + // Frozen: every attribute is a top-level string, so a shallow freeze + // covers the whole item. An in-place write by Stack throws if the + // writing code is strict and is silently dropped if not, so the + // snapshot is what catches either case in the last test. + snapshot = JSON.stringify([...table.entries()]) + }, 60_000) + + // Nothing below touches `legacy` or `legacyClient`: from here on the app + // runs on Stack 1.x alone, with the default read options. + + it('every legacy item decrypts, one at a time, with no read option', async () => { + for (const row of corpus) { + const decrypted = ok( + await stack.decryptModel( + table.get(row.pk) as Record, + users, + ), + `stack decryptModel ${row.pk}`, + ) + expect(decrypted, row.pk).toEqual(expected(row)) + } + }) + + it('every legacy item decrypts in one bulk call', async () => { + const decrypted = ok( + await stack.bulkDecryptModels( + stored() as Record[], + users, + ), + 'stack bulkDecryptModels', + ) + expect(decrypted).toEqual(corpus.map(expected)) + }) + + it('every equality query finds exactly the legacy rows it should', async () => { + const queries = [ + ['email', users.email, (r: Row) => r.email], + // v3 has no downcase filter: the app lowercases the query value. + [ + 'emailLower', + users.emailLower, + (r: Row) => r.emailLower.toLowerCase(), + ], + ['age', users.age, (r: Row) => r.age], + ['balance', users.balance, (r: Row) => BigInt(r.balance)], + ] as const + for (const [attr, column, project] of queries) { + for (const row of corpus) { + const value = project(row) + const want = corpus + .filter((r) => project(r) === value) + .map((r) => r.pk) + .sort() + expect( + queryBy(stored(), attr, await hmOf(value, users, column)), + `${attr} = ${row.pk}'s value`, + ).toEqual(want) + } + } + }) + + it('new Stack writes sit beside legacy items: one query and one bulk read cover both', async () => { + const fresh = { + pk: 'user#13', + email: 'barbara@example.com', + emailLower: 'barbara@example.com', + age: 36, + balance: 7n, + active: false, + notes: 'abstract data types', + } + const written = ok( + await stack.encryptModel(fresh, users), + 'stack encryptModel (new item)', + ) as Record + const mixed = [...stored(), written] + + expect(queryBy(mixed, 'age', await hmOf(36, users, users.age))).toEqual([ + 'user#10', + 'user#12', + 'user#13', + ]) + + const decrypted = ok( + await stack.bulkDecryptModels(mixed, users), + 'stack bulkDecryptModels (mixed generations)', + ) + expect(decrypted).toEqual([...corpus.map(expected), fresh]) + }) + + // Not a re-encryption requirement: re-encrypting would not bring it back, + // because a v3 Boolean writes no __hmac either (see Q2). An app that + // filters on a boolean needs a plaintext attribute or a GSI for it. + it('the one query a Stack 1.x app cannot mint is a boolean equality, with or without a rewrite', async () => { + for (const row of stored()) { + expect(row.active__hmac, row.pk as string).toMatch(/^[0-9a-f]{64}$/) + } + // Control: the same client mints a term for a queryable column, so the + // refusal below is about the Boolean domain, not the service. + expect(await hmOf(model.email, users, users.email)).toBe(item.email__hmac) + // A Boolean is storage-only: it carries no index, so the query is + // refused before anything reaches ZeroKMS. + const result = await client.encryptQuery( + true as never, + { table: users, column: users.active } as never, + ) + expect( + (result as { failure?: { message?: string } }).failure?.message, + ).toMatch(/no indexes configured/) + }) + + // Runs last. Nothing in this block writes to `table`, so this cannot show + // a write path leaves legacy items alone. It shows the reads and queries + // above did not change the items they ran against. + it("Stack's reads and queries left every stored item byte-identical", () => { + expect(JSON.stringify([...table.entries()])).toBe(snapshot) + expect(table.size).toBe(corpus.length) + }) + }) + + // ------------------------------------------------------------------------- + // The legacy JSON gap. + // ------------------------------------------------------------------------- + + describe('legacy dataType("json")', () => { + const doc = { roles: ['admin', 'eng'], tz: 'Australia/Sydney' } + let docItem: Record + /** The v2 scalar envelope Protect's `profile__source` came from. */ + let legacyEnvelope: { + v: 2 + k: 'ct' + i: { t: string; c: string } + c: string + } + + beforeAll(async () => { + docItem = ok( + await legacy.encryptModel({ pk: 'doc#1', profile: doc }, legacyDocs), + 'protect-dynamodb encryptModel (json)', + ) + legacyEnvelope = { + v: 2, + k: 'ct', + i: { t: 'docs', c: 'profile' }, + c: docItem.profile__source as string, + } + }) + + it('was stored as a scalar ciphertext string, not a SteVec document', () => { + expect(typeof docItem.profile__source).toBe('string') + }) + + it('fails to read through encryptedDynamoDB with types.Json (known gap)', async () => { + // Control: the same ciphertext decrypts through client.decrypt(), so + // the failure below comes from the reader and not from the service. + ok(await client.decrypt(legacyEnvelope), 'control client.decrypt') + for (const options of [undefined, { storedEqlVersion: 2 as const }]) { + const result = await stack.decryptModel(docItem, docs, options) + expect(result.failure).toBeDefined() + } + }) + + it('reads through client.decrypt() on a rebuilt v2 scalar envelope', async () => { + const decrypted = ok( + await client.decrypt(legacyEnvelope), + 'client.decrypt (legacy json)', + ) + expect(decrypted).toEqual(doc) + }) + + it('the original Protect JSON schema cannot read a Stack Json rewrite', async () => { + const rewritten = ok( + await stack.encryptModel({ pk: 'doc#1', profile: doc }, docs), + 'Stack JSON write', + ) + expect( + ok(await stack.decryptModel(rewritten, docs), 'control JSON read') + .profile, + ).toEqual(doc) + const result = await legacy.decryptModel(rewritten, legacyDocs) + expect(result.failure).toBeDefined() + }) + + it('backfills to a types.Json item that Stack 1.x reads', async () => { + const decrypted = ok( + await client.decrypt(legacyEnvelope), + 'client.decrypt (legacy json)', + ) + const rewritten = ok( + await stack.encryptModel( + { pk: 'doc#1', profile: decrypted as typeof doc }, + docs, + ), + 'stack encryptModel (json backfill)', + ) + const read = ok( + await stack.decryptModel(rewritten, docs), + 'stack decryptModel (json backfill)', + ) + expect(read.profile).toEqual(doc) + }) + }) + + // ------------------------------------------------------------------------- + // DEPRECATED — NO LONGER REQUIRED: the Stack 0.19 bridge. + // + // Earlier migration guidance routed Protect apps through + // `@cipherstash/stack@0.19.0` (the last release that writes EQL v2) before + // Stack 1.x. Everything above proves the direct path — Protect 10.2.1 → + // Stack 1.x — on its own, so that intermediate step is unnecessary. Do not + // recommend it. + // + // This block exists only so the answer for anyone who already took the hop + // is pinned rather than argued: a 0.19 deployment reads Protect's items, + // writes items Stack 1.x reads, and writes the SAME `__hmac` values Protect + // did, so the hop adds nothing and loses nothing. Delete the block, and the + // `@cipherstash/stack-0.19` devDependency, when no customer is on 0.19. + // ------------------------------------------------------------------------- + + describe('DEPRECATED (no longer required): Protect 10.2.1 → Stack 0.19 → Stack 1.x', () => { + /** The customer's v2 table, as a Stack 0.19 app declares it. */ + const bridgeUsers = encryptedTable019('users', { + email: encryptedColumn019('email').equality(), + emailLower: encryptedColumn019('emailLower').equality([ + { kind: 'downcase' }, + ]), + age: encryptedColumn019('age').dataType('number').equality(), + balance: encryptedColumn019('balance').dataType('bigint').equality(), + active: encryptedColumn019('active').dataType('boolean').equality(), + notes: encryptedColumn019('notes'), + }) + /** Protect's item as Stack 0.19 reads it. */ + let read: Record + /** That read, re-written by Stack 0.19. */ + let bridged: Record + + beforeAll(async () => { + const bridgeClient = await Encryption019({ schemas: [bridgeUsers] }) + const bridge = encryptedDynamoDB019({ encryptionClient: bridgeClient }) + read = ok( + await bridge.decryptModel(item, bridgeUsers), + 'stack 0.19 decryptModel (protect item)', + ) + bridged = ok( + await bridge.encryptModel(read, bridgeUsers), + 'stack 0.19 encryptModel', + ) + }, 60_000) + + it('Stack 0.19 reads the Protect 10.2.1 item', () => { + expect(read).toMatchObject({ + pk: 'user#1', + email: model.email, + emailLower: model.emailLower, + age: model.age, + active: true, + notes: model.notes, + }) + expect(BigInt(read.balance as number | bigint)).toBe( + BigInt(model.balance), + ) + }) + + it('Stack 0.19 re-writes the same attributes and the same __hmac values Protect wrote', () => { + expect(Object.keys(bridged).sort()).toEqual(Object.keys(item).sort()) + for (const key of Object.keys(item).filter((k) => k.endsWith('__hmac'))) { + expect(bridged[key], key).toBe(item[key]) + } + }) + + it('Stack 1.x reads the 0.19-written item exactly as it reads the Protect item directly', async () => { + const viaBridge = ok( + await stack.decryptModel(bridged, users, { storedEqlVersion: 2 }), + 'stack decryptModel (0.19 item)', + ) + const direct = ok( + await stack.decryptModel(item, users, { storedEqlVersion: 2 }), + 'stack decryptModel (protect item)', + ) + expect(viaBridge).toEqual(direct) + }) + + it('Stack 1.x queries find the 0.19-written item', async () => { + expect(await hmOf(model.email, users, users.email)).toBe( + bridged.email__hmac, + ) + expect(await hmOf(model.age, users, users.age)).toBe(bridged.age__hmac) + expect(await hmOf(BigInt(model.balance), users, users.balance)).toBe( + bridged.balance__hmac, + ) + }) + }) +}) diff --git a/e2e/tests/protect-guide-example.e2e.test.ts b/e2e/tests/protect-guide-example.e2e.test.ts new file mode 100644 index 0000000000..9e1fd7b78f --- /dev/null +++ b/e2e/tests/protect-guide-example.e2e.test.ts @@ -0,0 +1,14 @@ +import { expect, it } from 'vitest' +import { migrateDynamoExample } from '../migration-guide/dynamodb.ts' +import { authConfigured } from './helpers/legacy-protect' + +if (!authConfigured) + throw new Error('protect-guide-example requires all four CS_* credentials') + +it('runs the npm DynamoDB example through legacy reads, new writes and boolean updates', async () => { + expect(await migrateDynamoExample()).toEqual({ + legacyBytesPreserved: true, + newWritesVerified: true, + booleanUpdateVerified: true, + }) +}, 120_000) diff --git a/e2e/tests/protect-postgres-upgrade.e2e.test.ts b/e2e/tests/protect-postgres-upgrade.e2e.test.ts new file mode 100644 index 0000000000..cfeb9d4e58 --- /dev/null +++ b/e2e/tests/protect-postgres-upgrade.e2e.test.ts @@ -0,0 +1,180 @@ +import { installEqlV3 } from '@cipherstash/test-kit/install' +import postgres from 'postgres' +import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest' +import { createExample } from '../migration-guide/postgres.ts' +import { authConfigured } from './helpers/legacy-protect' + +if (!authConfigured || !process.env.DATABASE_URL) { + throw new Error( + 'protect-postgres-upgrade requires all four CS_* credentials and DATABASE_URL', + ) +} +const databaseUrl = process.env.DATABASE_URL + +describe('Protect Postgres v2 to Stack v3', () => { + const sql = postgres(databaseUrl, { prepare: false, onnotice: () => {} }) + const table = `upgrade_${Date.now()}` + let app: Awaited> + + beforeAll(async () => { + // Only a disposable test database: customers already have v2 installed. + const installed = + await sql`SELECT to_regtype('public.eql_v2_encrypted') AS type` + if (!installed[0].type) { + const response = await fetch( + 'https://github.com/cipherstash/encrypt-query-language/releases/download/eql-2.2.1/cipherstash-encrypt.sql', + ) + if (!response.ok) + throw new Error(`EQL v2 download failed: ${response.status}`) + await sql.unsafe(await response.text()) + } + await installEqlV3(databaseUrl, 'postgres') + app = await createExample(sql, table) + }, 180_000) + + afterAll(async () => { + await sql`DROP TABLE IF EXISTS ${sql(table)}` + await sql.end() + }) + + beforeEach(async () => { + await sql`DROP TABLE IF EXISTS ${sql(table)}` + await app.seed() + }, 120_000) + + it('migrates actual v2 columns, preserves ciphertext and queries, and rolls back before writes resume', async () => { + expect(await app.read('v2')).toEqual(app.corpus) + expect(await app.find('v2', 'age', 36)).toEqual(['ada', 'alan']) + expect(await app.find('v2', 'email', 'ada@example.com')).toEqual(['ada']) + expect(await app.find('v2', 'email', 'nobody@example.com')).toEqual([]) + const before = + await sql`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes FROM ${sql(table)} ORDER BY pk` + expect(before[0].email.v).toBe(2) + await app.migrate() + expect(await app.read('v3')).toEqual(app.corpus) + expect(await app.find('v3', 'age', 36)).toEqual(['ada', 'alan']) + expect(await app.find('v3', 'email', 'ada@example.com')).toEqual(['ada']) + expect(await app.find('v3', 'email', 'nobody@example.com')).toEqual([]) + const after = + await sql`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes, + email_v3::jsonb AS email_v3, age_v3::jsonb AS age_v3, notes_v3::jsonb AS notes_v3 FROM ${sql(table)} ORDER BY pk` + for (let i = 0; i < before.length; i++) { + for (const column of ['email', 'age', 'notes']) { + expect(after[i][column]).toEqual(before[i][column]) + expect(after[i][`${column}_v3`].c).toBe(before[i][column].c) + expect(after[i][`${column}_v3`].hm ?? null).toBe( + before[i][column].hm ?? null, + ) + } + } + await app.rollback() + expect(await app.read('v2')).toEqual(app.corpus) + expect( + await sql`SELECT pk, email::jsonb AS email, age::jsonb AS age, notes::jsonb AS notes FROM ${sql(table)} ORDER BY pk`, + ).toEqual(before) + }, 120_000) + + it('reads and queries fresh Stack writes beside legacy rows and refuses stale rollback', async () => { + await app.migrate() + const fresh = await app.write() + expect(await app.read('v3')).toEqual([...app.corpus, fresh]) + expect(await app.find('v3', 'age', 36)).toEqual(['ada', 'alan', 'new']) + expect(await app.find('v3', 'email', fresh.email)).toEqual(['new']) + await expect(app.rollback()).rejects.toThrow('Writes have resumed') + expect(await app.read('v3')).toEqual([...app.corpus, fresh]) + }, 120_000) + + it('creates usable equality indexes on the converted columns', async () => { + await app.migrate() + // A selective query needs a representative table, not a forced planner flag. + await sql`INSERT INTO ${sql(table)} + SELECT 'filler-' || n, email, age, notes, email_v3, age_v3, notes_v3 + FROM ${sql(table)}, generate_series(1, 5000) n WHERE pk = 'grace'` + await sql`ANALYZE ${sql(table)}` + const [ada] = + await sql`SELECT email_v3::jsonb AS email_v3, age_v3::jsonb AS age_v3 FROM ${sql(table)} WHERE pk = 'ada'` + const emailPlan = + await sql`EXPLAIN (FORMAT JSON) SELECT pk FROM ${sql(table)} + WHERE eql_v3.eq(email_v3, ${sql.json(ada.email_v3)}::jsonb::eql_v3.query_text_eq)` + const agePlan = await sql`EXPLAIN (FORMAT JSON) SELECT pk FROM ${sql(table)} + WHERE eql_v3.eq(age_v3, ${sql.json(ada.age_v3)}::jsonb::eql_v3.query_integer_eq)` + expect(JSON.stringify(emailPlan)).toContain(`${table}_email_v3_idx`) + expect(JSON.stringify(agePlan)).toContain(`${table}_age_v3_idx`) + expect(await app.find('v3', 'email', 'ada@example.com')).toEqual(['ada']) + expect(await app.find('v3', 'age', 36)).toEqual(['ada', 'alan']) + }, 120_000) + + it('refuses unsupported payload capabilities before changing source data or columns', async () => { + await sql`UPDATE ${sql(table)} SET notes = notes::jsonb || '{"ob":"unsupported"}'::jsonb WHERE pk = 'ada'` + const before = await sql`SELECT * FROM ${sql(table)} ORDER BY pk` + await expect(app.migrate()).rejects.toThrow('Unsupported legacy payload') + expect(await sql`SELECT * FROM ${sql(table)} ORDER BY pk`).toEqual(before) + expect( + await sql`SELECT attname FROM pg_attribute WHERE attrelid = ${table}::regclass AND attname = 'email_v3'`, + ).toHaveLength(0) + }, 120_000) + + it('refuses customer views before changing source data or columns', async () => { + await sql`CREATE VIEW ${sql(`${table}_view`)} AS SELECT email FROM ${sql(table)}` + try { + const before = await sql`SELECT * FROM ${sql(table)} ORDER BY pk` + await expect(app.migrate()).rejects.toThrow( + 'Unsupported table dependencies', + ) + expect(await sql`SELECT * FROM ${sql(table)} ORDER BY pk`).toEqual(before) + expect( + await sql`SELECT attname FROM pg_attribute WHERE attrelid = ${table}::regclass AND attname = 'email_v3'`, + ).toHaveLength(0) + } finally { + await sql`DROP VIEW ${sql(`${table}_view`)}` + } + }, 120_000) + + // Stack writes leave the legacy columns null, so a NOT NULL there would fail + // every write after cutover. PostgreSQL 18 lists NOT NULL in pg_constraint + // and 17 does not; the preflight must give the same answer on both. + it('refuses a NOT NULL legacy column before changing source data or columns', async () => { + await sql`ALTER TABLE ${sql(table)} ALTER COLUMN email SET NOT NULL` + const before = await sql`SELECT * FROM ${sql(table)} ORDER BY pk` + await expect(app.migrate()).rejects.toThrow( + 'Unsupported table dependencies', + ) + expect(await sql`SELECT * FROM ${sql(table)} ORDER BY pk`).toEqual(before) + expect( + await sql`SELECT attname FROM pg_attribute WHERE attrelid = ${table}::regclass AND attname = 'email_v3'`, + ).toHaveLength(0) + }, 120_000) + + it.each(['constraint', 'not-null', 'index'])( + 'refuses rollback that would discard a customer %s', + async (dependency) => { + await app.migrate() + if (dependency === 'constraint') { + await sql`ALTER TABLE ${sql(table)} ADD CONSTRAINT customer_check CHECK (email_v3 IS NOT NULL)` + } else if (dependency === 'not-null') { + await sql`ALTER TABLE ${sql(table)} ALTER COLUMN email_v3 SET NOT NULL` + } else { + await sql`CREATE INDEX ${sql(`${table}_custom`)} ON ${sql(table)} (eql_v3.eq_term(email_v3))` + } + const before = await sql`SELECT * FROM ${sql(table)} ORDER BY pk` + await expect(app.rollback()).rejects.toThrow( + 'Unsupported table dependencies', + ) + expect(await sql`SELECT * FROM ${sql(table)} ORDER BY pk`).toEqual(before) + if (dependency === 'constraint') { + expect( + await sql`SELECT 1 FROM pg_constraint WHERE conrelid = ${table}::regclass AND conname = 'customer_check'`, + ).toHaveLength(1) + } else if (dependency === 'not-null') { + expect( + await sql`SELECT 1 FROM pg_attribute WHERE attrelid = ${table}::regclass AND attname = 'email_v3' AND attnotnull`, + ).toHaveLength(1) + } else { + expect( + await sql`SELECT 1 FROM pg_indexes WHERE tablename = ${table} AND indexname = ${`${table}_custom`}`, + ).toHaveLength(1) + } + }, + 120_000, + ) +}) diff --git a/e2e/tests/protect-upgrade-guide.e2e.test.ts b/e2e/tests/protect-upgrade-guide.e2e.test.ts new file mode 100644 index 0000000000..7d8bc3f0cf --- /dev/null +++ b/e2e/tests/protect-upgrade-guide.e2e.test.ts @@ -0,0 +1,91 @@ +/** + * Keeps `docs/migration/protect-dynamodb-to-stack.md` aligned with the suites + * that prove it. The guide backs each claim with a citation of the form + * `compat › ` or `crossover › `; this file fails when a + * cited test no longer exists under that name, or when the Protect.js versions + * the guide names are not the ones the suites install. + * + * Needs no credentials, so it runs in the default `test:e2e` suite. It checks + * that the cited tests exist, not that they pass: `test:protect-compat` and + * `test:protect-crossover` do that. + */ +import { readFileSync } from 'node:fs' +import { describe, expect, it } from 'vitest' +import { parse } from 'yaml' + +const read = (path: string) => + readFileSync(new URL(path, import.meta.url), 'utf8') + +const guide = read('../../docs/migration/protect-dynamodb-to-stack.md') +const suites = { + compat: read('./protect-dynamodb-compat.e2e.test.ts'), + crossover: read('./protect-crossover.e2e.test.ts'), + 'postgres-upgrade': read('./protect-postgres-upgrade.e2e.test.ts'), + example: read('./protect-guide-example.e2e.test.ts'), +} as const + +const citations = [ + ...guide.matchAll(/`(compat|crossover|postgres-upgrade|example) › ([^`]+)`/g), +].map(([, suite, name]) => ({ suite: suite as keyof typeof suites, name })) + +/** True when `name` is a string literal in `source`, in any quote style. */ +const isLiteral = (source: string, name: string) => + [`'${name}'`, `"${name}"`, `\`${name}\``].some((quoted) => + source.includes(quoted), + ) + +describe('Protect v2 to Stack v3 upgrade guide', () => { + it('cites the suites at all', () => { + expect(citations.length).toBeGreaterThan(20) + expect(new Set(citations.map((c) => c.suite))).toEqual( + new Set(['compat', 'crossover', 'postgres-upgrade', 'example']), + ) + }) + + it.each(citations.map((c) => [`${c.suite} › ${c.name}`, c] as const))( + 'cites a test that exists: %s', + (_label, { suite, name }) => { + expect(isLiteral(suites[suite], name)).toBe(true) + }, + ) + + it('names the Protect.js versions the suites install', () => { + const { devDependencies } = JSON.parse(read('../package.json')) as { + devDependencies: Record + } + for (const pkg of [ + '@cipherstash/protect', + '@cipherstash/protect-dynamodb', + ]) { + expect(guide, pkg).toContain(`\`${pkg}@${devDependencies[pkg]}\``) + } + }) + + it('locks the customer transitive versions used by Protect', () => { + const lock = parse(read('../../pnpm-lock.yaml')) as { + snapshots: Record }> + } + const legacy = lock.snapshots['@cipherstash/protect@10.2.1'].dependencies + for (const [pkg, version] of Object.entries({ + '@cipherstash/protect-ffi': '0.18.1', + '@cipherstash/schema': '2.0.2', + })) { + expect(legacy?.[pkg], pkg).toBe(version) + expect(guide).toContain(`\`${pkg}@${version}\``) + } + }) + + // `pnpm remove` refuses a name the app's package.json does not declare + // (ERR_PNPM_CANNOT_REMOVE_MISSING_DEPS) and then removes nothing, so a + // transitive Protect dependency in the same command fails the whole step for + // an app that only declared the two direct packages. + it('removes only the packages an app declares directly', () => { + const removes = [...guide.matchAll(/^npm uninstall (.+)$/gm)].map( + ([, args]) => args.trim().split(/\s+/), + ) + expect(removes).toEqual([ + ['@cipherstash/protect', '@cipherstash/protect-dynamodb'], + ['@cipherstash/protect'], + ]) + }) +}) diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index bc6d3ebfeb..a23e5b1077 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -1,4 +1,10 @@ { "extends": "../tsconfig.json", - "include": ["tests/**/*.ts", "vitest.config.ts"] + "include": [ + "migration-guide/**/*.ts", + "tests/**/*.ts", + "vitest.config.ts", + "vitest.protect-compat.config.ts", + "vitest.protect-crossover.config.ts" + ] } diff --git a/e2e/vitest.config.ts b/e2e/vitest.config.ts index 1792634156..6960738fe9 100644 --- a/e2e/vitest.config.ts +++ b/e2e/vitest.config.ts @@ -7,6 +7,17 @@ export default defineConfig({ test: { globals: true, include: ['tests/**/*.e2e.test.ts'], + // Fail without CS_* credentials (and, for the cross-store suite, + // DATABASE_URL), which turbo's strict env mode hides from `test:e2e`; they + // run from `vitest.protect-compat.config.ts` and + // `vitest.protect-crossover.config.ts` instead. + exclude: [ + '**/node_modules/**', + 'tests/protect-dynamodb-compat.e2e.test.ts', + 'tests/protect-crossover.e2e.test.ts', + 'tests/protect-postgres-upgrade.e2e.test.ts', + 'tests/protect-guide-example.e2e.test.ts', + ], pool: 'forks', testTimeout: 30_000, hookTimeout: 30_000, diff --git a/e2e/vitest.protect-compat.config.ts b/e2e/vitest.protect-compat.config.ts new file mode 100644 index 0000000000..6f83865b27 --- /dev/null +++ b/e2e/vitest.protect-compat.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'vitest/config' +import base from './vitest.config' + +// The protect-dynamodb compatibility suite, which the default config leaves +// out. It needs the four CS_* credential variables and fails without them. +// (Not `mergeConfig`: it concatenates arrays, so the base `exclude` would win.) +export default defineConfig({ + test: { + ...base.test, + include: ['tests/protect-dynamodb-compat.e2e.test.ts'], + exclude: ['**/node_modules/**'], + }, +}) diff --git a/e2e/vitest.protect-crossover.config.ts b/e2e/vitest.protect-crossover.config.ts new file mode 100644 index 0000000000..1e5a6788f0 --- /dev/null +++ b/e2e/vitest.protect-crossover.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vitest/config' +import base from './vitest.config' + +// The DynamoDB <-> Postgres cross-store suite, which the default config leaves +// out. It needs the four CS_* credential variables and DATABASE_URL, and fails +// without them. (Not `mergeConfig`: it concatenates arrays, so the base +// `exclude` would win.) +export default defineConfig({ + test: { + ...base.test, + include: [ + 'tests/protect-crossover.e2e.test.ts', + 'tests/protect-postgres-upgrade.e2e.test.ts', + 'tests/protect-guide-example.e2e.test.ts', + ], + fileParallelism: false, + exclude: ['**/node_modules/**'], + }, +}) diff --git a/languages/golang/auth/guest/Cargo.lock b/languages/golang/auth/guest/Cargo.lock index b8bc8eb213..89660d0075 100644 --- a/languages/golang/auth/guest/Cargo.lock +++ b/languages/golang/auth/guest/Cargo.lock @@ -1264,9 +1264,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open" -version = "5.4.4" +version = "5.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa576c76302b7b808eecc68061e67336c47833ef9d22caa74dda10fa9675eebc" +checksum = "8d8c8b8e725ad26404d6896eb2f064294a0a7b4f1d9120210d85544684c4ca95" dependencies = [ "is-wsl", "libc", @@ -1856,6 +1856,7 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "uuid", + "zeroize", ] [[package]] @@ -2010,9 +2011,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.53.3" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -2196,9 +2197,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" dependencies = [ "atomic", "getrandom 0.4.3", diff --git a/languages/golang/auth/transport.go b/languages/golang/auth/transport.go index b2e18d89cd..2ee8b8ffa1 100644 --- a/languages/golang/auth/transport.go +++ b/languages/golang/auth/transport.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "io" - "math" "net/http" "sort" "strings" @@ -201,7 +200,7 @@ func (t *authTransport) send(ctx context.Context, m api.Module, func (t *authTransport) placeResponse(ctx context.Context, m api.Module, hp, hl, bp, bl uint32, status int32, headers, body []byte, ) int32 { - if !placeAuth(ctx, m, hp, hl, headers) || !placeAuth(ctx, m, bp, bl, body) { + if !guest.Place(ctx, m, hp, hl, headers) || !guest.Place(ctx, m, bp, bl, body) { return -1 } return status @@ -220,31 +219,12 @@ func (t *authTransport) oidcTokenGet(ctx context.Context, m api.Module, provider } bytes := []byte(token) defer guest.Wipe(bytes) - if !placeAuth(ctx, m, ptrOut, lenOut, bytes) { + if !guest.Place(ctx, m, ptrOut, lenOut, bytes) { return 1 } return 0 } -// The only guest re-entry allowed during a host import is its allocator. -func placeAuth(ctx context.Context, m api.Module, ptrOut, lenOut uint32, data []byte) bool { - alloc := m.ExportedFunction("se_alloc") - if alloc == nil { - return false - } - if uint64(len(data)) > math.MaxUint32 { - return false - } - res, err := alloc.Call(ctx, uint64(len(data))) - if err != nil || len(res) == 0 || res[0] == 0 { - return false - } - ptr := api.DecodeU32(res[0]) - mem := m.Memory() - return (len(data) == 0 || mem.Write(ptr, data)) && - mem.WriteUint32Le(ptrOut, ptr) && mem.WriteUint32Le(lenOut, uint32(len(data))) //nolint:gosec // bounded above -} - func parseAuthHeaders(buf []byte) http.Header { h := make(http.Header) for _, line := range strings.Split(string(buf), "\n") { diff --git a/languages/golang/cmd/stashgen/main.go b/languages/golang/cmd/stashgen/main.go index fcaa74fe40..489623e314 100644 --- a/languages/golang/cmd/stashgen/main.go +++ b/languages/golang/cmd/stashgen/main.go @@ -52,7 +52,8 @@ func (m *modelFlags) Set(s string) error { // run is main without the process: dir is the package directory ("" for the // working directory, which is where go generate runs), and newEngine gives -// the engine that checks the declaration. +// the engine that checks the declaration. run owns that engine and closes it +// (if it is an io.Closer) before it returns. func run(args []string, dir string, stdout, stderr io.Writer, newEngine func(context.Context) (stashgen.Engine, error)) int { fs := flag.NewFlagSet("stashgen", flag.ContinueOnError) fs.SetOutput(stderr) @@ -92,6 +93,12 @@ func run(args []string, dir string, stdout, stderr io.Writer, newEngine func(con fmt.Fprintln(stderr, err) return 1 } + // The embedded engine holds a wazero runtime and a reserved address-space + // mapping; release them on every path out, since tests and embedders + // call run repeatedly. + if closer, ok := engine.(io.Closer); ok { + defer func() { _ = closer.Close() }() + } file, err := stashgen.FromTags(ctx, engine, req) if err != nil { fmt.Fprintln(stderr, err) diff --git a/languages/golang/cmd/stashgen/main_test.go b/languages/golang/cmd/stashgen/main_test.go index 67eba5a89d..6849d99d86 100644 --- a/languages/golang/cmd/stashgen/main_test.go +++ b/languages/golang/cmd/stashgen/main_test.go @@ -3,6 +3,7 @@ package main import ( "bytes" "context" + "errors" "os" "os/exec" "path/filepath" @@ -787,3 +788,48 @@ func (e droppingEngine) Check(ctx context.Context, d stashgen.Declaration) (map[ } return answered, err } + +// closingEngine is a fake engine that records Close, as the embedded one +// holds a runtime that must be released. With refuse set, it refuses every +// declaration, as the embedded one does for a type it cannot produce. +type closingEngine struct { + enginetest.Static + refuse bool + closed int +} + +func (e *closingEngine) Close() error { e.closed++; return nil } + +func (e *closingEngine) Check(ctx context.Context, d stashgen.Declaration) (map[string][]stashgen.Operator, error) { + if e.refuse { + return nil, errors.New("engine refused the declaration") + } + return e.Static.Check(ctx, d) +} + +// run closes the engine it was given on every path out of it: a written +// file, a type the package lacks, and a declaration the engine refuses. +func TestRunClosesTheEngine(t *testing.T) { + dir := writeModule(t, map[string]string{"model.go": userSource}) + cases := []struct { + name string + args []string + refuse bool + code int + }{ + {"success", []string{"-type", "User"}, false, 0}, + {"missing", []string{"-type", "Nobody"}, false, 1}, + {"refused", []string{"-type", "User"}, true, 1}, + } + for _, c := range cases { + engine := &closingEngine{refuse: c.refuse} + var stdout, stderr bytes.Buffer + code := run(c.args, dir, &stdout, &stderr, func(context.Context) (stashgen.Engine, error) { return engine, nil }) + if code != c.code { + t.Errorf("%s: exit %d, want %d\n%s", c.name, code, c.code, stderr.String()) + } + if engine.closed != 1 { + t.Errorf("%s: engine closed %d times, want 1\n%s", c.name, engine.closed, stderr.String()) + } + } +} diff --git a/languages/golang/encrypt/guest/Cargo.lock b/languages/golang/encrypt/guest/Cargo.lock index 9c2cc2d59b..5883bd4c34 100644 --- a/languages/golang/encrypt/guest/Cargo.lock +++ b/languages/golang/encrypt/guest/Cargo.lock @@ -1448,9 +1448,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open" -version = "5.4.4" +version = "5.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa576c76302b7b808eecc68061e67336c47833ef9d22caa74dda10fa9675eebc" +checksum = "8d8c8b8e725ad26404d6896eb2f064294a0a7b4f1d9120210d85544684c4ca95" dependencies = [ "is-wsl", "libc", @@ -2229,6 +2229,7 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "uuid", + "zeroize", ] [[package]] @@ -2400,9 +2401,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.53.3" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -2624,9 +2625,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" dependencies = [ "atomic", "getrandom 0.4.3", diff --git a/languages/golang/encrypt/transport.go b/languages/golang/encrypt/transport.go index d463a6b229..8d9454ef74 100644 --- a/languages/golang/encrypt/transport.go +++ b/languages/golang/encrypt/transport.go @@ -5,13 +5,13 @@ import ( "errors" "fmt" "io" - "math" "net/http" "sort" "strings" "sync" "sync/atomic" + "github.com/cipherstash/stack/languages/golang/internal/guest" "github.com/tetratelabs/wazero" "github.com/tetratelabs/wazero/api" ) @@ -215,7 +215,7 @@ func (t *transport) tokenGet(ctx context.Context, m api.Module, tokenPtrOut, tok // the source's own string is the source's. tok := []byte(token) defer wipe(tok) - if !place(ctx, m, tokenPtrOut, tokenLenOut, tok) { + if !guest.Place(ctx, m, tokenPtrOut, tokenLenOut, tok) { // The source did its part; the guest could not take the token (no // allocator, a refused allocation, an out-of-range slot). Say so, // or the failure reads as the source's. @@ -225,33 +225,6 @@ func (t *transport) tokenGet(ctx context.Context, m api.Module, tokenPtrOut, tok return 0 } -// place allocates a guest buffer through the module's own se_alloc, writes -// data into it, and stores its (ptr, len) into the out-slots. The guest -// reclaims the buffer through its registry. Re-entering the guest through -// se_alloc during a host import is the one re-entry the ABI permits. -func place(ctx context.Context, m api.Module, ptrOut, lenOut uint32, data []byte) bool { - alloc := m.ExportedFunction("se_alloc") - if alloc == nil { - return false - } - if uint64(len(data)) > math.MaxUint32 { - return false - } - res, err := alloc.Call(ctx, uint64(len(data))) - if err != nil { - return false - } - ptr := api.DecodeU32(res[0]) - if ptr == 0 { - return false - } - mem := m.Memory() - if len(data) > 0 && !mem.Write(ptr, data) { - return false - } - return mem.WriteUint32Le(ptrOut, ptr) && mem.WriteUint32Le(lenOut, uint32(len(data))) //nolint:gosec // bounded above -} - // parseHeaders decodes the guest's `name: value` line format. Malformed // lines are skipped, as the guest skips them in the other direction. func parseHeaders(buf []byte) http.Header { diff --git a/languages/golang/internal/guest/call.go b/languages/golang/internal/guest/call.go index 6c2619000e..c53e495e4f 100644 --- a/languages/golang/internal/guest/call.go +++ b/languages/golang/internal/guest/call.go @@ -50,21 +50,35 @@ type Exports struct { LastError api.Function } -// AllocWrite stages data into a fresh guest buffer. -func (e Exports) AllocWrite(ctx context.Context, m api.Module, data []byte) (Buf, error) { +// alloc asks the guest's se_alloc for n bytes. It is the one allocation +// sequence behind AllocWrite and Place, so the two cannot drift on the +// bound, the result's shape or the null-pointer check. +func alloc(ctx context.Context, fn api.Function, n uint64) (Buf, error) { // se_alloc takes an i32: a longer length would reach the guest // truncated to its low 32 bits. - if uint64(len(data)) > math.MaxUint32 { + if n > math.MaxUint32 { return Buf{}, errors.New("cipherstash: buffer exceeds the guest's 4 GiB address space") } - res, err := e.Alloc.Call(ctx, uint64(len(data))) + res, err := fn.Call(ctx, n) if err != nil { return Buf{}, fmt.Errorf("%w: guest alloc: %w", ErrTrap, err) } - b := Buf{Ptr: api.DecodeU32(res[0]), Len: uint32(len(data))} //nolint:gosec // bounded above + if len(res) == 0 { + return Buf{}, errors.New("cipherstash: guest allocation returned no pointer") + } + b := Buf{Ptr: api.DecodeU32(res[0]), Len: uint32(n)} //nolint:gosec // bounded above if b.Ptr == 0 { return Buf{}, errors.New("cipherstash: guest allocation failed") } + return b, nil +} + +// AllocWrite stages data into a fresh guest buffer. +func (e Exports) AllocWrite(ctx context.Context, m api.Module, data []byte) (Buf, error) { + b, err := alloc(ctx, e.Alloc, uint64(len(data))) + if err != nil { + return Buf{}, err + } if len(data) > 0 && !m.Memory().Write(b.Ptr, data) { e.Free(ctx, b) return Buf{}, errors.New("cipherstash: guest memory write out of range") @@ -82,6 +96,43 @@ func (e Exports) Free(ctx context.Context, b Buf) { } } +// Place hands data to the guest from inside a host import: it allocates a +// guest buffer through the module's own se_alloc, writes data into it and +// stores the buffer's (ptr, len) into the guest's out-slots, which is how +// the guest comes to own and reclaim it. se_alloc is the one export the ABI +// lets a host import re-enter. +// +// It reports whether the guest took the data. Both out-slots are checked +// against guest memory before anything is allocated: a buffer the guest is +// never told about can be neither read nor released, and it would hold the +// data (a bearer token, a ZeroKMS response) until shutdown. Guest memory +// only grows, so a slot that was in range stays writable after se_alloc. +func Place(ctx context.Context, m api.Module, ptrOut, lenOut uint32, data []byte) bool { + fn := m.ExportedFunction("se_alloc") + if fn == nil { + return false + } + mem := m.Memory() + // Probe each slot by reading it rather than comparing against + // mem.Size(): Size reports zero for a full 4 GiB memory (65536 pages), + // which would refuse every placement. + if _, ok := mem.ReadUint32Le(ptrOut); !ok { + return false + } + if _, ok := mem.ReadUint32Le(lenOut); !ok { + return false + } + b, err := alloc(ctx, fn, uint64(len(data))) + if err != nil { + return false + } + // A write that fails lands nothing: wazero's Write is all-or-nothing. + if len(data) > 0 && !mem.Write(b.Ptr, data) { + return false + } + return mem.WriteUint32Le(ptrOut, b.Ptr) && mem.WriteUint32Le(lenOut, b.Len) +} + // Call stages every buffer argument, calls fn with the arguments in // order, and copies the output out before every buffer — inputs and // output — is wiped and freed. mem is the module's allocator, held diff --git a/languages/golang/internal/guest/place_test.go b/languages/golang/internal/guest/place_test.go new file mode 100644 index 0000000000..17a994c0fe --- /dev/null +++ b/languages/golang/internal/guest/place_test.go @@ -0,0 +1,122 @@ +package guest_test + +import ( + "bytes" + "context" + "sync/atomic" + "testing" + + "github.com/cipherstash/stack/languages/golang/internal/guest" + "github.com/tetratelabs/wazero" + "github.com/tetratelabs/wazero/api" + "github.com/tetratelabs/wazero/experimental" +) + +// allocCounter counts the calls the stub guest's se_alloc receives, from the +// host side, so a test can tell "refused before allocating" from "allocated +// and left the buffer untouched". +type allocCounter struct{ calls atomic.Int32 } + +func (c *allocCounter) NewFunctionListener(def api.FunctionDefinition) experimental.FunctionListener { + if names := def.ExportNames(); len(names) > 0 && names[0] == "se_alloc" { + return c + } + return nil +} + +func (c *allocCounter) Before(context.Context, api.Module, api.FunctionDefinition, []uint64, experimental.StackIterator) { + c.calls.Add(1) +} +func (*allocCounter) After(context.Context, api.Module, api.FunctionDefinition, []uint64) {} +func (*allocCounter) Abort(context.Context, api.Module, api.FunctionDefinition, error) {} + +// allocAt is where the stub guest's se_alloc places every buffer. +const allocAt = 4096 + +// Place stores the buffer in the guest's out-slots and leaves it there for +// the guest to reclaim. +func TestPlaceHandsTheGuestTheBuffer(t *testing.T) { + ctx := context.Background() + rt := wazero.NewRuntime(ctx) + defer func() { _ = rt.Close(ctx) }() + counter := &allocCounter{} + m, err := rt.InstantiateWithConfig(experimental.WithFunctionListenerFactory(ctx, counter), stubGuest(0, nil, withLastError), wazero.NewModuleConfig()) + if err != nil { + t.Fatal(err) + } + if !guest.Place(ctx, m, 64, 68, []byte("secret")) { + t.Fatal("Place failed on valid slots") + } + // The counter is only evidence of "never allocated" if it sees an + // allocation when there is one. + if n := counter.calls.Load(); n != 1 { + t.Fatalf("se_alloc was called %d times, want 1", n) + } + got, _ := m.Memory().Read(allocAt, 6) + if string(got) != "secret" { + t.Fatalf("buffer = %q", got) + } + ptr, _ := m.Memory().ReadUint32Le(64) + n, _ := m.Memory().ReadUint32Le(68) + if ptr != allocAt || n != 6 { + t.Fatalf("slots = (%d, %d)", ptr, n) + } +} + +// An out-slot that is out of range is refused before anything is allocated: +// no buffer the guest cannot learn of is left holding the data, and no +// guest memory is spent on it. The stub's se_alloc always returns allocAt, +// so a sentinel there that survives shows the buffer was never allocated or +// written. +func TestPlaceRefusesAnOutOfRangeSlotBeforeAllocating(t *testing.T) { + ctx := context.Background() + const outOfRange = 1 << 16 // the end of the stub's one page + for name, slots := range map[string][2]uint32{ + "ptr slot": {outOfRange, 68}, + "len slot": {64, outOfRange}, + "straddle page": {outOfRange - 2, 68}, + "near 4 GiB": {0xFFFFFFFE, 68}, + } { + t.Run(name, func(t *testing.T) { + rt := wazero.NewRuntime(ctx) + defer func() { _ = rt.Close(ctx) }() + counter := &allocCounter{} + m, err := rt.InstantiateWithConfig(experimental.WithFunctionListenerFactory(ctx, counter), stubGuest(0, nil, withLastError), wazero.NewModuleConfig()) + if err != nil { + t.Fatal(err) + } + sentinel := []byte("XXXXXX") + m.Memory().Write(allocAt, sentinel) + if guest.Place(ctx, m, slots[0], slots[1], []byte("secret")) { + t.Fatal("Place succeeded with an out-of-range slot") + } + if n := counter.calls.Load(); n != 0 { + t.Fatalf("se_alloc was called %d times, want 0", n) + } + got, _ := m.Memory().Read(allocAt, 6) + if !bytes.Equal(got, sentinel) { + t.Fatalf("guest memory at the allocation = %q, want it untouched", got) + } + if ptr, _ := m.Memory().ReadUint32Le(64); ptr != 0 { + t.Fatalf("the pointer slot holds %d", ptr) + } + }) + } +} + +// An empty value is placed as a zero-length buffer, not refused. +func TestPlaceTakesAnEmptyValue(t *testing.T) { + ctx := context.Background() + rt := wazero.NewRuntime(ctx) + defer func() { _ = rt.Close(ctx) }() + m, err := rt.InstantiateWithConfig(ctx, stubGuest(0, nil, withLastError), wazero.NewModuleConfig()) + if err != nil { + t.Fatal(err) + } + if !guest.Place(ctx, m, 64, 68, nil) { + t.Fatal("Place refused an empty value") + } + if n, _ := m.Memory().ReadUint32Le(68); n != 0 { + t.Fatalf("length slot = %d", n) + } +} diff --git a/languages/typescript/packages/auth/native.d.ts b/languages/typescript/packages/auth/native.d.ts index d38d002410..d798ade1f7 100644 --- a/languages/typescript/packages/auth/native.d.ts +++ b/languages/typescript/packages/auth/native.d.ts @@ -58,7 +58,9 @@ export declare function beginDeviceCodeFlow(region: string, clientId: string): P * * Detection order: * 1. `CS_CLIENT_ACCESS_KEY` env var (or explicit `accessKey` option) → access key auth - * 2. `~/.cipherstash/auth.json` → OAuth token auth + * 2. `~/.cipherstash/auth.json` → OAuth token auth, from the workspace named by + * the workspace CRN (option or `CS_WORKSPACE_CRN`) if set, otherwise the + * CLI's current workspace * 3. Error: not authenticated */ export declare class AutoStrategy { diff --git a/languages/typescript/packages/auth/src/lib.rs b/languages/typescript/packages/auth/src/lib.rs index 67bd19b9c2..3e5dff27bf 100644 --- a/languages/typescript/packages/auth/src/lib.rs +++ b/languages/typescript/packages/auth/src/lib.rs @@ -109,7 +109,9 @@ pub struct AutoStrategyOptions { /// /// Detection order: /// 1. `CS_CLIENT_ACCESS_KEY` env var (or explicit `accessKey` option) → access key auth -/// 2. `~/.cipherstash/auth.json` → OAuth token auth +/// 2. `~/.cipherstash/auth.json` → OAuth token auth, from the workspace named by +/// the workspace CRN (option or `CS_WORKSPACE_CRN`) if set, otherwise the +/// CLI's current workspace /// 3. Error: not authenticated #[napi] pub struct AutoStrategy { diff --git a/languages/typescript/packages/cli/package.json b/languages/typescript/packages/cli/package.json index f745c29768..fc9a1a289a 100644 --- a/languages/typescript/packages/cli/package.json +++ b/languages/typescript/packages/cli/package.json @@ -54,7 +54,7 @@ "jiti": "2.7.0", "pg": "8.23.1", "picocolors": "^1.1.1", - "posthog-node": "^5.55.2", + "posthog-node": "^5.61.1", "zod": "^3.25.76" }, "//optionalDependencies": "@cipherstash/auth ships per-platform native bindings as optional peerDependencies. pnpm does not auto-install platform-matched optional peer deps, so we declare them here as optionalDependencies — pnpm then picks the binary matching the host's os/cpu (from each sub-package's own package.json) and ignores the rest. All seven are workspace packages in one changesets `fixed` group, so `workspace:*` packs the same exact version for each.", diff --git a/languages/typescript/packages/cli/src/cli/registry.ts b/languages/typescript/packages/cli/src/cli/registry.ts index e052aa7122..26e45bdfde 100644 --- a/languages/typescript/packages/cli/src/cli/registry.ts +++ b/languages/typescript/packages/cli/src/cli/registry.ts @@ -634,7 +634,8 @@ export const registry: CommandGroup[] = [ { name: '--migrations-dir', value: '', - description: 'Directory to write the drop migration into.', + description: + 'Directory to write the drop migration into (Drizzle projects: drizzle.config.ts `out` wins; this is the fallback).', }, ], }, @@ -773,7 +774,8 @@ export const registry: CommandGroup[] = [ { name: '--migrations-dir', value: '', - description: 'Directory to write the drop migration into.', + description: + 'Directory to write the drop migration into (Drizzle projects: drizzle.config.ts `out` wins; this is the fallback).', }, { name: '--uninstall-eql', diff --git a/languages/typescript/packages/cli/src/commands/db/__tests__/find-generated-migration.test.ts b/languages/typescript/packages/cli/src/commands/db/__tests__/find-generated-migration.test.ts index f75dfc9482..7322c56f4c 100644 --- a/languages/typescript/packages/cli/src/commands/db/__tests__/find-generated-migration.test.ts +++ b/languages/typescript/packages/cli/src/commands/db/__tests__/find-generated-migration.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { findGeneratedMigration } from '../../eql/migration.js' +import { findGeneratedMigration } from '../drizzle-migration.js' /** * `findGeneratedMigration` locates the custom migration scaffolded by diff --git a/languages/typescript/packages/cli/src/commands/db/drizzle-migration.ts b/languages/typescript/packages/cli/src/commands/db/drizzle-migration.ts new file mode 100644 index 0000000000..48e11b7a72 --- /dev/null +++ b/languages/typescript/packages/cli/src/commands/db/drizzle-migration.ts @@ -0,0 +1,85 @@ +import { existsSync } from 'node:fs' +import { readdir } from 'node:fs/promises' +import { isAbsolute, join, resolve } from 'node:path' + +/** + * Helpers for locating the file `drizzle-kit generate --custom` just wrote. + * Shared by `eql migration --drizzle` and the `encrypt drop` / `decrypt` + * scaffolds, so both agree on where drizzle-kit's `drizzle.config.ts` sent it. + */ + +/** + * Find the most recently generated Drizzle migration matching the name. + * + * Matches the exact `_.sql` suffix, so a longer name that merely contains + * the stem (`drop_users_email_backup`) is never mistaken for it. + */ +export async function findGeneratedMigration( + outDir: string, + migrationName: string, +): Promise { + if (!existsSync(outDir)) { + throw new Error( + `Drizzle output directory not found: ${outDir}\nMake sure drizzle-kit is configured correctly.`, + ) + } + const migrationSuffix = `_${migrationName}.sql` + const matchingFiles = (await readdir(outDir)) + .filter((entry) => entry.endsWith(migrationSuffix)) + .sort() + if (matchingFiles.length === 0) { + throw new Error( + `Could not find a migration matching "${migrationName}" in ${outDir}`, + ) + } + return join(outDir, matchingFiles[matchingFiles.length - 1]) +} + +// biome-ignore lint/suspicious/noControlCharactersInRegex: matching ESC is the point +const ANSI_ESCAPE = /\u001b\[[0-9;]*[A-Za-z]/g + +function stripAnsi(text: string): string { + return text.replace(ANSI_ESCAPE, '') +} + +/** + * Pull the migration path out of drizzle-kit's own success line: + * + * [✓] Your SQL migration file ➜ drizzle/0000_install-eql.sql 🚀 + * + * Since we no longer pass `--out` (drizzle-kit rejects the run when we do — + * see `generateDrizzleEqlMigration`), `drizzle.config.ts` owns the output + * directory and this line is how we learn it. The path is printed relative to + * the cwd drizzle-kit ran in, which is ours. + * + * Returns `undefined` unless the file is actually there, so an unrecognised + * banner or a moved file falls through to the directory scan rather than + * pointing the SQL write at a path that does not exist. + */ +export function parseReportedMigrationPath( + stdout: string | undefined, +): string | undefined { + if (!stdout) return undefined + // Scanned per line, taking everything between the arrow and the LAST `.sql` + // on it, because an output directory may contain spaces — a `\S+` pattern + // truncates such a path, fails the existence check, and drops us into the + // fallback scan of an unrelated directory. + // + // Last line wins: one invocation writes one file, but a wrapper that echoes + // its own banner first should not shadow drizzle-kit's. + let found: string | undefined + for (const line of stdout.split(/\r?\n/)) { + const arrow = line.indexOf('➜') + if (arrow === -1) continue + // drizzle-kit colours its banner on a TTY-like stdout; escape codes inside + // the path would fail the existence check and drop us into the fallback. + const rest = stripAnsi(line.slice(arrow + 1)) + const end = rest.lastIndexOf('.sql') + if (end === -1) continue + const candidate = rest.slice(0, end + '.sql'.length).trim() + if (!candidate) continue + const abs = isAbsolute(candidate) ? candidate : resolve(candidate) + if (existsSync(abs)) found = abs + } + return found +} diff --git a/languages/typescript/packages/cli/src/commands/encrypt/__tests__/drizzle-helper.test.ts b/languages/typescript/packages/cli/src/commands/encrypt/__tests__/drizzle-helper.test.ts new file mode 100644 index 0000000000..dbe569c623 --- /dev/null +++ b/languages/typescript/packages/cli/src/commands/encrypt/__tests__/drizzle-helper.test.ts @@ -0,0 +1,177 @@ +import { + existsSync, + mkdirSync, + mkdtempSync, + readFileSync, + realpathSync, + rmSync, + writeFileSync, +} from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' + +const spawnSyncMock = vi.hoisted(() => vi.fn()) +vi.mock('node:child_process', () => ({ spawnSync: spawnSyncMock })) +vi.mock('@/commands/init/utils.js', () => ({ + detectPackageManager: () => 'npm', + runnerArgv: () => ({ command: 'npx', prefixArgs: [] }), +})) + +import { scaffoldDrizzleMigration } from '../drizzle-helper.js' + +/** + * drizzle.config.ts's `out` owns where drizzle-kit writes. The scaffold must + * follow the path drizzle-kit reports, never the --migrations-dir it scans as + * a fallback (CIP-5162). + */ +// What drizzle-kit's `generate --custom` actually writes. +const PLACEHOLDER = '-- Custom SQL migration file, put your code below! --\n' + +describe('scaffoldDrizzleMigration', () => { + let root: string + let cwd: string + beforeEach(() => { + // realpath: process.cwd() reports the physical path after chdir, so a + // symlinked TMPDIR would otherwise break the expected-path assertions. + root = realpathSync(mkdtempSync(join(tmpdir(), 'stash-scaffold-'))) + cwd = process.cwd() + process.chdir(root) + spawnSyncMock.mockReset() + }) + afterEach(() => { + process.chdir(cwd) + rmSync(root, { recursive: true, force: true }) + }) + + function drizzleKitWrites(relPath: string) { + spawnSyncMock.mockImplementation(() => { + mkdirSync(join(relPath, '..'), { recursive: true }) + writeFileSync(relPath, PLACEHOLDER) + return { + status: 0, + stdout: `[✓] Your SQL migration file ➜ ${relPath} 🚀\n`, + stderr: '', + } + }) + } + + it('writes to the directory drizzle-kit reports, not the scanned one', async () => { + mkdirSync('drizzle') + writeFileSync( + 'drizzle/0000_drop_users_email.sql', + 'ALTER TABLE t DROP COLUMN c;', + ) + drizzleKitWrites('src/db/migrations/0003_drop_users_email.sql') + + const result = await scaffoldDrizzleMigration({ + name: 'drop_users_email', + outDir: 'drizzle', + sql: 'ALTER TABLE users DROP COLUMN email;', + }) + + expect(result.path).toBe( + join(root, 'src/db/migrations/0003_drop_users_email.sql'), + ) + expect(readFileSync(result.path, 'utf-8')).toContain('DROP COLUMN email') + expect(readFileSync('drizzle/0000_drop_users_email.sql', 'utf-8')).toBe( + 'ALTER TABLE t DROP COLUMN c;', + ) + expect(result.dir).not.toBe(result.requestedDir) + }) + + it('does not require the fallback directory to exist when the path is reported', async () => { + drizzleKitWrites('db/0000_drop_a.sql') + const result = await scaffoldDrizzleMigration({ + name: 'drop_a', + outDir: 'drizzle', + sql: 'SELECT 1;', + }) + expect(existsSync(result.path)).toBe(true) + }) + + it('falls back to the scan when the banner is unrecognised, taking only a new exact-suffix file', async () => { + mkdirSync('drizzle') + writeFileSync('drizzle/0000_drop_a.sql', 'ALTER TABLE t DROP COLUMN c;') + spawnSyncMock.mockImplementation(() => { + writeFileSync('drizzle/0001_drop_a.sql', PLACEHOLDER) + writeFileSync('drizzle/0002_drop_a_backup.sql', '') + return { status: 0, stdout: 'done', stderr: '' } + }) + const result = await scaffoldDrizzleMigration({ + name: 'drop_a', + outDir: 'drizzle', + sql: 'SELECT 1;', + }) + expect(result.path).toBe(join(root, 'drizzle/0001_drop_a.sql')) + expect(readFileSync('drizzle/0000_drop_a.sql', 'utf-8')).toBe( + 'ALTER TABLE t DROP COLUMN c;', + ) + }) + + it('refuses to overwrite a pre-existing same-stem file when nothing new appeared', async () => { + mkdirSync('drizzle') + writeFileSync('drizzle/0000_drop_a.sql', 'ALTER TABLE t DROP COLUMN c;') + spawnSyncMock.mockReturnValue({ status: 0, stdout: 'done', stderr: '' }) + await expect( + scaffoldDrizzleMigration({ + name: 'drop_a', + outDir: 'drizzle', + sql: 'SELECT 1;', + }), + ).rejects.toThrow(/Refusing to overwrite/) + expect(readFileSync('drizzle/0000_drop_a.sql', 'utf-8')).toBe( + 'ALTER TABLE t DROP COLUMN c;', + ) + }) + + it('follows a reported path even when the banner is colourised', async () => { + mkdirSync('db') + spawnSyncMock.mockImplementation(() => { + writeFileSync('db/0000_drop_a.sql', PLACEHOLDER) + return { + status: 0, + stdout: + '[✓] Your SQL migration file \u001b[2m➜\u001b[0m \u001b[1mdb/0000_drop_a.sql\u001b[0m 🚀', + stderr: '', + } + }) + const result = await scaffoldDrizzleMigration({ + name: 'drop_a', + outDir: 'drizzle', + sql: 'SELECT 1;', + }) + expect(result.path).toBe(join(root, 'db/0000_drop_a.sql')) + }) + + it('refuses to overwrite a reported file that already has content', async () => { + mkdirSync('db') + writeFileSync('db/0000_old.sql', 'ALTER TABLE t DROP COLUMN c;') + spawnSyncMock.mockReturnValue({ + status: 0, + stdout: '➜ db/0000_old.sql', + stderr: '', + }) + await expect( + scaffoldDrizzleMigration({ + name: 'x', + outDir: 'drizzle', + sql: 'SELECT 1;', + }), + ).rejects.toThrow(/not a drizzle-kit scaffold/) + expect(readFileSync('db/0000_old.sql', 'utf-8')).toBe( + 'ALTER TABLE t DROP COLUMN c;', + ) + }) + + it('surfaces drizzle-kit stdout and stderr on failure', async () => { + spawnSyncMock.mockReturnValue({ + status: 1, + stdout: 'config error', + stderr: 'boom', + }) + await expect( + scaffoldDrizzleMigration({ name: 'x', outDir: 'drizzle', sql: '' }), + ).rejects.toThrow(/config error\nboom/) + }) +}) diff --git a/languages/typescript/packages/cli/src/commands/encrypt/drizzle-helper.ts b/languages/typescript/packages/cli/src/commands/encrypt/drizzle-helper.ts index f820d6c46e..632b4a86c6 100644 --- a/languages/typescript/packages/cli/src/commands/encrypt/drizzle-helper.ts +++ b/languages/typescript/packages/cli/src/commands/encrypt/drizzle-helper.ts @@ -1,7 +1,11 @@ import { spawnSync } from 'node:child_process' import { existsSync } from 'node:fs' -import { readdir, writeFile } from 'node:fs/promises' -import { join, resolve } from 'node:path' +import { readdir, readFile, writeFile } from 'node:fs/promises' +import { basename, dirname, resolve } from 'node:path' +import { + findGeneratedMigration, + parseReportedMigrationPath, +} from '@/commands/db/drizzle-migration.js' import { detectPackageManager, runnerArgv } from '@/commands/init/utils.js' /** @@ -10,12 +14,21 @@ import { detectPackageManager, runnerArgv } from '@/commands/init/utils.js' * does — `drizzle-kit generate --custom` creates the file and records the * journal entry / snapshot, then we overwrite the empty body with our SQL. * - * Used by `encrypt drop` to ship the plaintext-column drop migration in a - * shape `drizzle-kit migrate` actually picks up. + * Used by `encrypt drop` and the `decrypt` commands to ship the + * plaintext-column drop migration in a shape `drizzle-kit migrate` actually + * picks up. * - * Throws if `drizzle-kit` isn't on PATH or the generated file can't be - * located afterwards. Callers should fall back to the self-named-file - * approach for non-Drizzle projects. + * `drizzle.config.ts`'s `out` decides where drizzle-kit writes (we cannot pass + * `--out`: it switches drizzle-kit into CLI mode — see + * `generateDrizzleEqlMigration`), so the path drizzle-kit REPORTS is the + * authority on where the file landed. `outDir` is only the fallback place to + * look when that report is missing, and the fallback only accepts a file that + * did not exist before the run — otherwise an older same-stem migration in an + * unrelated directory would be overwritten. + * + * Throws if `drizzle-kit` can't run or the generated file can't be located + * afterwards. Callers should fall back to the self-named-file approach for + * non-Drizzle projects. */ export async function scaffoldDrizzleMigration(opts: { /** @@ -23,17 +36,13 @@ export async function scaffoldDrizzleMigration(opts: { * Drizzle prefixes with the next sequential index (`0003_.sql`). */ name: string - /** Drizzle's `out` directory, defaults to `./drizzle` if unset. */ + /** Fallback directory to scan if drizzle-kit's reported path is unusable. */ outDir: string /** SQL to write into the generated file. */ sql: string -}): Promise<{ path: string }> { +}): Promise<{ path: string; dir: string; requestedDir: string }> { const outDir = resolve(opts.outDir) - if (!existsSync(outDir)) { - throw new Error( - `Drizzle output directory not found: ${outDir}\nMake sure drizzle-kit is configured correctly (check drizzle.config.ts's \`out\`).`, - ) - } + const before = await listSqlFiles(outDir) // `drizzle-kit generate --custom` scaffolds an empty migration file with // the right prefix and records the journal/snapshot entry. spawnSync @@ -53,34 +62,68 @@ export async function scaffoldDrizzleMigration(opts: { { stdio: 'pipe', encoding: 'utf-8' }, ) if (cp.error || cp.status !== 0) { - const stderr = typeof cp.stderr === 'string' ? cp.stderr.trim() : undefined + const output = [cp.stdout, cp.stderr] + .map((stream) => (typeof stream === 'string' ? stream.trim() : '')) + .filter(Boolean) + .join('\n') throw new Error( - `Failed to scaffold Drizzle migration: ${stderr ?? cp.error?.message ?? 'unknown error'}`, + `Failed to scaffold Drizzle migration: ${output || cp.error?.message || 'unknown error'}`, ) } - const generatedPath = await findLatestNamedMigration(outDir, opts.name) + const generatedPath = + parseReportedMigrationPath(cp.stdout) ?? + (await findNewMigration(outDir, opts.name, before)) + // `generate --custom` leaves a comment-only placeholder (drizzle-kit writes + // `-- Custom SQL migration file, put your code below! --`). Anything with + // real SQL is an existing migration (a banner line naming one, a wrapper's + // echo): never overwrite it. + if (!isScaffoldOnly(await readFile(generatedPath, 'utf-8'))) { + throw new Error( + `${generatedPath} is not a drizzle-kit scaffold; refusing to overwrite it. If drizzle-kit just journaled a placeholder "${opts.name}" migration, it is in the \`out\` of your drizzle.config.ts.`, + ) + } await writeFile(generatedPath, opts.sql, 'utf-8') - return { path: generatedPath } + return { + path: generatedPath, + dir: dirname(generatedPath), + requestedDir: outDir, + } +} + +/** Blank, or nothing but `--` comment lines: no statement to lose. */ +function isScaffoldOnly(content: string): boolean { + return content + .split(/\r?\n/) + .every((line) => line.trim() === '' || line.trim().startsWith('--')) +} + +async function listSqlFiles(dir: string): Promise> { + if (!existsSync(dir)) return new Set() + return new Set((await readdir(dir)).filter((f) => f.endsWith('.sql'))) } /** - * Find the most recent `0NNN_.sql` in the Drizzle out directory. - * Drizzle's flat numbered prefix means string-sort is the right order. + * Fallback when drizzle-kit's banner is not recognised: the newest exact + * `_.sql` in `outDir`, provided this run created it. A file that was + * already there is somebody's earlier (maybe applied) migration, and + * overwriting it would silently lose the new one. */ -async function findLatestNamedMigration( +async function findNewMigration( outDir: string, name: string, + before: Set, ): Promise { - const entries = await readdir(outDir) - const matching = entries - .filter((entry) => entry.endsWith('.sql') && entry.includes(name)) - .sort() - if (matching.length === 0) { + const found = await findGeneratedMigration(outDir, name).catch(() => { + throw new Error( + `Could not locate the migration drizzle-kit generated for "${name}". It was not reported on stdout and is not in ${outDir}. Check the \`out\` in your drizzle.config.ts — a custom migration may have been journaled there with an empty body.`, + ) + }) + if (before.has(basename(found))) { throw new Error( - `Could not find a migration matching "${name}" in ${outDir} after running drizzle-kit generate.`, + `drizzle-kit did not report where it wrote "${name}", and ${outDir} only holds a pre-existing file with that name (${found}). Refusing to overwrite it. Check the \`out\` in your drizzle.config.ts — an empty custom migration may have been journaled there.`, ) } - return join(outDir, matching[matching.length - 1] as string) + return found } diff --git a/languages/typescript/packages/cli/src/commands/encrypt/lib/migration-file.ts b/languages/typescript/packages/cli/src/commands/encrypt/lib/migration-file.ts index 5b0ef63177..f0acb93d06 100644 --- a/languages/typescript/packages/cli/src/commands/encrypt/lib/migration-file.ts +++ b/languages/typescript/packages/cli/src/commands/encrypt/lib/migration-file.ts @@ -1,7 +1,9 @@ import fs from 'node:fs' import path from 'node:path' +import * as p from '@clack/prompts' import { detectDrizzle } from '@/commands/db/detect.js' import { detectPackageManager, runnerCommand } from '@/commands/init/utils.js' +import { messages } from '@/messages.js' import { scaffoldDrizzleMigration } from '../drizzle-helper.js' /** Where a generated migration landed, and how to apply it. */ @@ -41,6 +43,21 @@ export async function writeMigrationFile(opts: { outDir: migrationsDir, sql: opts.sql, }) + // `drizzle.config.ts` decides where drizzle-kit writes, so an explicit + // --migrations-dir is only honoured as a fallback. Say so rather than leave + // the user believing the file is where they asked for it. + if ( + opts.migrationsDir !== undefined && + result.dir !== result.requestedDir + ) { + p.log.warn( + messages.eql.migrationDrizzleOutOverridden( + result.dir, + result.requestedDir, + '--migrations-dir', + ), + ) + } return { filePath: result.path, nextStep: `Apply with your usual Drizzle migrate command:\n ${runnerCommand(detectPackageManager(), 'drizzle-kit migrate')}`, diff --git a/languages/typescript/packages/cli/src/commands/eql/migration.ts b/languages/typescript/packages/cli/src/commands/eql/migration.ts index 8bec470905..bbc9920791 100644 --- a/languages/typescript/packages/cli/src/commands/eql/migration.ts +++ b/languages/typescript/packages/cli/src/commands/eql/migration.ts @@ -1,11 +1,14 @@ import { spawnSync } from 'node:child_process' import { existsSync, unlinkSync, writeFileSync } from 'node:fs' -import { readdir } from 'node:fs/promises' -import { dirname, isAbsolute, join, resolve } from 'node:path' +import { dirname, resolve } from 'node:path' import { MIGRATIONS_SCHEMA_SQL } from '@cipherstash/migrate' import * as p from '@clack/prompts' import { CliExit } from '@/cli/exit.js' import { detectSupabaseProject } from '@/commands/db/detect.js' +import { + findGeneratedMigration, + parseReportedMigrationPath, +} from '@/commands/db/drizzle-migration.js' import { printNextSteps, SAFE_MIGRATION_NAME } from '@/commands/db/install.js' import { rewriteEncryptedAlterColumns } from '@/commands/db/rewrite-migrations.js' import { @@ -35,68 +38,6 @@ import { messages } from '@/messages.js' const DEFAULT_MIGRATION_NAME = 'install-eql' const DEFAULT_DRIZZLE_OUT = 'drizzle' -/** Find the most recently generated Drizzle migration matching the name. */ -export async function findGeneratedMigration( - outDir: string, - migrationName: string, -): Promise { - if (!existsSync(outDir)) { - throw new Error( - `Drizzle output directory not found: ${outDir}\nMake sure drizzle-kit is configured correctly.`, - ) - } - const migrationSuffix = `_${migrationName}.sql` - const matchingFiles = (await readdir(outDir)) - .filter((entry) => entry.endsWith(migrationSuffix)) - .sort() - if (matchingFiles.length === 0) { - throw new Error( - `Could not find a migration matching "${migrationName}" in ${outDir}`, - ) - } - return join(outDir, matchingFiles[matchingFiles.length - 1]) -} - -/** - * Pull the migration path out of drizzle-kit's own success line: - * - * [✓] Your SQL migration file ➜ drizzle/0000_install-eql.sql 🚀 - * - * Since we no longer pass `--out` (drizzle-kit rejects the run when we do — - * see `generateDrizzleEqlMigration`), `drizzle.config.ts` owns the output - * directory and this line is how we learn it. The path is printed relative to - * the cwd drizzle-kit ran in, which is ours. - * - * Returns `undefined` unless the file is actually there, so an unrecognised - * banner or a moved file falls through to the directory scan rather than - * pointing the SQL write at a path that does not exist. - */ -export function parseReportedMigrationPath( - stdout: string | undefined, -): string | undefined { - if (!stdout) return undefined - // Scanned per line, taking everything between the arrow and the LAST `.sql` - // on it, because an output directory may contain spaces — a `\S+` pattern - // truncates such a path, fails the existence check, and drops us into the - // fallback scan of an unrelated directory. - // - // Last line wins: one invocation writes one file, but a wrapper that echoes - // its own banner first should not shadow drizzle-kit's. - let found: string | undefined - for (const line of stdout.split(/\r?\n/)) { - const arrow = line.indexOf('➜') - if (arrow === -1) continue - const rest = line.slice(arrow + 1) - const end = rest.lastIndexOf('.sql') - if (end === -1) continue - const candidate = rest.slice(0, end + '.sql'.length).trim() - if (!candidate) continue - const abs = isAbsolute(candidate) ? candidate : resolve(candidate) - if (existsSync(abs)) found = abs - } - return found -} - /** * Does drizzle-kit's output say `DATABASE_URL` is *absent*, as opposed to * present and wrong? diff --git a/languages/typescript/packages/cli/src/messages.ts b/languages/typescript/packages/cli/src/messages.ts index a6a5776c03..24a6117656 100644 --- a/languages/typescript/packages/cli/src/messages.ts +++ b/languages/typescript/packages/cli/src/messages.ts @@ -175,8 +175,12 @@ export const messages = { * config wins and the user needs to know which one their file landed in — * silently using the real one would leave `--out` looking honoured. */ - migrationDrizzleOutOverridden: (configured: string, requested: string) => - `drizzle-kit wrote into ${configured}, not the --out you passed (${requested}) — the \`out\` in your drizzle.config.ts decides where migrations go, and stash follows it so the journal stays consistent. Change it there if you want them elsewhere.`, + migrationDrizzleOutOverridden: ( + configured: string, + requested: string, + flag = '--out', + ) => + `drizzle-kit wrote into ${configured}, not the ${flag} you passed (${requested}) — the \`out\` in your drizzle.config.ts decides where migrations go, and stash follows it so the journal stays consistent. Change it there if you want them elsewhere.`, /** * `--name` with `--supabase`. The Supabase filename is fixed because * duplicate detection matches on the `_cipherstash_eql.sql` suffix, so the diff --git a/languages/typescript/packages/migrate/CONTEXT.md b/languages/typescript/packages/migrate/CONTEXT.md new file mode 100644 index 0000000000..561ba5d7a9 --- /dev/null +++ b/languages/typescript/packages/migrate/CONTEXT.md @@ -0,0 +1,87 @@ +# Migrate + +Moves an existing column of a customer's database between plaintext and +encrypted form without downtime, tracking every step so an interrupted move can +resume. Used by the `stash encrypt *` and `stash decrypt *` commands and by +customers who embed it in their own workers. + +## Language + +### The move + +**Column migration**: +One direction applied to one column, from the first dual-write confirmation to +the drop of the old column. +_Avoid_: lifecycle, rollout, reverse lifecycle + +**Direction**: +Which way a column migration moves data: **forward** (plaintext to encrypted) or +**reverse** (encrypted to plaintext). +_Avoid_: mode, encrypt/decrypt flow + +**Source column**: +The column a column migration reads from and eventually drops. + +**Target column**: +The column a column migration fills and keeps. + +**Twin**: +The other column of the pair, relative to the column the column migration's +events are recorded against (its source column). It is always the target column: +in the forward direction it is the encrypted column; in the reverse direction it +is the plaintext column. +_Avoid_: plaintext twin, shadow column + +**Phase**: +The recorded stage a column migration is in, such as `dual-writing`, +`backfilling`, `backfilled`, or `dropped`. The reverse direction has its own +phase names: `decrypt-dual-writing`, `decrypting`, `decrypted`, and +`encrypted-dropped`. +_Avoid_: state, status + +**Dual-writing**: +The phase in which the application writes every change to both the source and +target columns. + +**Abort**: +Abandoning a column migration that has not been dropped, leaving the source +column as the column of record. Distinct from a reverse column migration, which +starts only after a forward one is dropped or aborted. `@cipherstash/migrate` +does not provide an abort operation yet. +_Avoid_: rollback, revert + +**Rollout**: +The work before dual-writing is confirmed: adding the target column and +deploying dual-write code. Not a name for the whole column migration. + +### Filling the target + +**Backfill pass**: +One logical sweep that fills the target column from the source column. It may +span several runs through resumes. +_Avoid_: backfill (alone, when the pass is meant), job + +**Run**: +One invocation of a backfill, from the CLI or a worker. A run either starts a +backfill pass or resumes one. +_Avoid_: pass (when one invocation is meant) + +**Forced pass**: +A backfill pass that overwrites values already in the target column instead of +skipping them. + +**Obligation**: +A condition, derived from a column migration's events, that must be met before +a later phase can be entered. An open obligation to complete a forced pass +arises when a forced pass starts, or when a reverse column migration begins on +a twin that already holds values; while it is open, every run is a forced pass. +Events written before #1276 record the up-front choice as +`details.acknowledgedWith` (`force` or `confirm-plaintext-current`). +_Avoid_: acknowledgement, hazard flag + +**Waiver**: +An operator's recorded assertion that a twin's existing values are already +current, which closes the up-front obligation of a reverse column migration +without a forced pass. It cannot close the obligation of a forced pass that has +started. +_Avoid_: confirmation, acknowledgement diff --git a/languages/typescript/packages/migrate/README.md b/languages/typescript/packages/migrate/README.md index 2472acb35f..3c4e852ee2 100644 --- a/languages/typescript/packages/migrate/README.md +++ b/languages/typescript/packages/migrate/README.md @@ -2,9 +2,9 @@ Primitives for safely and resumably migrating existing plaintext columns to concrete EQL v3 `eql_v3_*` domains in production PostgreSQL databases. -The package backs `stash encrypt backfill` and `stash encrypt drop`, and the reverse lifecycle `stash decrypt` uses to move columns back to plaintext. You can also embed `runBackfill()` in a worker or cron job when a large migration should not run inside a CLI process. +The package backs `stash encrypt backfill` and `stash encrypt drop`, and the reverse column migrations that `stash decrypt` runs to move columns back to plaintext. You can also embed `runBackfill()` in a worker or cron job when a large migration should not run inside a CLI process. -## Lifecycle +## Column migration phases ```text schema-added → dual-writing → backfilling → backfilled → dropped @@ -12,7 +12,7 @@ schema-added → dual-writing → backfilling → backfilled → dropped EQL v3 has no configuration table and no rename cut-over. The application switches to the encrypted column by name after backfill, then drops the original plaintext column after verifying coverage. State is tracked in the append-only `cipherstash.cs_migrations` table installed by `stash eql install`. -The reverse lifecycle (`stash decrypt`) runs on the same engine and records its own phases, keyed by the ENCRYPTED column so they never share a timeline with the forward history: +A reverse column migration (`stash decrypt`) runs on the same engine and records its own phases, keyed by the ENCRYPTED column so they never share a timeline with the forward history: ```text decrypt-dual-writing → decrypting → decrypted → encrypted-dropped diff --git a/languages/typescript/packages/migrate/docs/adr/0001-forced-pass-is-an-obligation.md b/languages/typescript/packages/migrate/docs/adr/0001-forced-pass-is-an-obligation.md new file mode 100644 index 0000000000..c4a97cef7e --- /dev/null +++ b/languages/typescript/packages/migrate/docs/adr/0001-forced-pass-is-an-obligation.md @@ -0,0 +1,65 @@ +--- +status: accepted +date: 2026-10-16 +--- + +# A forced pass is an obligation on the column migration, enforced by migrate + +## Decision + +Whether the target column must be overwritten is a fact about the target +column's contents, not about one run. It is therefore held once, on the column +migration, as an obligation derived from the column migration's events. An +obligation opens when a forced pass starts (in either direction) or when a +reverse column migration begins on a twin that already holds values. It closes +only when a forced pass completes, or, for the up-front reverse case, when the +operator records a waiver asserting the existing values are current. A waiver +cannot close the obligation of a forced pass that has already started, because +by then the target column is partly overwritten. While an obligation is open, +every run is a forced pass, whatever the caller passes. `@cipherstash/migrate` +enforces this rule itself, not the `stash` CLI, because customers embed +`runBackfill` and `runDecryptBackfill` in their own workers and would otherwise +bypass it. + +#1193 first enforced an open obligation in the reverse direction, in +`runDecryptBackfill`. #1276 (the first part of #1217) moved the decision into +`ColumnMigration` for both directions. `runBackfill` and `runDecryptBackfill` +plan every run through it, so in both directions it forces a run while an +obligation is open, forces a reverse run that starts on a twin that already +holds values with no waiver recorded, and refuses to start a column migration +while another is open on the same pair. `ColumnMigration.confirmDualWrites` +records the waiver, and refuses it once a forced pass has started. The `stash` +CLI adds the flags (`--force`, `--confirm-plaintext-current`) and its own +messages on top of these rules. + +## Considered options + +- **`force` as a per-run option, checked when resuming** (what was first built + for reverse). An interrupted forced pass that failed before its first + checkpoint left no cursor, so the next plain run started a fresh, unforced + pass. That kept stale values in the twin, and the drop then removed the only + current copy. +- **Refuse unforced runs while a forced pass is incomplete.** This is safe, but + every caller has to remember the flag, and that is how the per-run model came + about. +- **Enforce the rule in the CLI only.** Embedded workers would skip it. + +## Consequences + +- At most one column migration is open per column pair. A reverse column + migration cannot start until the forward one is dropped or aborted. Aborting a + forward column migration is a separate operation, and `@cipherstash/migrate` + does not provide it yet. +- Every backfill event in `cs_migrations` (started, checkpoint, completed and + error) records the pass mode as `details.force`, in both directions. The + dual-write confirmation and drop events do not. The obligation has no events + of its own: `ColumnMigration` derives it from the event trail. A dual-write + confirmation with `details.existingTwinValues` and no `details.waiver` opens + the up-front obligation, and a later confirmation with `details.waiver` + closes it. A forced pass's running events open the forced-pass obligation, + and its completion closes it. Events written before #1276 differ, and + `ColumnMigration` still reads them: they record `force: true` on a forced + pass only, on `backfill_started` alone in the forward direction and on every + event in the reverse direction, and they record the up-front choice as + `details.acknowledgedWith`. The shape of `details` is effectively public, so + changes to it go in a changeset. diff --git a/languages/typescript/packages/nextjs/__tests__/cts-refusal.test.ts b/languages/typescript/packages/nextjs/__tests__/cts-refusal.test.ts index 7091aca00f..e29152eb17 100644 --- a/languages/typescript/packages/nextjs/__tests__/cts-refusal.test.ts +++ b/languages/typescript/packages/nextjs/__tests__/cts-refusal.test.ts @@ -310,13 +310,48 @@ describe('getCtsToken(): the 2xx paths are unchanged', () => { }) }) - it('still rejects on a 2xx whose body is not JSON', async () => { - // Pinned as-is, NOT fixed here: a 200 with an unparseable body throws out of - // `fetchCtsToken` today, and the refusal fix deliberately leaves the 2xx - // path alone. Recorded so a later change to it is a decision rather than an - // accident. + it('reports a 2xx whose body is not JSON as a failure', async () => { + // This used to throw out of `fetchCtsToken`, which in middleware is a 500 + // on every matched route. A success body is now validated like any other + // input crossing into the session cookie. vi.stubGlobal('fetch', ctsResponds(200, 'not json at all')) - await expect(getCtsToken('a-user-jwt')).rejects.toThrow() + const result = await getCtsToken('a-user-jwt') + + expect(result.success).toBe(false) + expect(result.ctsToken).toBeUndefined() + expect(result.error).toContain('200') + }) + + it.each([ + ['an array', '[]'], + ['a missing accessToken', '{"expiry":1900000000}'], + ['an empty accessToken', '{"accessToken":"","expiry":1900000000}'], + ['a string expiry', '{"accessToken":"t","expiry":"1900000000"}'], + ['a non-finite expiry', '{"accessToken":"t","expiry":1e999}'], + ])('reports a 2xx carrying %s as a failure', async (_label, body) => { + vi.stubGlobal('fetch', ctsResponds(200, body, 'application/json')) + + const result = await getCtsToken('a-user-jwt') + + expect(result.success).toBe(false) + expect(result.ctsToken).toBeUndefined() + }) + + it('narrows the success branch to a token', async () => { + vi.stubGlobal('fetch', ctsIssuesToken()) + + const result = await getCtsToken('a-user-jwt') + + // A type-level assertion as much as a runtime one: with \`success\` typed + // \`boolean\` on both arms, \`result.ctsToken\` is \`CtsToken | undefined\` + // here and this does not compile. + if (result.success) { + const token: { accessToken: string; expiry: number } = result.ctsToken + expect(token.accessToken).toBe('cts-token') + } else { + const error: string = result.error + expect.unreachable(error) + } }) }) diff --git a/languages/typescript/packages/nextjs/__tests__/nextjs.test.ts b/languages/typescript/packages/nextjs/__tests__/nextjs.test.ts index ba0099fddb..4f92341c3f 100644 --- a/languages/typescript/packages/nextjs/__tests__/nextjs.test.ts +++ b/languages/typescript/packages/nextjs/__tests__/nextjs.test.ts @@ -14,7 +14,7 @@ * `protectMiddleware` imports it from — mocking the barrel it is re-exported * through would not intercept the call. */ -import { type NextRequest, NextResponse } from 'next/server' +import { NextRequest, NextResponse } from 'next/server' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' vi.mock('next/headers', () => ({ @@ -53,7 +53,9 @@ import { const jwtWithSubject = (sub: string) => [ Buffer.from(JSON.stringify({ alg: 'none' })).toString('base64url'), - Buffer.from(JSON.stringify({ sub })).toString('base64url'), + Buffer.from(JSON.stringify({ iss: 'https://idp.example', sub })).toString( + 'base64url', + ), '', ].join('.') @@ -66,16 +68,11 @@ const requestCookie = (value: string | undefined) => { } /** A `NextRequest` carrying (or not carrying) a CipherStash session cookie. */ -const requestWithSession = (sessionValue?: string) => - ({ - cookies: { - get: vi.fn((name: string) => - name === CS_COOKIE_NAME && sessionValue !== undefined - ? { value: sessionValue } - : undefined, - ), - }, - }) as unknown as NextRequest +const requestWithSession = (sessionValue?: string) => { + const req = new NextRequest('https://app.example/') + if (sessionValue !== undefined) req.cookies.set(CS_COOKIE_NAME, sessionValue) + return req +} beforeEach(() => { vi.mocked(setCtsToken).mockImplementation( @@ -90,7 +87,10 @@ afterEach(() => { describe('getCtsToken', () => { it('returns the parsed token when the session cookie is present', async () => { - const ctsToken: CtsToken = { accessToken: 'fake_token', expiry: 999999 } + const ctsToken: CtsToken = { + accessToken: 'fake_token', + expiry: 1_900_000_000, + } requestCookie(JSON.stringify(ctsToken)) const result = await getCtsToken() @@ -101,6 +101,20 @@ describe('getCtsToken', () => { ) }) + it('still accepts a token that may be undefined', async () => { + // Deprecating the no-argument form must not stop this call compiling. + const ctsToken: CtsToken = { + accessToken: 'fake_token', + expiry: 1_900_000_000, + } + requestCookie(JSON.stringify(ctsToken)) + const noToken = undefined as string | undefined + + const result = await getCtsToken(noToken) + + expect(result).toEqual({ success: true, ctsToken }) + }) + it('reports a failure when there is no cookie and no JWT to exchange', async () => { requestCookie(undefined) @@ -157,14 +171,17 @@ describe('protectMiddleware', () => { await protectMiddleware('a-user-jwt', req) - expect(setCtsToken).toHaveBeenCalledWith('a-user-jwt', undefined) + expect(setCtsToken).toHaveBeenCalledWith('a-user-jwt', undefined, { + clearOnFailure: false, + }) }) it('leaves the session alone when the JWT and session are the same user', async () => { - // The CTS access token's `sub` is the OIDC one prefixed with `CS|`. - const session: CtsToken = { + // The cookie records the OIDC identity the session was minted for. + const session = { accessToken: jwtWithSubject('CS|user-1'), - expiry: 999999, + expiry: 1_900_000_000, + owner: { issuer: 'https://idp.example', subject: 'user-1' }, } const req = requestWithSession(JSON.stringify(session)) const res = NextResponse.next() @@ -176,26 +193,32 @@ describe('protectMiddleware', () => { }) it('re-mints the session when the JWT belongs to a different user', async () => { - const session: CtsToken = { + const session = { accessToken: jwtWithSubject('CS|user-1'), - expiry: 999999, + expiry: 1_900_000_000, + owner: { issuer: 'https://idp.example', subject: 'user-1' }, } const req = requestWithSession(JSON.stringify(session)) const oidcToken = jwtWithSubject('user-2') await protectMiddleware(oidcToken, req) - expect(setCtsToken).toHaveBeenCalledWith(oidcToken, undefined) + expect(setCtsToken).toHaveBeenCalledWith(oidcToken, undefined, { + clearOnFailure: true, + }) }) it('resets the session when no JWT is supplied but a session cookie exists', async () => { - const session: CtsToken = { accessToken: 'whatever', expiry: 999999 } + const session: CtsToken = { + accessToken: 'whatever', + expiry: 1_900_000_000, + } const req = requestWithSession(JSON.stringify(session)) const result = await protectMiddleware('', req) expect(logger.debug).toHaveBeenCalledWith( - 'The JWT token was undefined, so the CipherStash session was reset.', + 'No user is signed in, so the CipherStash session was reset.', ) expect(result.cookies.get(CS_COOKIE_NAME)?.value).toBe('') expect(setCtsToken).not.toHaveBeenCalled() @@ -208,7 +231,7 @@ describe('protectMiddleware', () => { expect(response).toBeInstanceOf(NextResponse) expect(logger.debug).toHaveBeenCalledWith( - 'The JWT token was undefined, so the CipherStash session was not set.', + 'No user is signed in, so the CipherStash session was not set.', ) }) }) diff --git a/languages/typescript/packages/nextjs/__tests__/session-cookie.test.ts b/languages/typescript/packages/nextjs/__tests__/session-cookie.test.ts new file mode 100644 index 0000000000..c214a86f2f --- /dev/null +++ b/languages/typescript/packages/nextjs/__tests__/session-cookie.test.ts @@ -0,0 +1,916 @@ +/** + * The CipherStash session cookie is client-controlled input carrying a bearer + * token. These tests cover three ways it went wrong: + * + * 1. the cookie must be written `httpOnly` and `secure`; + * 2. a session minted for one user must never be handed to another — in the + * Clerk middleware and in `getCtsToken(oidcToken)`; + * 3. a malformed cookie must read as "no session", not throw. + * + * `fetch` is stubbed, so `setCtsToken` / `fetchCtsToken` run for real against a + * fake CTS: the assertions are on the `Set-Cookie` the middleware emits. + */ +import type { ClerkMiddlewareAuth } from '@clerk/nextjs/server' +import { NextRequest, NextResponse } from 'next/server' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' + +vi.mock('next/headers', () => ({ cookies: vi.fn() })) + +vi.mock('../../utils/logger', () => ({ + logger: { debug: vi.fn(), error: vi.fn(), info: vi.fn(), warn: vi.fn() }, +})) + +import { cookies } from 'next/headers' +import { logger } from '../../utils/logger' +import { protectClerkMiddleware } from '../src/clerk' +import { setCtsToken } from '../src/cts' +import { + CS_COOKIE_NAME, + type CtsToken, + getCtsToken, + protectMiddleware, +} from '../src/index' +import { + type CtsSession, + ctsTokenOf, + ownerOfJwt, + readCtsSession, + sessionBelongsTo, +} from '../src/session' + +/** The issuer every test identity comes from unless a test says otherwise. */ +const ISSUER = 'https://idp.example' + +const jwtWithSubject = (sub: unknown) => + [ + Buffer.from(JSON.stringify({ alg: 'none' })).toString('base64url'), + Buffer.from(JSON.stringify({ iss: ISSUER, sub })).toString('base64url'), + '', + ].join('.') + +/** A cookie session as `setCtsToken` writes it for an OIDC subject. */ +const sessionFor = (sub: string): CtsSession => ({ + accessToken: jwtWithSubject(`CS|${sub}`), + expiry: 1_900_000_000, + owner: { issuer: ISSUER, subject: sub }, +}) + +/** Whether the fake CTS minted `token` for the OIDC subject `sub`. */ +const mintedFor = (token: CtsToken | undefined, sub: string) => + token !== undefined && ownerOfJwt(token.accessToken)?.subject === `CS|${sub}` + +/** A fake CTS that mints a token for whichever OIDC subject it is handed. */ +const ctsMintsForCaller = () => + vi.fn(async (_url: string, init: RequestInit) => { + const { oidcToken } = JSON.parse(String(init.body)) + const owner = ownerOfJwt(oidcToken) + const sub = owner?.subject ?? 'unknown' + // The minted token names the caller's issuer too, so a session kept across + // an issuer switch is told apart from the one that replaces it. + const accessToken = [ + Buffer.from(JSON.stringify({ alg: 'none' })).toString('base64url'), + Buffer.from( + JSON.stringify({ iss: owner?.issuer ?? ISSUER, sub: `CS|${sub}` }), + ).toString('base64url'), + '', + ].join('.') + return new Response( + JSON.stringify({ ...ctsTokenOf(sessionFor(sub)), accessToken }), + { + status: 200, + headers: { 'content-type': 'application/json' }, + }, + ) + }) + +const ctsRefuses = () => + vi.fn(async () => new Response('Authorization failed', { status: 401 })) + +const request = (cookie?: string) => { + const req = new NextRequest('https://app.example/dashboard') + if (cookie !== undefined) req.cookies.set(CS_COOKIE_NAME, cookie) + return req +} + +/** The `Set-Cookie` line the response carries for the session cookie, if any. */ +const sessionSetCookie = (res: Response) => + res.headers + .getSetCookie() + .find((line) => line.startsWith(`${CS_COOKIE_NAME}=`)) + +/** The session the response writes, or `null` when it deletes the cookie. */ +const writtenSession = (res: NextResponse) => { + const cookie = res.cookies.get(CS_COOKIE_NAME) + if (!cookie) return undefined + return cookie.value === '' ? null : (JSON.parse(cookie.value) as CtsToken) +} + +const clerkAuth = ( + userId: string | null, + token: string | null, + claims: Record = { iss: ISSUER }, +) => + (async () => ({ + userId, + sessionClaims: userId ? { sub: userId, ...claims } : null, + getToken: vi.fn(async () => token), + })) as unknown as ClerkMiddlewareAuth + +const serverCookie = (value: string | undefined) => { + vi.mocked(cookies).mockResolvedValue({ + get: () => (value === undefined ? undefined : { value }), + // biome-ignore lint/suspicious/noExplicitAny: only `get` is exercised here + } as any) +} + +beforeEach(() => { + process.env.CS_WORKSPACE_CRN = 'crn:ap-southeast-2.aws:test-workspace' + vi.stubGlobal('fetch', ctsMintsForCaller()) +}) + +afterEach(() => { + vi.unstubAllGlobals() + vi.unstubAllEnvs() + vi.clearAllMocks() +}) + +describe('the session cookie attributes', () => { + it('is written httpOnly, SameSite=Lax, on path /', async () => { + const res = await setCtsToken(jwtWithSubject('user-1')) + const line = sessionSetCookie(res) + + expect(line).toBeDefined() + expect(line).toMatch(/;\s*HttpOnly/i) + expect(line).toMatch(/;\s*SameSite=Lax/i) + expect(line).toMatch(/;\s*Path=\//i) + }) + + it.each(['production', 'development', 'test'])( + 'is Secure when NODE_ENV is %s', + async (nodeEnv) => { + vi.stubEnv('NODE_ENV', nodeEnv) + const res = await setCtsToken(jwtWithSubject('user-1')) + + expect(sessionSetCookie(res)).toMatch(/;\s*Secure/i) + }, + ) +}) + +describe('protectClerkMiddleware: a session is only reused for its own user', () => { + it('passes a session minted for the signed-in user through untouched', async () => { + const getToken = vi.fn(async () => jwtWithSubject('user_A')) + const auth = (async () => ({ + userId: 'user_A', + sessionClaims: { iss: ISSUER, sub: 'user_A' }, + getToken, + })) as unknown as ClerkMiddlewareAuth + + const res = await protectClerkMiddleware( + auth, + request(JSON.stringify(sessionFor('user_A'))), + ) + + expect(writtenSession(res)).toBeUndefined() + expect(getToken).not.toHaveBeenCalled() + expect(fetch).not.toHaveBeenCalled() + }) + + it("replaces another user's session with one for the signed-in user", async () => { + const res = await protectClerkMiddleware( + clerkAuth('user_B', jwtWithSubject('user_B')), + request(JSON.stringify(sessionFor('user_A'))), + ) + + const written = writtenSession(res) + expect(written).toBeTruthy() + expect( + sessionBelongsTo(written as CtsSession, { + issuer: ISSUER, + subject: 'user_B', + }), + ).toBe(true) + // The label and the bearer token itself must both be user B's. + expect(mintedFor(written ?? undefined, 'user_B')).toBe(true) + }) + + it("clears another user's session when the replacement cannot be minted", async () => { + vi.stubGlobal('fetch', ctsRefuses()) + + const res = await protectClerkMiddleware( + clerkAuth('user_B', jwtWithSubject('user_B')), + request(JSON.stringify(sessionFor('user_A'))), + ) + + expect(writtenSession(res)).toBeNull() + }) + + it("clears another user's session when Clerk has no token to mint with", async () => { + const res = await protectClerkMiddleware( + clerkAuth('user_B', null), + request(JSON.stringify(sessionFor('user_A'))), + ) + + expect(writtenSession(res)).toBeNull() + }) + + it('mints a session when the user has none', async () => { + const res = await protectClerkMiddleware( + clerkAuth('user_A', jwtWithSubject('user_A')), + request(), + ) + + expect( + sessionBelongsTo(writtenSession(res) as CtsSession, { + issuer: ISSUER, + subject: 'user_A', + }), + ).toBe(true) + }) + + it('clears the session when nobody is signed in', async () => { + const res = await protectClerkMiddleware( + clerkAuth(null, null), + request(JSON.stringify(sessionFor('user_A'))), + ) + + expect(writtenSession(res)).toBeNull() + }) + + it('replaces a malformed session instead of throwing', async () => { + const res = await protectClerkMiddleware( + clerkAuth('user_A', jwtWithSubject('user_A')), + request('not-json'), + ) + + expect( + sessionBelongsTo(writtenSession(res) as CtsSession, { + issuer: ISSUER, + subject: 'user_A', + }), + ).toBe(true) + }) +}) + +describe('getCtsToken(oidcToken): the cookie is only returned for its own user', () => { + it('returns the cookie session when it belongs to the token subject', async () => { + const session = sessionFor('user-1') + serverCookie(JSON.stringify(session)) + + const result = await getCtsToken(jwtWithSubject('user-1')) + + expect(result).toEqual({ success: true, ctsToken: ctsTokenOf(session) }) + expect(fetch).not.toHaveBeenCalled() + }) + + it("fetches a fresh session instead of returning another user's cookie", async () => { + serverCookie(JSON.stringify(sessionFor('user-1'))) + + const result = await getCtsToken(jwtWithSubject('user-2')) + + expect(result.success).toBe(true) + expect(mintedFor(result.ctsToken, 'user-2')).toBe(true) + }) + + it("does not fall back to another user's cookie when CTS refuses", async () => { + vi.stubGlobal('fetch', ctsRefuses()) + serverCookie(JSON.stringify(sessionFor('user-1'))) + + const result = await getCtsToken(jwtWithSubject('user-2')) + + expect(result.success).toBe(false) + expect(result.ctsToken).toBeUndefined() + }) +}) + +describe('a malformed session cookie reads as no session', () => { + const malformed = [ + 'not-json', + '{"accessToken":', + 'null', + '[]', + '"a string"', + '{"accessToken":42,"expiry":1}', + '{"accessToken":"x"}', + '{"accessToken":"","expiry":1}', + ] + + it.each(malformed)('getCtsToken() reports no session for %j', async (raw) => { + serverCookie(raw) + + await expect(getCtsToken()).resolves.toEqual({ + success: false, + error: 'No CipherStash session cookie found in the request.', + }) + }) + + it.each(malformed)( + 'getCtsToken(jwt) fetches a session for %j', + async (raw) => { + serverCookie(raw) + + const result = await getCtsToken(jwtWithSubject('user-1')) + + expect(mintedFor(result.ctsToken, 'user-1')).toBe(true) + }, + ) + + it.each(malformed)('protectMiddleware(jwt) re-mints for %j', async (raw) => { + const res = await protectMiddleware(jwtWithSubject('user-1'), request(raw)) + + expect( + sessionBelongsTo(writtenSession(res) as CtsSession, { + issuer: ISSUER, + subject: 'user-1', + }), + ).toBe(true) + }) + + it.each(malformed)('protectMiddleware() clears %j', async (raw) => { + const res = await protectMiddleware('', request(raw)) + + expect(writtenSession(res)).toBeNull() + }) + + it('protectMiddleware(jwt) re-mints an expired session', async () => { + const res = await protectMiddleware( + jwtWithSubject('user-1'), + request( + JSON.stringify({ + accessToken: 'opaque', + expiry: 1, + owner: { issuer: ISSUER, subject: 'user-1' }, + }), + ), + ) + + expect( + sessionBelongsTo(writtenSession(res) as CtsSession, { + issuer: ISSUER, + subject: 'user-1', + }), + ).toBe(true) + }) + + it('protectMiddleware(jwt) reuses an unexpired session with an opaque access token', async () => { + // Ownership is the recorded owner, so the CTS token's own format is + // irrelevant to reuse. + const res = await protectMiddleware( + jwtWithSubject('user-1'), + request( + JSON.stringify({ + accessToken: 'opaque', + expiry: Math.floor(Date.now() / 1000) + 3600, + owner: { issuer: ISSUER, subject: 'user-1' }, + }), + ), + ) + + expect(writtenSession(res)).toBeUndefined() + expect(fetch).not.toHaveBeenCalled() + }) +}) + +describe('session helpers', () => { + it('reads a well-formed session', () => { + const session = sessionFor('user-1') + expect(readCtsSession(JSON.stringify(session))).toEqual(session) + }) + + it('reads the subject exactly as written, CS| prefix included', () => { + expect(ownerOfJwt(jwtWithSubject('CS|user-1'))).toEqual({ + issuer: ISSUER, + subject: 'CS|user-1', + }) + expect(ownerOfJwt(jwtWithSubject('user-1'))?.subject).toBe('user-1') + }) + + it('reads an expired session as no session', () => { + const session = sessionFor('user-1') + const raw = JSON.stringify(session) + expect(readCtsSession(raw, session.expiry * 1000)).toBeUndefined() + expect(readCtsSession(raw, session.expiry * 1000 - 1)).toEqual(session) + }) + + it('reads a session written before subjects were recorded as unowned', () => { + const legacy = ctsTokenOf(sessionFor('user-1')) + const session = readCtsSession(JSON.stringify(legacy)) as CtsSession + expect(session).toEqual(legacy) + expect( + sessionBelongsTo(session, { issuer: ISSUER, subject: 'user-1' }), + ).toBe(false) + }) + + it('reports no owner for a non-JWT, a missing sub, or a non-string sub', () => { + expect(ownerOfJwt('opaque')).toBeUndefined() + expect(ownerOfJwt(jwtWithSubject(undefined))).toBeUndefined() + expect(ownerOfJwt(jwtWithSubject(42))).toBeUndefined() + expect(ownerOfJwt(jwtWithSubject(''))).toBeUndefined() + }) + + it('reports no owner for a token without an issuer', () => { + const noIssuer = [ + Buffer.from(JSON.stringify({ alg: 'none' })).toString('base64url'), + Buffer.from(JSON.stringify({ sub: 'user-1' })).toString('base64url'), + '', + ].join('.') + expect(ownerOfJwt(noIssuer)).toBeUndefined() + }) + + it('never matches when either subject is unknown', () => { + const subjectless = ctsTokenOf(sessionFor('user-1')) + expect(sessionBelongsTo(subjectless, undefined)).toBe(false) + expect(sessionBelongsTo(sessionFor('user-1'), undefined)).toBe(false) + expect( + sessionBelongsTo(subjectless, { issuer: ISSUER, subject: 'user-1' }), + ).toBe(false) + }) +}) + +describe('review follow-ups', () => { + /** A CTS whose access-token `sub` is its own principal id, not the IdP one. */ + const ctsMintsOpaquePrincipal = () => + vi.fn( + async () => + new Response( + JSON.stringify({ + accessToken: jwtWithSubject('CS|3f1c2a9e-principal'), + expiry: 1_900_000_000, + }), + { status: 200, headers: { 'content-type': 'application/json' } }, + ), + ) + + it('reuses a Clerk session without depending on the CTS subject format', async () => { + vi.stubGlobal('fetch', ctsMintsOpaquePrincipal()) + const first = await protectClerkMiddleware( + clerkAuth('user_A', jwtWithSubject('user_A')), + request(), + ) + const cookie = first.cookies.get(CS_COOKIE_NAME)?.value as string + vi.mocked(fetch).mockClear() + + const second = await protectClerkMiddleware( + clerkAuth('user_A', jwtWithSubject('user_A')), + request(cookie), + ) + + expect(fetch).not.toHaveBeenCalled() + expect(writtenSession(second)).toBeUndefined() + }) + + it('does not treat a CS|-prefixed IdP subject as the unprefixed user', async () => { + // Minted for IdP subject `alice`; a different user whose IdP subject is + // literally `CS|alice` must not be handed it. + const minted = await setCtsToken(jwtWithSubject('alice')) + const cookie = minted.cookies.get(CS_COOKIE_NAME)?.value as string + vi.mocked(fetch).mockClear() + + const res = await protectMiddleware( + jwtWithSubject('CS|alice'), + request(cookie), + ) + + expect(fetch).toHaveBeenCalledTimes(1) + expect(writtenSession(res)).toBeTruthy() + }) + + it('re-mints an expired session instead of passing it through', async () => { + const expired = { + ...sessionFor('user_A'), + expiry: Math.floor(Date.now() / 1000) - 60, + } + + const res = await protectClerkMiddleware( + clerkAuth('user_A', jwtWithSubject('user_A')), + request(JSON.stringify(expired)), + ) + + expect(fetch).toHaveBeenCalledTimes(1) + expect(writtenSession(res)).toBeTruthy() + }) + + it('emits no cookie deletion when a mint fails and there was no cookie', async () => { + vi.stubGlobal('fetch', ctsRefuses()) + + const res = await protectClerkMiddleware( + clerkAuth('user_A', jwtWithSubject('user_A')), + request(), + ) + + expect(sessionSetCookie(res)).toBeUndefined() + }) +}) + +describe('issuer-aware ownership', () => { + const jwtFrom = (iss: string | undefined, sub: string) => + [ + Buffer.from(JSON.stringify({ alg: 'none' })).toString('base64url'), + Buffer.from(JSON.stringify({ iss, sub })).toString('base64url'), + '', + ].join('.') + + /** The issuer of the bearer token the response writes, and of its owner. */ + const issuerOfWritten = (res: NextResponse) => { + const raw = res.cookies.get(CS_COOKIE_NAME)?.value + const session = readCtsSession(raw) + return { + token: session && ownerOfJwt(session.accessToken)?.issuer, + owner: session?.owner?.issuer, + } + } + + it('does not reuse a session for the same sub from a different issuer', async () => { + const minted = await setCtsToken(jwtFrom('https://idp-a.example', 'alice')) + const cookie = minted.cookies.get(CS_COOKIE_NAME)?.value as string + vi.mocked(fetch).mockClear() + + const res = await protectMiddleware( + jwtFrom('https://idp-b.example', 'alice'), + request(cookie), + ) + + expect(fetch).toHaveBeenCalledTimes(1) + expect(issuerOfWritten(res)).toEqual({ + token: 'https://idp-b.example', + owner: 'https://idp-b.example', + }) + }) + + it('reuses a session for the same issuer and sub', async () => { + const minted = await setCtsToken(jwtFrom('https://idp-a.example', 'alice')) + const cookie = minted.cookies.get(CS_COOKIE_NAME)?.value as string + vi.mocked(fetch).mockClear() + + const res = await protectMiddleware( + jwtFrom('https://idp-a.example', 'alice'), + request(cookie), + ) + + expect(fetch).not.toHaveBeenCalled() + expect(writtenSession(res)).toBeUndefined() + }) + + it('does not reuse a Clerk session minted by a different issuer', async () => { + const minted = await setCtsToken(jwtFrom('https://other.example', 'user_A')) + const cookie = minted.cookies.get(CS_COOKIE_NAME)?.value as string + vi.mocked(fetch).mockClear() + + const res = await protectClerkMiddleware( + clerkAuth('user_A', jwtFrom('https://clerk.app.example', 'user_A'), { + iss: 'https://clerk.app.example', + }), + request(cookie), + ) + + expect(fetch).toHaveBeenCalledTimes(1) + expect(issuerOfWritten(res)).toEqual({ + token: 'https://clerk.app.example', + owner: 'https://clerk.app.example', + }) + }) +}) + +describe('the request seen by downstream handlers', () => { + /** The cookies Next forwards to route handlers for this request, if overridden. */ + const forwardedCookies = (res: Response) => { + const override = res.headers.get('x-middleware-override-headers') + if (override === null) return undefined + // A request header left out of the override list is deleted. + if ( + !override + .split(',') + .map((key) => key.trim()) + .includes('cookie') + ) { + return {} as Record + } + const header = res.headers.get('x-middleware-request-cookie') ?? '' + return Object.fromEntries( + header + .split(';') + .map((pair) => pair.trim()) + .filter(Boolean) + .map((pair) => { + const at = pair.indexOf('=') + return [pair.slice(0, at), decodeURIComponent(pair.slice(at + 1))] + }), + ) as Record + } + + const requestWith = (cookies: Record) => { + const req = new NextRequest('https://app.example/dashboard', { + headers: { 'x-trace': 'abc' }, + }) + for (const [name, value] of Object.entries(cookies)) { + req.cookies.set(name, value) + } + return req + } + + it("forwards the new session, not the previous user's, after a switch", async () => { + const previous = JSON.stringify(sessionFor('user_A')) + + const res = await protectClerkMiddleware( + clerkAuth('user_B', jwtWithSubject('user_B')), + requestWith({ [CS_COOKIE_NAME]: previous, theme: 'dark' }), + ) + + const forwarded = forwardedCookies(res) + expect(forwarded).toBeDefined() + expect(forwarded?.[CS_COOKIE_NAME]).not.toBe(previous) + expect( + sessionBelongsTo( + readCtsSession(forwarded?.[CS_COOKIE_NAME]) as CtsSession, + { issuer: ISSUER, subject: 'user_B' }, + ), + ).toBe(true) + expect(forwarded?.theme).toBe('dark') + // Overriding request headers replaces the whole set, so the rest must be + // carried across untouched. + expect(res.headers.get('x-middleware-request-x-trace')).toBe('abc') + }) + + it('forwards no session after a sign-out', async () => { + const res = await protectClerkMiddleware( + clerkAuth(null, null), + requestWith({ + [CS_COOKIE_NAME]: JSON.stringify(sessionFor('user_A')), + theme: 'dark', + }), + ) + + const forwarded = forwardedCookies(res) + expect(forwarded).toBeDefined() + expect(forwarded?.[CS_COOKIE_NAME]).toBeUndefined() + expect(forwarded?.theme).toBe('dark') + }) + + it("forwards no session when another user's cannot be replaced", async () => { + vi.stubGlobal('fetch', ctsRefuses()) + + const res = await protectClerkMiddleware( + clerkAuth('user_B', jwtWithSubject('user_B')), + requestWith({ [CS_COOKIE_NAME]: JSON.stringify(sessionFor('user_A')) }), + ) + + expect(forwardedCookies(res)?.[CS_COOKIE_NAME]).toBeUndefined() + expect(forwardedCookies(res)).toBeDefined() + }) + + it('leaves the request alone when the session is kept', async () => { + const res = await protectClerkMiddleware( + clerkAuth('user_A', jwtWithSubject('user_A')), + requestWith({ [CS_COOKIE_NAME]: JSON.stringify(sessionFor('user_A')) }), + ) + + expect(res.headers.get('x-middleware-override-headers')).toBeNull() + }) + + it("keeps a caller's own request header overrides when forwarding", async () => { + const headers = new Headers({ 'x-tenant': 't1' }) + const callerRes = NextResponse.next({ request: { headers } }) + + const res = await protectMiddleware( + jwtWithSubject('user-2'), + requestWith({ [CS_COOKIE_NAME]: JSON.stringify(sessionFor('user-1')) }), + callerRes, + ) + + const keys = (res.headers.get('x-middleware-override-headers') ?? '').split( + ',', + ) + expect(keys).toContain('x-tenant') + expect(keys).toContain('cookie') + expect(res.headers.get('x-middleware-request-x-tenant')).toBe('t1') + expect( + sessionBelongsTo( + readCtsSession(forwardedCookies(res)?.[CS_COOKIE_NAME]) as CtsSession, + { issuer: ISSUER, subject: 'user-2' }, + ), + ).toBe(true) + }) + + it("does not forward another user's session from a caller's cookie override", async () => { + // The caller's response already overrides the forwarded cookie with a + // session for someone else. The middleware keeps the request's own session, + // so that is the one downstream handlers must see. + const own = JSON.stringify(sessionFor('user_A')) + const other = JSON.stringify(sessionFor('user_B')) + const callerRes = NextResponse.next({ + request: { + headers: new Headers({ + cookie: `${CS_COOKIE_NAME}=${encodeURIComponent(other)}; theme=dark`, + }), + }, + }) + + const res = await protectMiddleware( + jwtWithSubject('user_A'), + requestWith({ [CS_COOKIE_NAME]: own }), + callerRes, + ) + + expect(writtenSession(res)).toBeUndefined() + expect(forwardedCookies(res)?.[CS_COOKIE_NAME]).toBe(own) + expect(forwardedCookies(res)?.theme).toBe('dark') + }) + + it("forwards no session from a caller's cookie override when signed out", async () => { + const callerRes = NextResponse.next({ + request: { + headers: new Headers({ + cookie: `${CS_COOKIE_NAME}=${encodeURIComponent(JSON.stringify(sessionFor('user_B')))}`, + }), + }, + }) + + const res = await protectMiddleware('', requestWith({}), callerRes) + + expect(forwardedCookies(res)).toBeDefined() + expect(forwardedCookies(res)?.[CS_COOKIE_NAME]).toBeUndefined() + }) + + it("forwards the kept session through a caller's override that leaves out the cookie", async () => { + // An override list replaces the forwarded request headers, so one that + // does not name `cookie` would drop the session the middleware accepted. + const own = JSON.stringify(sessionFor('user_A')) + const callerRes = NextResponse.next({ + request: { headers: new Headers({ 'x-tenant': 't1' }) }, + }) + + const res = await protectMiddleware( + jwtWithSubject('user_A'), + requestWith({ [CS_COOKIE_NAME]: own }), + callerRes, + ) + + expect(writtenSession(res)).toBeUndefined() + expect(forwardedCookies(res)?.[CS_COOKIE_NAME]).toBe(own) + expect(res.headers.get('x-middleware-request-x-tenant')).toBe('t1') + }) + + it("replaces a session cookie the caller's response already sets with the kept one", async () => { + const own = JSON.stringify(sessionFor('user_A')) + const callerRes = NextResponse.next() + callerRes.cookies.set(CS_COOKIE_NAME, JSON.stringify(sessionFor('user_B'))) + + const res = await protectMiddleware( + jwtWithSubject('user_A'), + requestWith({ [CS_COOKIE_NAME]: own }), + callerRes, + ) + + const owner = { issuer: ISSUER, subject: 'user_A' } + expect(sessionBelongsTo(writtenSession(res) as CtsSession, owner)).toBe( + true, + ) + expect( + sessionBelongsTo( + readCtsSession(forwardedCookies(res)?.[CS_COOKIE_NAME]) as CtsSession, + owner, + ), + ).toBe(true) + }) + + it("clears a session cookie the caller's response sets when no session is kept", async () => { + vi.stubGlobal('fetch', ctsRefuses()) + const callerRes = NextResponse.next() + callerRes.cookies.set(CS_COOKIE_NAME, JSON.stringify(sessionFor('user_B'))) + + const res = await protectMiddleware( + jwtWithSubject('user_A'), + requestWith({}), + callerRes, + ) + + expect(writtenSession(res)).toBeNull() + expect(forwardedCookies(res)?.[CS_COOKIE_NAME]).toBeUndefined() + }) + + it('leaves a redirect without request overrides, even when the session changes', async () => { + // A redirect goes straight back to the browser, so there is no forwarded + // request to update and no request header may be copied onto it. + const callerRes = NextResponse.redirect('https://app.example/sign-in') + + const res = await protectMiddleware( + '', + requestWith({ [CS_COOKIE_NAME]: JSON.stringify(sessionFor('user_A')) }), + callerRes, + ) + + expect(writtenSession(res)).toBeNull() + const copied: string[] = [] + res.headers.forEach((_value, key) => { + if (key.startsWith('x-middleware-request-')) copied.push(key) + }) + expect(copied).toEqual([]) + expect(res.headers.get('x-middleware-override-headers')).toBeNull() + }) +}) + +describe('clearing through an override that only names the cookie', () => { + it('keeps the override list non-empty so the old session is not forwarded', async () => { + // Next.js ignores an empty `x-middleware-override-headers`, which would let + // the original request cookie (the previous session) through untouched. + const session = JSON.stringify(sessionFor('user_A')) + const req = request(session) + const callerRes = NextResponse.next({ + request: { + headers: new Headers({ + cookie: `${CS_COOKIE_NAME}=${encodeURIComponent(session)}`, + }), + }, + }) + + const res = await protectMiddleware('', req, callerRes) + + expect(res.headers.get('x-middleware-override-headers')).toBe('cookie') + expect(res.headers.get('x-middleware-request-cookie')).toBe('') + }) +}) + +describe('a CTS transport failure', () => { + it("clears another user's session instead of throwing", async () => { + vi.stubGlobal( + 'fetch', + vi.fn(async () => { + throw new TypeError('fetch failed') + }), + ) + + const res = await protectClerkMiddleware( + clerkAuth('user_B', jwtWithSubject('user_B')), + request(JSON.stringify(sessionFor('user_A'))), + ) + + expect(writtenSession(res)).toBeNull() + }) + + it('is reported by getCtsToken as a failure', async () => { + vi.stubGlobal( + 'fetch', + vi.fn(async () => { + throw new TypeError('fetch failed') + }), + ) + serverCookie(undefined) + + const result = await getCtsToken(jwtWithSubject('user-1')) + + expect(result.success).toBe(false) + }) + + it('keeps the exception text out of the error and the log', async () => { + const oidcToken = jwtWithSubject('user-1') + vi.stubGlobal( + 'fetch', + vi.fn(async (_url: string, init: RequestInit) => { + // A fetch wrapper may echo the request body, OIDC token included. + throw new Error(`request failed: ${String(init.body)}`) + }), + ) + serverCookie(undefined) + + const result = await getCtsToken(oidcToken) + + expect(result.success).toBe(false) + expect(result.error).not.toContain(oidcToken) + const logged = vi.mocked(logger.error).mock.calls + expect(logged).toEqual([ + [ + 'There was an issue communicating with the CipherStash CTS API, the CipherStash session was not set. Failed to fetch CTS token: the CipherStash API could not be reached.', + ], + ]) + }) +}) + +describe('an expired token from CTS', () => { + const ctsMintsExpired = () => + vi.fn( + async () => + new Response( + JSON.stringify({ accessToken: 'expired-token', expiry: 1 }), + { status: 200, headers: { 'content-type': 'application/json' } }, + ), + ) + + it('is reported by getCtsToken as a failure', async () => { + vi.stubGlobal('fetch', ctsMintsExpired()) + serverCookie(undefined) + + const result = await getCtsToken(jwtWithSubject('user-1')) + + expect(result.success).toBe(false) + }) + + it('is not written, and the stale session is cleared', async () => { + vi.stubGlobal('fetch', ctsMintsExpired()) + + const res = await protectMiddleware( + jwtWithSubject('user-2'), + request(JSON.stringify(sessionFor('user-1'))), + ) + + expect(writtenSession(res)).toBeNull() + }) +}) diff --git a/languages/typescript/packages/nextjs/__tests__/session-forwarding.test.ts b/languages/typescript/packages/nextjs/__tests__/session-forwarding.test.ts new file mode 100644 index 0000000000..71f52b22a0 --- /dev/null +++ b/languages/typescript/packages/nextjs/__tests__/session-forwarding.test.ts @@ -0,0 +1,163 @@ +/** + * A rewrite continues the request just as `NextResponse.next()` does, so the + * route it lands on must see the session the middleware decided on, not the + * one the request arrived with. + * + * `fetch` is stubbed, so the session is minted for real against a fake CTS. The + * forwarded request is read the way Next.js reads it: the headers named by + * `x-middleware-override-headers`, each from its `x-middleware-request-`. + */ +import { NextRequest, NextResponse } from 'next/server' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' + +vi.mock('next/headers', () => ({ cookies: vi.fn() })) + +vi.mock('../../utils/logger', () => ({ + logger: { debug: vi.fn(), error: vi.fn(), info: vi.fn(), warn: vi.fn() }, +})) + +import { CS_COOKIE_NAME, protectMiddleware } from '../src/index' + +const ISSUER = 'https://idp.example' +const REWRITE_TARGET = 'https://app.example/rewritten' + +const inAnHour = () => Math.floor(Date.now() / 1000) + 3600 + +const encodeSegment = (value: unknown) => + Buffer.from(JSON.stringify(value)).toString('base64url') + +const jwtFor = (sub: string) => + [ + encodeSegment({ alg: 'none' }), + encodeSegment({ iss: ISSUER, sub }), + '', + ].join('.') + +const accessTokenFor = (sub: string) => `token-for-${sub}` + +const sessionCookieFor = (sub: string) => + JSON.stringify({ + accessToken: accessTokenFor(sub), + expiry: inAnHour(), + owner: { issuer: ISSUER, subject: sub }, + }) + +/** A fake CTS that mints a token naming whichever OIDC subject it is handed. */ +const ctsMintsForCaller = () => + vi.fn(async (_url: string, init: RequestInit) => { + const { oidcToken } = JSON.parse(String(init.body)) as { oidcToken: string } + const { sub } = JSON.parse( + Buffer.from(oidcToken.split('.')[1], 'base64url').toString(), + ) as { sub: string } + return new Response( + JSON.stringify({ accessToken: accessTokenFor(sub), expiry: inAnHour() }), + { status: 200, headers: { 'content-type': 'application/json' } }, + ) + }) + +/** A request signed in as `user_A`, with another cookie and header to carry. */ +const requestFromUserA = () => { + const req = new NextRequest('https://app.example/dashboard', { + headers: { 'x-trace': 'abc' }, + }) + req.cookies.set(CS_COOKIE_NAME, sessionCookieFor('user_A')) + req.cookies.set('theme', 'dark') + return req +} + +/** + * The headers of the request the rewritten route receives. With no override + * Next.js forwards `original` as it arrived; with one, only the listed headers + * survive, each taken from its `x-middleware-request-` header. + */ +const forwardedHeaders = (res: Response, original: NextRequest) => { + const override = res.headers.get('x-middleware-override-headers') + if (override === null) return new Headers(original.headers) + + const forwarded = new Headers() + for (const name of override.split(',').map((key) => key.trim())) { + const value = res.headers.get(`x-middleware-request-${name}`) + if (value) forwarded.set(name, value) + } + return forwarded +} + +/** One cookie's decoded value from a `cookie` request header. */ +const cookieIn = (headers: Headers, name: string) => { + for (const pair of (headers.get('cookie') ?? '').split(';')) { + const trimmed = pair.trim() + const at = trimmed.indexOf('=') + if (at > 0 && trimmed.slice(0, at) === name) { + return decodeURIComponent(trimmed.slice(at + 1)) + } + } + return undefined +} + +/** The access token in the forwarded session cookie, if there is one. */ +const forwardedAccessToken = (headers: Headers) => { + const session = cookieIn(headers, CS_COOKIE_NAME) + return session === undefined + ? undefined + : (JSON.parse(session) as { accessToken: string }).accessToken +} + +beforeEach(() => { + vi.stubEnv('CS_WORKSPACE_CRN', 'crn:ap-southeast-2.aws:test-workspace') + vi.stubGlobal('fetch', ctsMintsForCaller()) +}) + +afterEach(() => { + vi.unstubAllGlobals() + vi.unstubAllEnvs() + vi.clearAllMocks() +}) + +describe('forwarding the session through a rewrite', () => { + it('gives the rewritten route the new session after a user switch', async () => { + const req = requestFromUserA() + + const res = await protectMiddleware( + jwtFor('user_B'), + req, + NextResponse.rewrite(REWRITE_TARGET), + ) + + expect(res.headers.get('x-middleware-rewrite')).toBe(REWRITE_TARGET) + const forwarded = forwardedHeaders(res, req) + expect(forwardedAccessToken(forwarded)).toBe(accessTokenFor('user_B')) + expect(cookieIn(forwarded, 'theme')).toBe('dark') + expect(forwarded.get('x-trace')).toBe('abc') + }) + + it('gives the rewritten route no session after a sign-out', async () => { + const req = requestFromUserA() + + const res = await protectMiddleware( + '', + req, + NextResponse.rewrite(REWRITE_TARGET), + ) + + expect(res.headers.get('x-middleware-rewrite')).toBe(REWRITE_TARGET) + const forwarded = forwardedHeaders(res, req) + expect(forwardedAccessToken(forwarded)).toBeUndefined() + expect(cookieIn(forwarded, 'theme')).toBe('dark') + expect(forwarded.get('x-trace')).toBe('abc') + }) + + it('leaves a rewrite without request overrides when the session is kept', async () => { + const req = requestFromUserA() + + const res = await protectMiddleware( + jwtFor('user_A'), + req, + NextResponse.rewrite(REWRITE_TARGET), + ) + + expect(res.headers.get('x-middleware-override-headers')).toBeNull() + expect(forwardedAccessToken(forwardedHeaders(res, req))).toBe( + accessTokenFor('user_A'), + ) + }) +}) diff --git a/languages/typescript/packages/nextjs/__tests__/session-sync-edge-cases.test.ts b/languages/typescript/packages/nextjs/__tests__/session-sync-edge-cases.test.ts new file mode 100644 index 0000000000..0906aaf6ee --- /dev/null +++ b/languages/typescript/packages/nextjs/__tests__/session-sync-edge-cases.test.ts @@ -0,0 +1,158 @@ +/** + * Edge cases of the session decision `syncCtsSession` makes: a Clerk session + * with no `iss`, a Clerk `getToken` that rejects, and a caller's session cookie + * that happens to equal the session this request minted. + * + * `fetch` is stubbed, so minting runs for real against a fake CTS. + */ +import type { ClerkMiddlewareAuth } from '@clerk/nextjs/server' +import { NextRequest, NextResponse } from 'next/server' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' + +vi.mock('next/headers', () => ({ cookies: vi.fn() })) + +vi.mock('../../utils/logger', () => ({ + logger: { debug: vi.fn(), error: vi.fn(), info: vi.fn(), warn: vi.fn() }, +})) + +import { protectClerkMiddleware } from '../src/clerk' +import { setCtsToken } from '../src/cts' +import { CS_COOKIE_NAME, protectMiddleware } from '../src/index' + +const ISSUER = 'https://idp.example' +const EXPIRY = 1_900_000_000 + +const jwtFor = (sub: string, iss: string = ISSUER) => + [ + Buffer.from(JSON.stringify({ alg: 'none' })).toString('base64url'), + Buffer.from(JSON.stringify({ iss, sub })).toString('base64url'), + '', + ].join('.') + +const sessionValue = (sub: string) => + JSON.stringify({ + accessToken: jwtFor(`CS|${sub}`), + expiry: EXPIRY, + owner: { issuer: ISSUER, subject: sub }, + }) + +/** A fake CTS that answers every request with the same token. */ +const ctsMintsTheSameToken = () => + vi.fn( + async () => + new Response( + JSON.stringify({ accessToken: jwtFor('CS|user_A'), expiry: EXPIRY }), + { status: 200, headers: { 'content-type': 'application/json' } }, + ), + ) + +const request = (cookie?: string) => { + const req = new NextRequest('https://app.example/dashboard') + if (cookie !== undefined) req.cookies.set(CS_COOKIE_NAME, cookie) + return req +} + +const clerkAuth = ( + userId: string, + claims: Record, + getToken: () => Promise, +) => + (async () => ({ + userId, + sessionClaims: { sub: userId, ...claims }, + getToken, + })) as unknown as ClerkMiddlewareAuth + +/** The middleware's outcome, with a rejection returned rather than thrown. */ +const outcomeOf = (result: Promise) => + result.catch((error: unknown) => error) + +beforeEach(() => { + process.env.CS_WORKSPACE_CRN = 'crn:ap-southeast-2.aws:test-workspace' + vi.stubGlobal('fetch', ctsMintsTheSameToken()) +}) + +afterEach(() => { + vi.unstubAllGlobals() + vi.unstubAllEnvs() + vi.clearAllMocks() +}) + +describe('protectClerkMiddleware when the Clerk session has no issuer', () => { + const noIssuer = () => clerkAuth('user_A', {}, async () => jwtFor('user_A')) + + it('mints on every request instead of reusing a session', async () => { + const cookie = sessionValue('user_A') + + await protectClerkMiddleware(noIssuer(), request(cookie)) + await protectClerkMiddleware(noIssuer(), request(cookie)) + + expect(fetch).toHaveBeenCalledTimes(2) + }) + + it('clears the cookie when the mint fails', async () => { + vi.stubGlobal( + 'fetch', + vi.fn(async () => new Response('unavailable', { status: 500 })), + ) + + const res = await protectClerkMiddleware( + noIssuer(), + request(sessionValue('user_A')), + ) + + expect(res.cookies.get(CS_COOKIE_NAME)?.value).toBe('') + }) +}) + +describe('protectClerkMiddleware when Clerk cannot produce a token', () => { + const getTokenRejects = async () => { + throw new Error('Clerk could not issue a token') + } + + it('clears a stale session instead of failing the request', async () => { + const outcome = await outcomeOf( + protectClerkMiddleware( + clerkAuth('user_A', { iss: ISSUER }, getTokenRejects), + request(sessionValue('user_B')), + ), + ) + + expect(outcome).toBeInstanceOf(NextResponse) + expect((outcome as NextResponse).cookies.get(CS_COOKIE_NAME)?.value).toBe( + '', + ) + expect(fetch).not.toHaveBeenCalled() + }) + + it('passes the request through when there is no session to clear', async () => { + const outcome = await outcomeOf( + protectClerkMiddleware( + clerkAuth('user_A', { iss: ISSUER }, getTokenRejects), + request(), + ), + ) + + expect(outcome).toBeInstanceOf(NextResponse) + expect( + (outcome as NextResponse).cookies.get(CS_COOKIE_NAME), + ).toBeUndefined() + }) +}) + +describe('a session cookie set by the caller', () => { + it('does not clear a freshly minted session that equals it', async () => { + const oidcToken = jwtFor('user_A') + const minted = (await setCtsToken(oidcToken)).cookies.get(CS_COOKIE_NAME) + ?.value as string + vi.mocked(fetch).mockClear() + + const callerRes = NextResponse.next() + callerRes.cookies.set(CS_COOKIE_NAME, minted) + + const res = await protectMiddleware(oidcToken, request(), callerRes) + + expect(fetch).toHaveBeenCalledTimes(1) + expect(res.cookies.get(CS_COOKIE_NAME)?.value).toBe(minted) + }) +}) diff --git a/languages/typescript/packages/nextjs/package.json b/languages/typescript/packages/nextjs/package.json index a1c6f4817c..1e112baad6 100644 --- a/languages/typescript/packages/nextjs/package.json +++ b/languages/typescript/packages/nextjs/package.json @@ -53,9 +53,9 @@ "access": "public" }, "optionalDependencies": { - "@rollup/rollup-linux-x64-gnu": "4.64.5" + "@rollup/rollup-linux-x64-gnu": "4.67.4" }, "dependencies": { - "jose": "^6.2.12" + "jose": "^6.2.14" } } diff --git a/languages/typescript/packages/nextjs/src/clerk/index.ts b/languages/typescript/packages/nextjs/src/clerk/index.ts index a48dfb532e..ec9464013a 100644 --- a/languages/typescript/packages/nextjs/src/clerk/index.ts +++ b/languages/typescript/packages/nextjs/src/clerk/index.ts @@ -1,42 +1,35 @@ import type { ClerkMiddlewareAuth } from '@clerk/nextjs/server' import type { NextRequest } from 'next/server' -import { NextResponse } from 'next/server' -import { logger } from '../../../utils/logger' -import { setCtsToken } from '../cts' -import { CS_COOKIE_NAME, resetCtsToken } from '../index' - +import { nonEmptyString } from '../session' +import { syncCtsSession } from '../sync' + +/** + * Keep the CipherStash session cookie in step with the signed-in Clerk user. + * + * A session is only reused for the Clerk user it was minted for. One left + * behind by another user (a multi-session `setActive` switch, or a sign-out on + * a route the matcher does not cover) is replaced, or cleared if a new one + * cannot be minted. When nobody is signed in, the cookie is cleared. + */ export const protectClerkMiddleware = async ( auth: ClerkMiddlewareAuth, req: NextRequest, ) => { - const { userId, getToken } = await auth() - const ctsSession = req.cookies.has(CS_COOKIE_NAME) - - if (userId && !ctsSession) { - const oidcToken = await getToken() - - if (!oidcToken) { - logger.debug( - 'No Clerk token found in the request, so the CipherStash session was not set.', - ) - - return NextResponse.next() - } - - return await setCtsToken(oidcToken) - } - - if (!userId && ctsSession) { - logger.debug( - 'No Clerk token found in the request, so the CipherStash session was reset.', - ) - - return resetCtsToken() - } - - logger.debug( - 'No Clerk token found in the request, so the CipherStash session was not set.', + const { userId, sessionClaims, getToken } = await auth() + const issuer = sessionClaims?.iss + + // `userId` and `sessionClaims` come from the Clerk session token Clerk has + // already verified, and are the `sub` and `iss` of the token `getToken()` + // returns, which is what a session is labelled with when minted. + return await syncCtsSession( + req, + userId + ? { + owner: nonEmptyString(issuer) + ? { issuer, subject: userId } + : undefined, + getOidcToken: () => getToken(), + } + : undefined, ) - - return NextResponse.next() } diff --git a/languages/typescript/packages/nextjs/src/cts/index.ts b/languages/typescript/packages/nextjs/src/cts/index.ts index 6d54903d1c..f33004eacf 100644 --- a/languages/typescript/packages/nextjs/src/cts/index.ts +++ b/languages/typescript/packages/nextjs/src/cts/index.ts @@ -1,10 +1,13 @@ import { NextResponse } from 'next/server' import { logger } from '../../../utils/logger' +import type { GetCtsTokenResponse } from '../index' import { - CS_COOKIE_NAME, - type CtsToken, - type GetCtsTokenResponse, -} from '../index' + clearCtsSession, + isExpired, + ownerOfJwt, + parseCtsToken, + writeCtsSession, +} from '../session' /** * How much of an error body to quote back. A refusal is one sentence; a gateway @@ -147,6 +150,13 @@ function extractWorkspaceIdFromCrn(crn: string): string { return match[1] } +/** + * The workspace ID to mint sessions for, read from `suppliedCrn` or else the + * `CS_WORKSPACE_CRN` environment variable. + * + * @throws When neither is set, or the CRN is not of the form + * `crn::`. + */ export function loadWorkSpaceId(suppliedCrn?: string): string { if (suppliedCrn) { return extractWorkspaceIdFromCrn(suppliedCrn) @@ -161,7 +171,14 @@ export function loadWorkSpaceId(suppliedCrn?: string): string { return extractWorkspaceIdFromCrn(process.env.CS_WORKSPACE_CRN) } -// Can be used independently of the Next.js middleware +/** + * Exchange `oidcToken` for a CTS session token through CTS `/api/authorize`. + * Writes no cookie, so it can be used outside the Next.js middleware. + * + * Never throws for a CTS refusal, an unreachable CTS, or a success body that is + * not an unexpired token: each is returned as `{ success: false }`, with + * `authCode` set when CTS attached a refusal code. + */ export const fetchCtsToken = async (oidcToken: string): GetCtsTokenResponse => { const workspaceId = loadWorkSpaceId() @@ -180,16 +197,30 @@ export const fetchCtsToken = async (oidcToken: string): GetCtsTokenResponse => { process.env.CS_CTS_ENDPOINT || 'https://ap-southeast-2.aws.auth.viturhosted.net' - const ctsResponse = await fetch(`${ctsEndoint}/api/authorize`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - workspaceId, - oidcToken, - }), - }) + let ctsResponse: Response + try { + ctsResponse = await fetch(`${ctsEndoint}/api/authorize`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + workspaceId, + oidcToken, + }), + }) + } catch { + // A transport failure (DNS, TLS, reset) rejects rather than resolving. It + // is reported like a refusal, so the middleware's cleanup still runs and a + // request is not turned into a 500. The exception is not repeated: a fetch + // wrapper may put the request, OIDC token included, into its message. + const error = + 'Failed to fetch CTS token: the CipherStash API could not be reached.' + logger.error( + `There was an issue communicating with the CipherStash CTS API, the CipherStash session was not set. ${error}`, + ) + return { success: false, error } + } // `fetch` only rejects on a transport failure, so a CTS refusal RESOLVES: // a `402` carrying `cs_code: USAGE_LIMIT_EXCEEDED` arrives here as an @@ -214,16 +245,46 @@ export const fetchCtsToken = async (oidcToken: string): GetCtsTokenResponse => { } } - const cts_token = (await ctsResponse.json()) as CtsToken + // A success body is validated rather than cast: it is written straight into + // the session cookie, and a 2xx that is not a token (a proxy page, a changed + // API) must fail here, not as a malformed cookie on every later request. + const raw = await ctsResponse.text().catch(() => '') + let body: unknown + try { + body = JSON.parse(raw) + } catch { + body = undefined + } - return { - success: true, - ctsToken: cts_token, + // An already-expired token is refused too: the cookie it would be written to + // reads as no session, so every later request would mint again. + const ctsToken = parseCtsToken(body) + if (!ctsToken || isExpired(ctsToken)) { + const error = `Failed to fetch CTS token: the CipherStash API returned ${ctsResponse.status} without a valid, unexpired token.` + logger.error( + `There was an issue communicating with the CipherStash CTS API, the CipherStash session was not set. ${error}`, + ) + return { success: false, error } } + + return { success: true, ctsToken } } -// Used in the Next.js middleware -export const setCtsToken = async (oidcToken: string, res?: NextResponse) => { +/** + * Mint a session for `oidcToken` and write it to the response, labelled with + * the token's issuer and subject. Used by the Next.js middleware. + * + * `clearOnFailure` says a session cookie, on the request or already on `res`, + * must not outlive this call (malformed, expired, minted for someone else, or + * never checked): if CTS refuses, that cookie is deleted rather than left for + * the next request to read as this user's session. Without it, a failed mint + * leaves the response alone. + */ +export const setCtsToken = async ( + oidcToken: string, + res?: NextResponse, + { clearOnFailure = false }: { clearOnFailure?: boolean } = {}, +) => { const ctsResponse = await fetchCtsToken(oidcToken) const cts_token = ctsResponse.ctsToken @@ -241,18 +302,13 @@ export const setCtsToken = async (oidcToken: string, res?: NextResponse) => { `There was an issue fetching the CipherStash session, the CipherStash session was not set. ${reason}`, ) - return res ?? NextResponse.next() + const response = res ?? NextResponse.next() + return clearOnFailure ? clearCtsSession(response) : response } - // Setting cookies on the request and response using the `ResponseCookies` API - const response = res ?? NextResponse.next() - response.cookies.set({ - name: CS_COOKIE_NAME, - value: JSON.stringify(cts_token), - expires: new Date(cts_token.expiry * 1000), - sameSite: 'lax', - path: '/', - }) - - return response + return writeCtsSession( + res ?? NextResponse.next(), + cts_token, + ownerOfJwt(oidcToken), + ) } diff --git a/languages/typescript/packages/nextjs/src/forward.ts b/languages/typescript/packages/nextjs/src/forward.ts new file mode 100644 index 0000000000..1cd7805cb7 --- /dev/null +++ b/languages/typescript/packages/nextjs/src/forward.ts @@ -0,0 +1,111 @@ +import type { NextRequest, NextResponse } from 'next/server' +import { CS_COOKIE_NAME } from './session' + +/** + * Next.js's request-header override protocol, as `NextResponse.next({ request: + * { headers } })` writes it: `x-middleware-override-headers` lists the request + * headers the forwarded request carries, and `x-middleware-request-` + * holds each value. Next.js reads both and strips them before the response + * reaches the browser. + */ +const OVERRIDE_HEADERS = 'x-middleware-override-headers' + +/** The names of every header in `headers`, lower-cased as `Headers` stores them. */ +function headerNames(headers: Headers): string[] { + const names: string[] = [] + headers.forEach((_value, key) => { + names.push(key) + }) + return names +} +const REQUEST_HEADER_PREFIX = 'x-middleware-request-' + +/** + * Whether `headers` belong to a middleware response that hands the request on + * to a page or route handler: `NextResponse.next()` marks one with + * `x-middleware-next`, `NextResponse.rewrite()` with `x-middleware-rewrite`. + */ +function continuesRequest(headers: Headers): boolean { + return headers.has('x-middleware-next') || headers.has('x-middleware-rewrite') +} + +/** + * Make the request the rest of this request's handlers see agree with the + * session cookie `response` writes or deletes. + * + * Applies only when `response` continues the request (`NextResponse.next()` + * or a rewrite); any other response is returned unchanged. + * + * A `Set-Cookie` on the middleware response only reaches the browser. Route + * handlers do not see it in the same request on any release tested from + * Next.js 14.0.0 to 15.5.29, and server components see it only through + * `cookies()`, and only on later 14.2 releases onwards. Without this, a user + * switch would leave the previous user's session visible to `getCtsToken()` + * for the rest of the request. The forwarded request is changed through the + * same headers `NextResponse.next({ request: { headers } })` writes. + * Overriding request headers replaces the whole set, so every other header is + * carried across, and an override the caller already put on `response` is + * extended, not replaced. + * + * When `response` leaves the session cookie alone, the request's own session + * is what was decided on. With no override on `response`, Next.js forwards it + * as-is and nothing is changed. With one, the forwarded cookie is set to the + * request's session (or to none): an override that carries a session puts + * back the one this middleware checked, and one that leaves out `cookie`, and + * so would drop the session, gets it added. + */ +export function forwardCtsSession(req: NextRequest, response: NextResponse) { + const headers = response.headers + // Only a response that lets the request continue (`NextResponse.next()`, or + // a rewrite) has a downstream handler to update. A redirect or a response + // the middleware answers itself goes straight back to the browser, so it + // is left alone rather than given a copy of the request headers. + if (!continuesRequest(headers)) return response + + const existing = headers.get(OVERRIDE_HEADERS) + const existingKeys = existing + ? existing + .split(',') + .map((key) => key.trim()) + .filter(Boolean) + : undefined + + const written = response.cookies.get(CS_COOKIE_NAME) + if (!written && existingKeys === undefined) return response + const value = written + ? written.value + : (req.cookies.get(CS_COOKIE_NAME)?.value ?? '') + + const keys = existingKeys ?? headerNames(req.headers) + + if (!existing) { + req.headers.forEach((headerValue, key) => { + headers.set(`${REQUEST_HEADER_PREFIX}${key}`, headerValue) + }) + } + + const currentCookie = keys.includes('cookie') + ? (headers.get(`${REQUEST_HEADER_PREFIX}cookie`) ?? '') + : existing + ? '' + : (req.headers.get('cookie') ?? '') + + // Work on the raw header so every other cookie is forwarded byte for byte. + const pairs = currentCookie + .split(';') + .map((pair) => pair.trim()) + .filter((pair) => pair !== '' && pair.split('=', 1)[0] !== CS_COOKIE_NAME) + if (value !== '') { + pairs.push(`${CS_COOKIE_NAME}=${encodeURIComponent(value)}`) + } + + // `cookie` always stays in the override list, set to an empty header when no + // cookie is left: Next.js ignores an empty override list, and dropping + // `cookie` from a list that named nothing else would forward the original + // request cookie, previous session included. + const otherKeys = keys.filter((key) => key !== 'cookie') + headers.set(`${REQUEST_HEADER_PREFIX}cookie`, pairs.join('; ')) + headers.set(OVERRIDE_HEADERS, [...otherKeys, 'cookie'].join(',')) + + return response +} diff --git a/languages/typescript/packages/nextjs/src/index.ts b/languages/typescript/packages/nextjs/src/index.ts index 73a4df30ee..8da0e3a885 100644 --- a/languages/typescript/packages/nextjs/src/index.ts +++ b/languages/typescript/packages/nextjs/src/index.ts @@ -1,31 +1,24 @@ -import { decodeJwt } from 'jose' import { cookies } from 'next/headers' import type { NextRequest } from 'next/server' import { NextResponse } from 'next/server' import { logger } from '../../utils/logger' -import { fetchCtsToken, setCtsToken } from './cts' - -function getSubjectFromToken(jwt: string): string | undefined { - const payload = decodeJwt(jwt) - - // The CTS JWT payload has a sub field that starts with "CS|" - if (typeof payload?.sub === 'string' && payload?.sub.startsWith('CS|')) { - return payload.sub.slice(3) - } - - return payload?.sub -} - -export const CS_COOKIE_NAME = '__cipherstash_cts_session' - -export type CtsToken = { - accessToken: string - expiry: number -} +import { fetchCtsToken } from './cts' +import { + CS_COOKIE_NAME, + type CtsToken, + clearCtsSession, + ctsTokenOf, + ownerOfJwt, + readCtsSession, + sessionBelongsTo, +} from './session' +import { syncCtsSession } from './sync' + +export { CS_COOKIE_NAME, type CtsToken } export type GetCtsTokenResponse = Promise< | { - success: boolean + success: false error: string /** * The refusal code CTS attached, when it refused for a reason the caller @@ -42,26 +35,66 @@ export type GetCtsTokenResponse = Promise< ctsToken?: never } | { - success: boolean + success: true error?: never authCode?: never ctsToken: CtsToken } > -export const getCtsToken = async (oidcToken?: string): GetCtsTokenResponse => { +type GetCtsToken = { + /** + * The CipherStash session cookie for the current request, returned as-is. + * + * @deprecated Pass the user's OIDC token. With no token there is no identity + * to check the cookie against, so a session left behind by a sign-out on a + * route the middleware does not cover is returned to whoever calls this + * next. Call `resetCtsToken` when a user signs out on such a route. + */ + (): GetCtsTokenResponse + /** + * The CipherStash session for the current request. + * + * With `oidcToken`, the session cookie is only returned when it was minted + * for that token's issuer and subject; otherwise (no cookie, a malformed + * cookie, or a cookie belonging to someone else) a fresh session is fetched + * for `oidcToken`. Without it, the cookie is returned as-is, so pass the + * user's token whenever you have one. + * + * `oidcToken` must be a token your application has already authenticated: + * this function reads its `iss` and `sub` without verifying its signature, + * to decide which session it may reuse. CTS verifies it when a session is + * minted. + */ + (oidcToken: string | undefined): GetCtsTokenResponse +} + +export const getCtsToken: GetCtsToken = async ( + oidcToken?: string, +): GetCtsTokenResponse => { const cookieStore = await cookies() - const cookieData = cookieStore.get(CS_COOKIE_NAME)?.value + const rawSession = cookieStore.get(CS_COOKIE_NAME)?.value + const session = readCtsSession(rawSession) - if (oidcToken && !cookieData) { + if (rawSession && !session) { logger.debug( - 'The CipherStash session cookie was not found in the request, but a JWT token was provided. The JWT token will be used to fetch a new CipherStash session.', + 'The CipherStash session cookie is malformed or expired and was ignored.', + ) + } + + if (oidcToken) { + if (session && sessionBelongsTo(session, ownerOfJwt(oidcToken))) { + return { success: true, ctsToken: ctsTokenOf(session) } + } + + logger.debug( + 'No CipherStash session for the supplied JWT was found in the request. The JWT will be used to fetch a new CipherStash session.', ) return await fetchCtsToken(oidcToken) } - if (!cookieData) { + if (!session) { logger.debug('No CipherStash session cookie found in the request.') return { success: false, @@ -69,70 +102,39 @@ export const getCtsToken = async (oidcToken?: string): GetCtsTokenResponse => { } } - const cts_token = JSON.parse(cookieData) as CtsToken - return { - success: true, - ctsToken: cts_token, - } -} - -export const resetCtsToken = (res?: NextResponse) => { - if (res) { - res.cookies.delete(CS_COOKIE_NAME) - return res - } - - const response = NextResponse.next() - response.cookies.delete(CS_COOKIE_NAME) - return response + return { success: true, ctsToken: ctsTokenOf(session) } } +/** + * Delete the CipherStash session cookie, on `res` or on a new pass-through + * response. Use it when a user signs out on a route the middleware does not + * cover. + */ +export const resetCtsToken = (res?: NextResponse) => + clearCtsSession(res ?? NextResponse.next()) + +/** + * Keep the CipherStash session cookie in step with the user `oidcToken` + * identifies. A session is only reused for the issuer and subject it was + * minted for; otherwise one is minted from `oidcToken`. An empty `oidcToken` + * means nobody is signed in, and the cookie is cleared. + * + * `oidcToken` must be a token your application has already authenticated. Its + * `iss` and `sub` are read without verifying its signature: this keeps the + * session in step with an identity you trust, it does not establish one. + */ export const protectMiddleware = async ( oidcToken: string, req: NextRequest, res?: NextResponse, -) => { - const ctsSession = req.cookies.get(CS_COOKIE_NAME)?.value - - if (oidcToken && ctsSession) { - const ctsToken = JSON.parse(ctsSession) as CtsToken - const ctsTokenSubject = getSubjectFromToken(ctsToken.accessToken) - const oidcTokenSubject = getSubjectFromToken(oidcToken) - - if (ctsTokenSubject === oidcTokenSubject) { - logger.debug( - 'The JWT token and the CipherStash session are both valid for the same user.', - ) - - return res ?? NextResponse.next() - } - - return await setCtsToken(oidcToken, res) - } - - if (oidcToken && !ctsSession) { - logger.debug( - 'The JWT token was defined, so the CipherStash session will be set.', - ) - - return await setCtsToken(oidcToken, res) - } - - if (!oidcToken && ctsSession) { - logger.debug( - 'The JWT token was undefined, so the CipherStash session was reset.', - ) - - return resetCtsToken(res) - } - - logger.debug( - 'The JWT token was undefined, so the CipherStash session was not set.', +) => + await syncCtsSession( + req, + oidcToken + ? { + owner: ownerOfJwt(oidcToken), + getOidcToken: async () => oidcToken, + } + : undefined, + res, ) - - if (res) { - return res - } - - return NextResponse.next() -} diff --git a/languages/typescript/packages/nextjs/src/session.ts b/languages/typescript/packages/nextjs/src/session.ts new file mode 100644 index 0000000000..eb9cfdb152 --- /dev/null +++ b/languages/typescript/packages/nextjs/src/session.ts @@ -0,0 +1,197 @@ +import { decodeJwt } from 'jose' +import type { NextResponse } from 'next/server' +import { logger } from '../../utils/logger' + +/** + * The CipherStash session cookie: the one module that knows its name, its + * format and the attributes it is written with. Carrying it into the request + * Next.js forwards is `forward.ts`'s job. + * + * The cookie is client-controlled input. Everything that reads it goes through + * {@link readCtsSession}, which never throws, so a tampered or truncated value + * reads as "no session" instead of a 500 on every matched route. + */ +export const CS_COOKIE_NAME = '__cipherstash_cts_session' + +export type CtsToken = { + accessToken: string + expiry: number +} + +/** + * Who a session was minted for: the `iss` and `sub` of the OIDC token it was + * exchanged from. Both, because a `sub` is only unique within its issuer. + */ +export type SessionOwner = { issuer: string; subject: string } + +/** + * What the cookie holds: the CTS token, plus the {@link SessionOwner} of the + * OIDC token it was minted from. + * + * The owner is recorded at mint time rather than read back out of the CTS + * access token, so ownership never depends on how CTS shapes its own `sub`. + * + * Trust model: the owner is unsigned metadata in a client-held cookie, and + * nothing here verifies a JWT signature. It is not a security boundary against + * the cookie's holder, who already holds the bearer token. It stops a session + * left in a shared browser by one user being handed to the next, which is only + * meaningful if the identity it is compared with was authenticated by the + * caller (Clerk's middleware, or your own verification of the OIDC token). + */ +export type CtsSession = CtsToken & { owner?: SessionOwner } + +/** Whether `value` is a string with at least one character. */ +export const nonEmptyString = (value: unknown): value is string => + typeof value === 'string' && value !== '' + +/** + * Validate a value as a {@link CtsToken}: an object with a non-empty string + * `accessToken` and a finite numeric `expiry`. Used for both the cookie and the + * CTS `/api/authorize` success body, so neither boundary trusts a cast. + */ +export function parseCtsToken(value: unknown): CtsToken | undefined { + if (typeof value !== 'object' || value === null || Array.isArray(value)) { + return undefined + } + + const { accessToken, expiry } = value as Record + if ( + !nonEmptyString(accessToken) || + typeof expiry !== 'number' || + !Number.isFinite(expiry) + ) { + return undefined + } + + return { accessToken, expiry } +} + +/** + * Validate a cookie's recorded owner: an object with a non-empty string + * `issuer` and `subject`. Anything else is `undefined`, leaving the session + * unowned. + */ +function parseOwner(value: unknown): SessionOwner | undefined { + if (typeof value !== 'object' || value === null) return undefined + const { issuer, subject } = value as Record + return nonEmptyString(issuer) && nonEmptyString(subject) + ? { issuer, subject } + : undefined +} + +/** Whether `token` has expired at `now` (milliseconds since the epoch). */ +export function isExpired(token: CtsToken, now: number = Date.now()): boolean { + return token.expiry * 1000 <= now +} + +/** + * Parse a raw session cookie value. Returns `undefined` for a missing value, + * for anything that is not JSON of the `{ accessToken, expiry }` shape, and for + * a session whose `expiry` has passed. A missing or malformed `owner` leaves the + * session unowned, which never matches anyone. + */ +export function readCtsSession( + raw: string | undefined, + now: number = Date.now(), +): CtsSession | undefined { + if (!raw) return undefined + + let parsed: unknown + try { + parsed = JSON.parse(raw) + } catch { + return undefined + } + + const token = parseCtsToken(parsed) + if (!token || isExpired(token, now)) return undefined + + const owner = parseOwner((parsed as Record).owner) + return owner ? { ...token, owner } : token +} + +/** + * The `iss` and `sub` of a JWT, exactly as written. The signature is NOT + * verified: the caller must already have authenticated the token, and this only + * labels the session minted from it. Returns `undefined` for anything that does + * not decode, or lacks a non-empty string `iss` or `sub`. + */ +export function ownerOfJwt(jwt: string): SessionOwner | undefined { + let claims: { iss?: unknown; sub?: unknown } + try { + claims = decodeJwt(jwt) + } catch { + return undefined + } + + return nonEmptyString(claims.iss) && nonEmptyString(claims.sub) + ? { issuer: claims.iss, subject: claims.sub } + : undefined +} + +/** + * Whether `session` was minted for `owner`. An unknown owner on either side + * (including a cookie written before owners were recorded) is never a match: a + * session whose owner cannot be established must not be handed to anyone. + */ +export function sessionBelongsTo( + session: CtsSession, + owner: SessionOwner | undefined, +): boolean { + return ( + session.owner !== undefined && + owner !== undefined && + session.owner.issuer === owner.issuer && + session.owner.subject === owner.subject + ) +} + +/** The CTS token alone, without the bookkeeping the cookie carries. */ +export function ctsTokenOf({ accessToken, expiry }: CtsSession): CtsToken { + return { accessToken, expiry } +} + +/** + * Write the session cookie. The value is a bearer token, so it is `httpOnly` + * (nothing in this package reads it client-side, and page script must not be + * able to exfiltrate it) and always `secure`, whatever `NODE_ENV` says, so a + * staging or preview deployment that is not built for production still never + * sends it over plain HTTP. Browsers accept a `Secure` cookie from + * `http://localhost`, so local development keeps working; a plain-HTTP server + * on any other host, such as a LAN address, will not keep the session. + */ +export function writeCtsSession( + response: NextResponse, + token: CtsToken, + owner: SessionOwner | undefined, +) { + const session: CtsSession = owner + ? { ...ctsTokenOf(token), owner } + : ctsTokenOf(token) + + const value = JSON.stringify(session) + // Browsers drop a cookie whose name and value exceed 4096 bytes, which would + // leave this session unset and mint a new one on every request. + if (CS_COOKIE_NAME.length + encodeURIComponent(value).length > 4096) { + logger.error( + 'The CipherStash session is larger than browsers accept in one cookie, so it may not be stored and a new session will be fetched on later requests.', + ) + } + + response.cookies.set({ + name: CS_COOKIE_NAME, + value, + expires: new Date(token.expiry * 1000), + httpOnly: true, + secure: true, + sameSite: 'lax', + path: '/', + }) + return response +} + +/** Delete the session cookie on `response`. */ +export function clearCtsSession(response: NextResponse) { + response.cookies.delete(CS_COOKIE_NAME) + return response +} diff --git a/languages/typescript/packages/nextjs/src/sync.ts b/languages/typescript/packages/nextjs/src/sync.ts new file mode 100644 index 0000000000..3937e289b3 --- /dev/null +++ b/languages/typescript/packages/nextjs/src/sync.ts @@ -0,0 +1,165 @@ +import { type NextRequest, NextResponse } from 'next/server' +import { logger } from '../../utils/logger' +import { setCtsToken } from './cts' +import { forwardCtsSession } from './forward' +import { + CS_COOKIE_NAME, + type CtsSession, + clearCtsSession, + readCtsSession, + type SessionOwner, + sessionBelongsTo, + writeCtsSession, +} from './session' + +/** + * The signed-in user, as a middleware sees them. The caller is responsible for + * having authenticated this identity: nothing here verifies a token. + */ +export type SessionIdentity = { + /** + * The identity the session must have been minted for. `undefined` when it + * cannot be established, in which case no session is ever reused. + */ + owner: SessionOwner | undefined + /** + * The OIDC token to mint a new session with. Called only when the existing + * session cannot be reused, so a middleware can defer fetching it. A rejection + * is treated as no token being available. + */ + getOidcToken: () => Promise +} + +/** + * Bring the CipherStash session cookie in line with who is signed in. The one + * decision both `protectMiddleware` and `protectClerkMiddleware` make: + * + * - Signed in, with an unexpired session minted for this identity (issuer and + * subject): pass through. + * - Signed in otherwise (no session, a malformed or expired one, or one minted + * for someone else): mint a session for this user. If there is no token to + * mint with (including when fetching one fails), or CTS refuses, a stale + * cookie is cleared rather than kept. + * - Signed out, with a session cookie: clear it. + * + * Whenever the cookie is written or cleared, the request forwarded to the rest + * of this request's handlers is updated to match, so a server component + * calling `getCtsToken()` never sees the session this call replaced. + * + * A session cookie already set on `res` by the caller is not the decision: it + * is overwritten with the session that was kept, or cleared when none was, so + * neither the browser nor the forwarded request receives a session nobody + * checked. + */ +export async function syncCtsSession( + req: NextRequest, + identity: SessionIdentity | undefined, + res?: NextResponse, +): Promise { + const { response, keptSession, callerCookieLeftInPlace } = + await decideSession(req, identity, res) + + if (callerCookieLeftInPlace) { + if (keptSession) { + writeCtsSession(response, keptSession, keptSession.owner) + } else { + clearCtsSession(response) + } + } + + return forwardCtsSession(req, response) +} + +type SessionDecision = { + response: NextResponse + /** + * Whether `response` still carries a session cookie the caller set on it, + * because the decision neither wrote nor deleted the cookie. + */ + callerCookieLeftInPlace: boolean + /** The request's own session, when it was checked and kept. */ + keptSession?: CtsSession +} + +/** + * The session decision {@link syncCtsSession} makes, before the forwarded + * request is brought in line with it: returns `res` (or a pass-through + * response) with the session cookie kept, written or deleted, and the + * request's session when it was the one kept. + */ +async function decideSession( + req: NextRequest, + identity: SessionIdentity | undefined, + res: NextResponse | undefined, +): Promise { + const rawSession = req.cookies.get(CS_COOKIE_NAME)?.value + const callerHasCookie = res?.cookies.has(CS_COOKIE_NAME) ?? false + const passThrough = () => res ?? NextResponse.next() + const leaveCookie = (keptSession?: CtsSession): SessionDecision => ({ + response: passThrough(), + callerCookieLeftInPlace: callerHasCookie, + keptSession, + }) + const clearCookie = (): SessionDecision => ({ + response: clearCtsSession(passThrough()), + callerCookieLeftInPlace: false, + }) + + if (!identity) { + if (rawSession) { + logger.debug( + 'No user is signed in, so the CipherStash session was reset.', + ) + return clearCookie() + } + + logger.debug( + 'No user is signed in, so the CipherStash session was not set.', + ) + return leaveCookie() + } + + if (!identity.owner) { + logger.debug( + 'The signed-in identity has no readable issuer and subject, so no CipherStash session can be reused for it and one will be minted on every request.', + ) + } + + const session = readCtsSession(rawSession) + if (session && sessionBelongsTo(session, identity.owner)) { + logger.debug( + 'The CipherStash session belongs to the signed-in user and was kept.', + ) + return leaveCookie(session) + } + + if (rawSession) { + logger.debug( + 'The CipherStash session is malformed, expired, or belongs to a different user, so it will be replaced.', + ) + } + + let oidcToken: string | null | undefined + try { + oidcToken = await identity.getOidcToken() + } catch { + // Handled like a missing token, so a stale cookie is still cleared and the + // request is not turned into a 500. The exception is not repeated: its + // message could contain a token. + logger.error( + 'Fetching a token for the signed-in user failed, so the CipherStash session was not set.', + ) + } + + if (!oidcToken) { + logger.debug( + 'No token was available for the signed-in user, so the CipherStash session was not set.', + ) + return rawSession ? clearCookie() : leaveCookie() + } + + const minted = await setCtsToken(oidcToken, res, { + clearOnFailure: callerHasCookie || Boolean(rawSession), + }) + return { response: minted, callerCookieLeftInPlace: false } +} diff --git a/languages/typescript/packages/protect-ffi/Cargo.lock b/languages/typescript/packages/protect-ffi/Cargo.lock index 1c24cbeb53..889b73ab64 100644 --- a/languages/typescript/packages/protect-ffi/Cargo.lock +++ b/languages/typescript/packages/protect-ffi/Cargo.lock @@ -3526,9 +3526,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.53.3" +version = "1.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3335fa71841cda333a58d7615b03901380ecf09d59b3296d21f8bbac0dde4e" +checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3" dependencies = [ "bytes", "libc", @@ -3870,9 +3870,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" dependencies = [ "atomic", "getrandom 0.4.2", diff --git a/languages/typescript/packages/protect-ffi/package.json b/languages/typescript/packages/protect-ffi/package.json index 06345ccd4d..444ce1a491 100644 --- a/languages/typescript/packages/protect-ffi/package.json +++ b/languages/typescript/packages/protect-ffi/package.json @@ -92,7 +92,7 @@ "prefix": "protect-ffi-" }, "devDependencies": { - "@biomejs/biome": "^2.5.15", + "@biomejs/biome": "^2.6.4", "@neon-rs/cli": "^0.2.6", "@tsconfig/node22": "^22.0.6", "@types/node": "^22.20.5", diff --git a/languages/typescript/packages/stack-prisma/package.json b/languages/typescript/packages/stack-prisma/package.json index df732ee676..ac4e5526cf 100644 --- a/languages/typescript/packages/stack-prisma/package.json +++ b/languages/typescript/packages/stack-prisma/package.json @@ -83,7 +83,7 @@ "@prisma/orm-family-sql": "0.17.0", "@prisma/orm-framework": "0.17.0", "@prisma/orm-toolchain": "0.17.0", - "arktype": "^2.2.8" + "arktype": "^2.2.9" }, "peerDependencies": { "@prisma/orm-target-postgres": "0.17.0" diff --git a/languages/typescript/packages/stack-prisma/src/v3/operators-v3.ts b/languages/typescript/packages/stack-prisma/src/v3/operators-v3.ts index a82d799a64..e805f7d8b4 100644 --- a/languages/typescript/packages/stack-prisma/src/v3/operators-v3.ts +++ b/languages/typescript/packages/stack-prisma/src/v3/operators-v3.ts @@ -75,6 +75,7 @@ import { jsonPathOf, + likeWildcardError, matchNeedleError, parseSelectorSegments, unsupportedLeafReason, @@ -537,7 +538,7 @@ function normalizeMatchNeedle( throw operatorError( ctx, method, - `cipherstash ${method}: pattern ${JSON.stringify(value)} on column "${ctx.columnName ?? 'unknown'}" has wildcards fuzzy free-text matching cannot honor (an interior "%" or any "_"). Pass a literal search term.`, + `cipherstash ${method} on column "${ctx.columnName ?? 'unknown'}": ${likeWildcardError(value)} Pass a literal search term.`, ) } const match = ctx.meta.indexes.match diff --git a/languages/typescript/packages/stack-prisma/test/v3/operator-lowering-v3-text-search.test.ts b/languages/typescript/packages/stack-prisma/test/v3/operator-lowering-v3-text-search.test.ts index 74cb53aaa4..8d381fd8cb 100644 --- a/languages/typescript/packages/stack-prisma/test/v3/operator-lowering-v3-text-search.test.ts +++ b/languages/typescript/packages/stack-prisma/test/v3/operator-lowering-v3-text-search.test.ts @@ -124,6 +124,15 @@ describe('cipherstash v3 operator lowering — eqlMatch needle guards', () => { } }) + // The pattern is the caller's plaintext search term. The error is thrown to + // the caller, who commonly logs it, so it reports the term's length only. + it('never echoes the rejected pattern in the wildcard error', () => { + for (const needle of ['Qzx%wvy', 'Qzx_wvy']) { + expect(() => lowerMatch(needle), needle).toThrow(/cannot honor/) + expect(() => lowerMatch(needle), needle).not.toThrow(/Qzx|wvy/) + } + }) + it('rejects a needle that is empty after stripping with the matchNeedleError reason', () => { expect(() => lowerMatch('%%')).toThrow(EncryptionOperatorError) expect(() => lowerMatch('%%')).toThrow( diff --git a/languages/typescript/packages/stack-supabase/__tests__/helpers/supabase-mock.ts b/languages/typescript/packages/stack-supabase/__tests__/helpers/supabase-mock.ts index 7e55550303..c67346f081 100644 --- a/languages/typescript/packages/stack-supabase/__tests__/helpers/supabase-mock.ts +++ b/languages/typescript/packages/stack-supabase/__tests__/helpers/supabase-mock.ts @@ -73,6 +73,19 @@ export function operation(data: T) { return op } +/** A chainable operation resolving to `{ failure }`, like a real failed one. */ +export function failingOperation(failure: { type: string; message: string }) { + const op = { + withLockContext: () => op, + audit: () => op, + then: ( + onfulfilled?: ((value: { failure: typeof failure }) => unknown) | null, + onrejected?: ((reason: unknown) => unknown) | null, + ) => Promise.resolve({ failure }).then(onfulfilled, onrejected), + } + return op +} + type SchemaLike = { build(): { columns: Record } buildColumnKeyMap?(): Record diff --git a/languages/typescript/packages/stack-supabase/__tests__/no-plaintext-in-errors.test.ts b/languages/typescript/packages/stack-supabase/__tests__/no-plaintext-in-errors.test.ts new file mode 100644 index 0000000000..f0b35345c4 --- /dev/null +++ b/languages/typescript/packages/stack-supabase/__tests__/no-plaintext-in-errors.test.ts @@ -0,0 +1,93 @@ +import { logger } from '@cipherstash/stack/adapter-kit' +import { encryptedTable, types } from '@cipherstash/stack/eql/v3' +import { afterEach, describe, expect, it, vi } from 'vitest' +import { EncryptedQueryBuilderImpl } from '../src/query-builder' +import { + createMockEncryptionClient, + createMockSupabase, +} from './helpers/supabase-mock' + +// A search term on an encrypted column is plaintext the caller chose to +// protect. The library promises never to log plaintext, and its own error +// messages are routinely logged by callers, so neither may carry the term. +// These tests use distinctive sentinels so a substring check cannot pass by +// accident against an ordinary English word in the message. + +const users = encryptedTable('users', { + email: types.TextSearch('email'), + nickname: types.TextEq('nickname'), +}) +const COLUMNS = ['id', 'email', 'nickname'] + +function builder(encryptionClient = createMockEncryptionClient()) { + const supabase = createMockSupabase([]) + return new EncryptedQueryBuilderImpl( + 'users', + users, + encryptionClient, + supabase.client, + COLUMNS, + ) +} + +/** Every string the logger was handed, across all levels. */ +function logged(spies: ReturnType[]): string { + return spies + .flatMap((spy) => spy.mock.calls.flat()) + .map((arg) => (typeof arg === 'string' ? arg : JSON.stringify(arg))) + .join('\n') +} + +function spyLogger() { + return (['error', 'warn', 'info', 'debug'] as const).map((level) => + vi.spyOn(logger, level).mockImplementation(() => {}), + ) +} + +afterEach(() => { + vi.restoreAllMocks() +}) + +describe('plaintext search terms stay out of errors and logs', () => { + it('a too-short matches() needle is neither logged nor echoed in the error', async () => { + const spies = spyLogger() + + const { error } = await builder().select('id').matches('email', 'Qz') + + expect(error?.message).toMatch(/at least 3 characters/) + expect(error?.message).not.toContain('Qz') + expect(logged(spies)).not.toContain('Qz') + }) + + it('a like() pattern with unsupported wildcards is not echoed in the error', () => { + for (const pattern of ['Qzx%wvy', 'Qzx_wvy']) { + const like = () => builder().select('id').like('email', pattern) + expect(like, pattern).toThrow(/cannot honor/) + expect(like, pattern).not.toThrow(/Qzx|wvy/) + } + }) + + // The catch around query execution sees errors from every layer (encryption, + // PostgREST, the network), and any of them may quote a value. It reports the + // failure's kind; the message itself goes back to the caller, not to the log. + it('a failed query logs the failure kind, not the error message', async () => { + const encryption = createMockEncryptionClient() + vi.spyOn( + encryption as unknown as { bulkEncrypt: (...a: unknown[]) => unknown }, + 'bulkEncrypt', + ).mockImplementation(() => { + throw new TypeError('value "Qzx-secret-wvy" could not be encoded') + }) + const spies = spyLogger() + + const { error } = await builder(encryption) + .select('id') + .in('nickname', ['Qzx-secret-wvy', 'other']) + + expect(error?.message).toContain('Qzx-secret-wvy') + const output = logged(spies) + expect(output).toMatch(/failed on table "users"/) + expect(output).toContain('TypeError') + expect(output).not.toContain('Qzx') + }) +}) diff --git a/languages/typescript/packages/stack-supabase/__tests__/supabase-encryption-error.test.ts b/languages/typescript/packages/stack-supabase/__tests__/supabase-encryption-error.test.ts index b9acdd0082..05acd28e17 100644 --- a/languages/typescript/packages/stack-supabase/__tests__/supabase-encryption-error.test.ts +++ b/languages/typescript/packages/stack-supabase/__tests__/supabase-encryption-error.test.ts @@ -6,6 +6,7 @@ import { EncryptedQueryBuilderImpl } from '../src/query-builder' import { createMockEncryptionClient, createMockSupabase, + failingOperation, fakeEnvelope, operation, } from './helpers/supabase-mock' @@ -25,19 +26,6 @@ const usersV3 = encryptedTable('users', { email: types.TextEq('email'), }) -/** A chainable op that resolves to `{ failure }`, like a real failed operation. */ -function failingOperation(failure: { type: string; message: string }) { - const op = { - withLockContext: () => op, - audit: () => op, - then: ( - onfulfilled?: ((value: { failure: typeof failure }) => unknown) | null, - onrejected?: ((reason: unknown) => unknown) | null, - ) => Promise.resolve({ failure }).then(onfulfilled, onrejected), - } - return op -} - describe('EncryptedSupabaseError.encryptionError (#626)', () => { it('threads the EncryptionError through on an encryption failure', async () => { const failure = { diff --git a/languages/typescript/packages/stack-supabase/__tests__/supabase-plaintext-table.test.ts b/languages/typescript/packages/stack-supabase/__tests__/supabase-plaintext-table.test.ts new file mode 100644 index 0000000000..15716900cd --- /dev/null +++ b/languages/typescript/packages/stack-supabase/__tests__/supabase-plaintext-table.test.ts @@ -0,0 +1,302 @@ +import type { EncryptionClient } from '@cipherstash/stack/encryption' +import type { AnyV3Table } from '@cipherstash/stack/eql/v3' +import { encryptedTable, types } from '@cipherstash/stack/eql/v3' +import { describe, expect, it, vi } from 'vitest' +import type { EncryptionFactory, Introspector } from '../src/create' +import { makeEncryptedSupabase } from '../src/create' +import type { IntrospectionData } from '../src/introspect' +import { + createMockEncryptionClient, + createMockSupabase, + failingOperation, + fakeEnvelope, + isFakeEnvelope, +} from './helpers/supabase-mock' + +/** + * Tables with NO encrypted columns ("plaintext tables"). + * + * The adapter registers every table it knows about with its query builder, but + * `Encryption({ schemas })` only receives tables that carry at least one + * encrypted column — it rejects an empty schema list, and a plaintext table has + * nothing for it to do. Both real engines refuse a model operation on a table + * they were not initialized with: the native client resolves + * `decryptModel`/`bulkDecryptModels` to a "not initialized with" failure, and + * the WASM client throws from `requireTable` for decrypts AND encrypts. So any + * read of a plaintext table — or a mutation with `.select()` — used to fail + * with `Failed to decrypt model: [eql/v3]: decryptModel received a table this + * client was not initialized with`. + * + * The shared `createMockEncryptionClient` ignores the table argument, which is + * why the existing suites never saw it. The factory below enforces the + * registration contract the real engines enforce, so these tests fail the way + * production did. + */ + +/** + * An `Encryption` stand-in that, like both real engines, only serves the tables + * it was initialized with. Records what it was given so a test can assert the + * plaintext table really was left out. + */ +function registryEnforcingFactory() { + const registered: string[] = [] + const calls: string[] = [] + + const factory: EncryptionFactory = async ({ schemas }) => { + registered.push(...schemas.map((t) => t.tableName)) + const inner = createMockEncryptionClient() as unknown as Record< + string, + (...args: unknown[]) => unknown + > + const guarded = + (method: string) => + (input: unknown, table: AnyV3Table | undefined, ...rest: unknown[]) => { + calls.push(`${method}:${table?.tableName ?? ''}`) + if (table && !registered.includes(table.tableName)) { + return failingOperation({ + type: /decrypt/i.test(method) + ? 'DecryptionError' + : 'EncryptionError', + message: `[eql/v3]: table "${table.tableName}" is not one this client was initialized with`, + }) + } + return inner[method](input, table, ...rest) + } + return { + ...inner, + encryptModel: guarded('encryptModel'), + bulkEncryptModels: guarded('bulkEncryptModels'), + decryptModel: guarded('decryptModel'), + bulkDecryptModels: guarded('bulkDecryptModels'), + } as unknown as EncryptionClient + } + + return { factory, registered, calls } +} + +const introspection: IntrospectionData = { + tables: [ + { + tableName: 'users', + columns: [ + { columnName: 'id', domainName: null }, + { columnName: 'email', domainName: 'eql_v3_text_search' }, + ], + }, + { + tableName: 'audit_log', + columns: [ + { columnName: 'id', domainName: null }, + { columnName: 'action', domainName: null }, + ], + }, + ], + unmodelled: new Map(), + eqlVersion: '3.0.4', +} + +const introspector: Introspector = { + introspect: async () => introspection, + eqlRequiresQueryDomains: () => false, +} + +const auditRows = [ + { id: 1, action: 'login' }, + { id: 2, action: 'logout' }, +] + +const users = encryptedTable('users', { email: types.TextSearch('email') }) +const auditLog = encryptedTable('audit_log', {}) + +function clientFor( + connect: (factory: EncryptionFactory, client: never) => Promise, +) { + return async (resultData: unknown) => { + const encryption = registryEnforcingFactory() + const supabase = createMockSupabase(resultData) + const es = await connect(encryption.factory, supabase.client as never) + return { es, encryption, supabase } + } +} + +const introspectedClient = clientFor((factory, client) => + makeEncryptedSupabase(factory, introspector)(client, { + databaseUrl: 'postgres://x', + }), +) +const declaredClient = clientFor((factory, client) => + makeEncryptedSupabase(factory, null)(client, { + schemas: { users, audit_log: auditLog }, + }), +) + +describe.each([ + ['introspection mode', introspectedClient], + ['declared mode', declaredClient], +] as const)('plaintext table — %s', (_mode, build) => { + it('leaves the plaintext table out of Encryption({ schemas })', async () => { + const { encryption } = await build([]) + expect(encryption.registered).toEqual(['users']) + }) + + it.each([ + ['', false], + [' with throwOnError', true], + ])('reads every row of a plaintext table%s', async (_label, throwOnError) => { + const { es, encryption } = await build(auditRows) + const query = es.from('audit_log').select('id, action') + const { data, error } = await (throwOnError ? query.throwOnError() : query) + + expect(error).toBeNull() + expect(data).toEqual(auditRows) + // Nothing to decrypt, so the encryption client is not consulted at all. + expect(encryption.calls).toEqual([]) + }) + + it('reads a single row of a plaintext table', async () => { + const { es } = await build(auditRows[0]) + const { data, error } = await es + .from('audit_log') + .select('id, action') + .eq('id', 1) + .single() + + expect(error).toBeNull() + expect(data).toEqual(auditRows[0]) + }) + + it.each([ + ['one row', auditRows[0]], + ['several rows', auditRows], + ])('inserts %s and returns them via .select()', async (_label, rows) => { + const { es, encryption, supabase } = await build([rows].flat()) + const { data, error } = await es + .from('audit_log') + .insert(rows) + .select('id, action') + + expect(error).toBeNull() + expect(data).toEqual([rows].flat()) + // The rows went to PostgREST exactly as written — no encrypt step ran. + expect(supabase.callsFor('insert')[0].args[0]).toEqual(rows) + expect(encryption.calls).toEqual([]) + }) + + it('still encrypts and decrypts the encrypted table on the same instance', async () => { + const { es, encryption, supabase } = await build([ + { id: 1, email: fakeEnvelope('a@example.com', 'email') }, + ]) + const { data, error } = await es + .from('users') + .insert({ id: 1, email: 'a@example.com' }) + .select('id, email') + + expect(error).toBeNull() + expect(data).toEqual([{ id: 1, email: 'a@example.com' }]) + const sent = supabase.callsFor('insert')[0].args[0] as Record< + string, + unknown + > + expect(isFakeEnvelope(sent.email)).toBe(true) + expect(encryption.calls).toEqual([ + 'encryptModel:users', + 'bulkDecryptModels:users', + ]) + }) +}) + +/** + * Passing a plaintext table's rows through must not become a way to hand the + * caller ciphertext typed as data. A row from a table with no encrypted columns + * can still carry an EQL payload — from an embedded relation to an encrypted + * table (`select('id, users(email)')`), or from a declared-mode table declared + * with `{}` whose real columns are `eql_v3_*` domains. Before the passthrough + * those reads failed; they must still fail, and say why, rather than succeed + * with an envelope where the caller expects a value. + */ +describe('plaintext table rows that carry ciphertext', () => { + const envelope = { + v: 3, + i: { t: 'users', c: 'email' }, + c: 'mBbKmsMMkbKBSN', + hm: 'hm', + } + + it.each([ + [ + 'an embedded relation', + [{ id: 1, users: { email: envelope } }], + '[0].users', + ], + [ + 'an embedded to-many relation', + [{ id: 1, users: [{ email: 'x' }, { email: envelope }] }], + '[0].users', + ], + [ + 'an undeclared encrypted column', + [{ id: 1, action: envelope }], + '[0].action', + ], + ])('refuses %s', async (_case, rows, path) => { + const { es } = await declaredClient(rows) + const { data, error } = await es + .from('audit_log') + .select('id, users(email)') + + expect(data).toBeNull() + expect(error?.message).toContain( + 'table "audit_log" has no encrypted columns', + ) + expect(error?.message).toContain(`"${path}"`) + // Never the ciphertext itself. + expect(error?.message).not.toContain(envelope.c) + expect(error?.encryptionError?.type).toBe('DecryptionError') + }) + + it('never names a key inside a jsonb document', async () => { + const { logger } = await import('@cipherstash/stack/adapter-kit') + const logged = vi.spyOn(logger, 'error').mockImplementation(() => {}) + try { + const rows = [{ id: 1, meta: { 'ssn-078-05-1120': envelope } }] + const { es } = await introspectedClient(rows) + const { error } = await es.from('audit_log').select('id, meta') + + expect(error?.message).toContain('"[0].meta"') + expect(error?.message).not.toContain('ssn-078-05-1120') + // The log names the failure's kind, never the message (CIP-5161), so it + // carries neither the key nor the row path. + expect(logged).toHaveBeenCalled() + for (const args of logged.mock.calls) { + expect(args.join(' ')).toContain('DecryptionError') + expect(args.join(' ')).not.toContain('ssn-078-05-1120') + } + } finally { + logged.mockRestore() + } + }) + + it('refuses a single row the same way', async () => { + const { es } = await introspectedClient({ id: 1, action: envelope }) + const { data, error } = await es + .from('audit_log') + .select('id, action') + .single() + + expect(data).toBeNull() + expect(error?.message).toContain('"action"') + }) + + it.each([ + ['without the envelope keys', { v: 3, note: 'not ciphertext' }], + ['with v, i and c but no table/column identifier', { v: 1, i: {}, c: 'x' }], + ['with a null identifier', { v: 1, i: null, c: 'x' }], + ])('leaves a plaintext jsonb value %s alone', async (_label, meta) => { + const rows = [{ id: 1, meta }] + const { es } = await introspectedClient(rows) + const { data, error } = await es.from('audit_log').select('id, meta') + + expect(error).toBeNull() + expect(data).toEqual(rows) + }) +}) diff --git a/languages/typescript/packages/stack-supabase/integration/plaintext-table.integration.test.ts b/languages/typescript/packages/stack-supabase/integration/plaintext-table.integration.test.ts new file mode 100644 index 0000000000..8d73e15dc5 --- /dev/null +++ b/languages/typescript/packages/stack-supabase/integration/plaintext-table.integration.test.ts @@ -0,0 +1,161 @@ +import { encryptedTable, types } from '@cipherstash/stack/eql/v3' +import { databaseUrl } from '@cipherstash/test-kit' +import postgres from 'postgres' +import { afterAll, beforeAll, describe, expect, it } from 'vitest' +import { encryptedSupabase } from '../src/index.js' +import { makePostgrestClient, reloadSchemaCache } from './helpers/pgrest' + +/** + * Reads and returning mutations on a table with NO encrypted columns. + * + * Such a table is reachable through `from()` but is deliberately left out of + * `Encryption({ schemas })`, and the real client refuses a model operation on a + * table it was not initialized with. Every read of one used to fail with + * "decryptModel received a table this client was not initialized with" — a + * failure the unit suites could not see, because their encryption double + * ignores the table argument. This suite runs the real client. + * + * Both construction modes, because the plaintext table reaches the builder by + * a different route in each: discovered by introspection, or declared with an + * empty column set. + */ +const suffix = Math.random().toString(36).slice(2, 8) +const SECRETS = `v3_it_secrets_${suffix}` +const AUDIT = `v3_it_audit_${suffix}` + +const secrets = encryptedTable(SECRETS, { email: types.TextEq('email') }) +const audit = encryptedTable(AUDIT, {}) + +const sql = postgres(databaseUrl(), { prepare: false }) + +beforeAll(async () => { + await sql.unsafe(`DROP TABLE IF EXISTS ${SECRETS}, ${AUDIT}`) + // The encrypted table is not under test. It is here because introspection + // mode refuses a database with no EQL v3 column at all, and this suite must + // not depend on another suite's table still existing. + await sql.unsafe(` + CREATE TABLE ${SECRETS} ( + row_key TEXT PRIMARY KEY, + email public.eql_v3_text_eq + ) + `) + await sql.unsafe(` + CREATE TABLE ${AUDIT} ( + row_key TEXT PRIMARY KEY, + action TEXT NOT NULL + ) + `) + await sql.unsafe( + `GRANT SELECT, INSERT, UPDATE, DELETE ON ${SECRETS}, ${AUDIT} TO anon, authenticated`, + ) + await reloadSchemaCache(sql, SECRETS) + await reloadSchemaCache(sql, AUDIT) +}, 300_000) + +afterAll(async () => { + await sql.unsafe(`DROP TABLE IF EXISTS ${SECRETS}, ${AUDIT}`) + await sql.end() +}) + +describe.each([ + [ + 'introspection mode', + 'i', + () => + encryptedSupabase(makePostgrestClient(), { databaseUrl: databaseUrl() }), + ], + [ + 'declared mode', + 'd', + () => + encryptedSupabase(makePostgrestClient(), { + schemas: { [SECRETS]: secrets, [AUDIT]: audit } as never, + }), + ], +] as const)('plaintext table — %s', (mode, key, build) => { + // biome-ignore lint/suspicious/noExplicitAny: the row type is not declared here + let instance: any + + beforeAll(async () => { + instance = await build() + await sql.unsafe(`DELETE FROM ${AUDIT}`) + }, 300_000) + + it('returns the inserted row from a returning insert', async () => { + const { data, error } = await instance + .from(AUDIT) + .insert({ row_key: `${key}1`, action: 'login' }) + .select('row_key, action') + + expect(error).toBeNull() + expect(data).toEqual([{ row_key: `${key}1`, action: 'login' }]) + }) + + it('returns bulk-inserted rows', async () => { + const rows = [ + { row_key: `${key}2`, action: 'logout' }, + { row_key: `${key}3`, action: 'login' }, + ] + const { data, error } = await instance + .from(AUDIT) + .insert(rows) + .select('row_key, action') + + expect(error).toBeNull() + expect(data).toEqual(rows) + }) + + it('reads every row', async () => { + const { data, error } = await instance + .from(AUDIT) + .select('row_key, action') + .order('row_key', { ascending: true }) + + expect(error).toBeNull() + expect(data).toEqual([ + { row_key: `${key}1`, action: 'login' }, + { row_key: `${key}2`, action: 'logout' }, + { row_key: `${key}3`, action: 'login' }, + ]) + }) + + it('reads a single row with a plaintext filter', async () => { + const { data, error } = await instance + .from(AUDIT) + .select('row_key, action') + .eq('row_key', `${key}2`) + .single() + + expect(error).toBeNull() + expect(data).toEqual({ row_key: `${key}2`, action: 'logout' }) + }) + + it('still round-trips the encrypted table on the same instance', async () => { + const { data, error } = await instance + .from(SECRETS) + .insert({ row_key: `${key}1`, email: 'a@example.com' }) + .select('row_key, email') + + expect(error).toBeNull() + expect(data).toEqual([{ row_key: `${key}1`, email: 'a@example.com' }]) + }) + + // Declared mode has no introspected column list to expand `*` from, so it + // refuses `select('*')` for a plaintext table exactly as for an encrypted + // one. Asserted rather than skipped: the integration suites must not skip. + it('reads with select("*") only where a column list exists', async () => { + if (mode === 'declared mode') { + expect(() => instance.from(AUDIT).select('*')).toThrow( + /does not support select\('\*'\)/, + ) + return + } + const { data, error } = await instance + .from(AUDIT) + .select('*') + .eq('row_key', `${key}1`) + + expect(error).toBeNull() + expect(data).toEqual([{ row_key: `${key}1`, action: 'login' }]) + }) +}) diff --git a/languages/typescript/packages/stack-supabase/src/column-map.ts b/languages/typescript/packages/stack-supabase/src/column-map.ts index debeba4eb8..132bb7aab9 100644 --- a/languages/typescript/packages/stack-supabase/src/column-map.ts +++ b/languages/typescript/packages/stack-supabase/src/column-map.ts @@ -80,6 +80,21 @@ export function isV3ColumnLike(builder: unknown): builder is V3ColumnLike { ) } +/** + * Whether a table carries at least one encrypted column — the ONE rule for + * "is this a plaintext table". + * + * `create.ts` hands `Encryption({ schemas })` only the tables for which this is + * true, and the query pipeline (`ColumnMap.hasEncryptedColumns`) keeps every + * other table away from the encryption client. Both engines refuse a model + * operation on a table they were not initialized with, so the two must agree, + * or every read of the affected tables fails with "decryptModel received a + * table this client was not initialized with". + */ +export function tableHasEncryptedColumns(table: AnyV3Table): boolean { + return Object.keys(table.columnBuilders).length > 0 +} + /** * Reject a declared property name that is also a DIFFERENT physical column. * @@ -131,6 +146,10 @@ export class ColumnMap { * Filters and select strings address columns by both, so recognition must * cover both. */ readonly encryptedColumnNames: string[] + /** False for a plaintext table, which the encrypt and decrypt steps must keep + * away from the encryption client. Read from {@link tableHasEncryptedColumns}, + * the same rule `create.ts` uses to choose what `Encryption` receives. */ + readonly hasEncryptedColumns: boolean /** DB column name → JS property name — the inverse of {@link propToDb}, used * to expand `select('*')` back into property names. Null prototype: a DB @@ -195,6 +214,7 @@ export class ColumnMap { } this.encryptedColumnNames = Object.keys(this.v3Columns) + this.hasEncryptedColumns = tableHasEncryptedColumns(table) } /** Resolve a JS property name to its DB column name. `Object.hasOwn` guards diff --git a/languages/typescript/packages/stack-supabase/src/create.ts b/languages/typescript/packages/stack-supabase/src/create.ts index 14fd23ec42..2e270a39e1 100644 --- a/languages/typescript/packages/stack-supabase/src/create.ts +++ b/languages/typescript/packages/stack-supabase/src/create.ts @@ -1,6 +1,7 @@ import { hasBuildColumnKeyMap, logger } from '@cipherstash/stack/adapter-kit' import type { EncryptionClient } from '@cipherstash/stack/encryption' import type { AnyV3Table } from '@cipherstash/stack/eql/v3' +import { tableHasEncryptedColumns } from './column-map' import type { IntrospectionData, UnmodelledColumn } from './introspect' import { EncryptedQueryBuilderImpl } from './query-builder' import type { SynthesizedSchema } from './schema-builder' @@ -421,13 +422,11 @@ async function construct( } // 5. Build the raw (eqlVersion 3) encryption client from the merged tables. - // NB: the query builder consumes the raw chainable `EncryptionClient`, and - // calls `decryptModel(row)` with no table — the typed client degrades to - // nominal (passthrough) behaviour for that arity, so either shape works. - // Pass only tables that carry at least one encrypted column (`Encryption` - // requires a non-empty schema list). + // Pass only tables that carry at least one encrypted column: `Encryption` + // requires a non-empty schema list, and the query builder keeps plaintext + // tables away from the client (see `tableHasEncryptedColumns`). const encryptionSchemas = [...synth.tables.values()].filter( - (t) => Object.keys(t.columnBuilders).length > 0, + tableHasEncryptedColumns, ) // A database with no modelled EQL v3 columns anywhere would hand `Encryption` diff --git a/languages/typescript/packages/stack-supabase/src/query-builder.ts b/languages/typescript/packages/stack-supabase/src/query-builder.ts index 2c69841568..8dbd0fd878 100644 --- a/languages/typescript/packages/stack-supabase/src/query-builder.ts +++ b/languages/typescript/packages/stack-supabase/src/query-builder.ts @@ -1,5 +1,7 @@ import type { AuditConfig } from '@cipherstash/stack/adapter-kit' import { + describeFailure, + likeWildcardError, logger, parseSelectorSegments, reconstructSelectorDocument, @@ -594,12 +596,12 @@ export class EncryptedQueryBuilderImpl< ...ctx, selectColumns: this.selectColumns, resultMode: this.resultMode, - hasMutation: this.mutation !== null, } satisfies DecryptContext) } catch (err) { const message = err instanceof Error ? err.message : String(err) + // Log-safe: see describeFailure. The full message goes back in `error`. logger.error( - `Supabase encrypted query failed on table "${this.tableName}": ${message}`, + `Supabase encrypted query failed on table "${this.tableName}" (${describeFailure(err)}).`, ) // A failure inside any of the encrypt/decrypt steps above is thrown as an @@ -894,7 +896,7 @@ export class EncryptedQueryBuilderImpl< const { needle, hasUnsupportedWildcard } = parseLikeNeedle(pattern) if (hasUnsupportedWildcard) { throw new Error( - `[supabase v3]: "${op}" pattern "${pattern}" on encrypted column "${column}" has wildcards fuzzy free-text matching cannot honor (an unescaped internal "%" or any unescaped "_"). Use matches("${column}", term) with a literal search term.`, + `[supabase v3]: "${op}" on encrypted column "${column}": ${likeWildcardError(pattern)} Escape a literal "%" or "_" as "\\%" or "\\_", or use matches("${column}", term) with a literal search term.`, ) } const key = `${op}:${column}` diff --git a/languages/typescript/packages/stack-supabase/src/query-mutation.ts b/languages/typescript/packages/stack-supabase/src/query-mutation.ts index 77da9902b0..7d9024f783 100644 --- a/languages/typescript/packages/stack-supabase/src/query-mutation.ts +++ b/languages/typescript/packages/stack-supabase/src/query-mutation.ts @@ -35,6 +35,9 @@ export async function encryptMutationData( ): Promise | Record[] | null> { if (!mutation) return null if (mutation.kind === 'delete') return null + // A plaintext table has nothing to encrypt or rename, and is not registered + // with the encryption client (see `tableHasEncryptedColumns`). + if (!ctx.columns.hasEncryptedColumns) return mutation.data const data = mutation.data const client = dynamicEncryptionClient(ctx.encryptionClient) diff --git a/languages/typescript/packages/stack-supabase/src/query-results.ts b/languages/typescript/packages/stack-supabase/src/query-results.ts index 8985d93948..b2d2c72ef3 100644 --- a/languages/typescript/packages/stack-supabase/src/query-results.ts +++ b/languages/typescript/packages/stack-supabase/src/query-results.ts @@ -1,9 +1,11 @@ import { DATE_LIKE_CASTS, + isEncryptedPayload, logger, reconstructDatePaths, reconstructDateValue, } from '@cipherstash/stack/adapter-kit' +import { EncryptionErrorTypes } from '@cipherstash/stack/errors' import { selectKeyToDbV3 } from './helpers' import { type EncryptionContext, @@ -33,7 +35,6 @@ export type RawSupabaseResult = { export type DecryptContext = EncryptionContext & { selectColumns: string | null resultMode: ResultMode - hasMutation: boolean } /** @@ -83,6 +84,79 @@ function postprocessDecryptedRow( return dottedKeys.length > 0 ? reconstructDatePaths(out, dottedKeys) : out } +/** + * An EQL payload as stored: {@link isEncryptedPayload} (the predicate model + * decryption uses) plus the `i: { t, c }` table/column identifier every stored + * envelope carries. The identifier check keeps a plaintext jsonb value that + * merely has `v`, `i` and `c` keys from failing a read. + */ +function isStoredEnvelope(value: unknown): boolean { + if (!isEncryptedPayload(value)) return false + const id = (value as { i: unknown }).i as { t?: unknown; c?: unknown } | null + return id !== null && typeof id.t === 'string' && typeof id.c === 'string' +} + +/** + * The key/index chain to the first EQL payload in `value`, or `null` if there + * is none. The chain is built only on a hit, so the scan of a clean row — the + * usual case — allocates nothing per value. + */ +function findEnvelope(value: unknown): Array | null { + if (isStoredEnvelope(value)) return [] + if (value === null || typeof value !== 'object') return null + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + const found = findEnvelope(value[i]) + if (found !== null) return [i, ...found] + } + return null + } + for (const key in value) { + const found = findEnvelope((value as Record)[key]) + if (found !== null) return [key, ...found] + } + return null +} + +/** + * Name where an envelope sits without naming any data: the row index of an + * array result and the top-level column or relation that holds it, e.g. + * `[0].users`. Both come from the select string, so they are schema. Keys + * below that level can be a jsonb document's own keys — user data — and are + * never rendered, because the message reaches the logger. + */ +function renderLocation(chain: Array): string { + const column = chain.findIndex((step) => typeof step === 'string') + const kept = column === -1 ? chain : chain.slice(0, column + 1) + if (kept.length === 0) return '(the whole row)' + return kept + .map((step) => (typeof step === 'number' ? `[${step}]` : `.${step}`)) + .join('') + .replace(/^\./, '') +} + +/** + * Refuse a plaintext table's rows if any of them carries ciphertext. + * + * A table with no encrypted columns skips decryption, but its rows can still + * hold an EQL payload: from an embedded relation to an encrypted table + * (`select('id, users(email)')`), or from a table declared with `{}` in declared + * mode whose real columns are `eql_v3_*` domains. Passing those through would + * hand the caller ciphertext typed as data — the hazard `assertTableIsModelled` + * exists to prevent — so fail instead. The message names the column, never a + * value or a key inside one. + */ +function assertNoCiphertext(data: unknown, ctx: DecryptContext): void { + const chain = findEnvelope(data) + if (chain === null) return + + const message = `[supabase v3]: table "${ctx.tableName}" has no encrypted columns, but the result holds an encrypted value in "${renderLocation(chain)}". It is not decrypted here: an embedded relation to an encrypted table is not supported (query that table directly), and in declared mode every encrypted column must be declared with a \`types.*\` factory.` + throw new EncryptionFailedError(message, { + type: EncryptionErrorTypes.DecryptionError, + message, + }) +} + /** * Decrypt a PostgREST response into the caller's row type. * @@ -96,60 +170,36 @@ export async function decryptResults( result: RawSupabaseResult, ctx: DecryptContext, ): Promise> { + const respond = (data: TData | null): EncryptedSupabaseResponse => ({ + data, + error: null, + count: result.count ?? null, + status: result.status, + statusText: result.statusText, + }) + // If there's an error from Supabase, pass it through if (result.error) { - return { - data: null, - error: { - message: result.error.message, - details: result.error.details, - hint: result.error.hint, - code: result.error.code, - }, - count: result.count ?? null, - status: result.status, - statusText: result.statusText, - } + const { message, details, hint, code } = result.error + return { ...respond(null), error: { message, details, hint, code } } } // No data to decrypt - if (result.data === null || result.data === undefined) { - return { - data: null, - error: null, - count: result.count ?? null, - status: result.status, - statusText: result.statusText, - } - } + if (result.data === null || result.data === undefined) return respond(null) - // Determine if we need to decrypt - const hasSelect = ctx.selectColumns !== null - const hasMutationWithReturning = ctx.hasMutation && hasSelect - - if (!hasSelect && !hasMutationWithReturning) { - // No select means no data to decrypt (e.g., insert without .select()) - return { - data: result.data as TData, - error: null, - count: result.count ?? null, - status: result.status, - statusText: result.statusText, - } + // No select means no row data to decrypt (e.g. insert without .select()). + if (ctx.selectColumns === null) return respond(result.data as TData) + + // A plaintext table has nothing to decrypt and is not registered with the + // encryption client (see `tableHasEncryptedColumns`), so its rows are + // returned as sent — once they are shown to hold no ciphertext. + if (!ctx.columns.hasEncryptedColumns) { + assertNoCiphertext(result.data, ctx) + return respond(result.data as TData) } // Decrypt based on result mode if (ctx.resultMode === 'single' || ctx.resultMode === 'maybeSingle') { - if (result.data === null) { - return { - data: null, - error: null, - count: result.count ?? null, - status: result.status, - statusText: result.statusText, - } - } - // Single result — decrypt one model const decrypted = await withOpContext( // The table is passed for the WASM engine, which resolves date fields @@ -173,31 +223,19 @@ export async function decryptResults( ) } - return { - // ONE row — `TData` is `T` on this path (`single`/`maybeSingle` narrow it), - // so no array wrapping and no cast pretending otherwise. - data: postprocessDecryptedRow( + // ONE row — `TData` is `T` on this path (`single`/`maybeSingle` narrow it), + // so no array wrapping and no cast pretending otherwise. + return respond( + postprocessDecryptedRow( decrypted.data as Record, ctx, ) as TData, - error: null, - count: result.count ?? null, - status: result.status, - statusText: result.statusText, - } + ) } // Array result — bulk decrypt const dataArray = result.data as Record[] - if (dataArray.length === 0) { - return { - data: [] as TData, - error: null, - count: result.count ?? null, - status: result.status, - statusText: result.statusText, - } - } + if (dataArray.length === 0) return respond([] as TData) const decrypted = await withOpContext( // Table passed for the same reason as the single-row path above. @@ -215,13 +253,9 @@ export async function decryptResults( ) } - return { - data: decrypted.data.map((row) => + return respond( + decrypted.data.map((row) => postprocessDecryptedRow(row as Record, ctx), ) as TData, - error: null, - count: result.count ?? null, - status: result.status, - statusText: result.statusText, - } + ) } diff --git a/languages/typescript/packages/stack/__tests__/describe-failure.test.ts b/languages/typescript/packages/stack/__tests__/describe-failure.test.ts new file mode 100644 index 0000000000..328a25f20f --- /dev/null +++ b/languages/typescript/packages/stack/__tests__/describe-failure.test.ts @@ -0,0 +1,81 @@ +import { describe, expect, it } from 'vitest' +import { describeFailure } from '@/utils/logger/describe-failure' + +// `describeFailure` is what adapters log in place of an error's message, which +// may quote a plaintext value (CIP-5161). Everything it returns must come from +// a fixed allowlist, never from the error, however identifier-like the error's +// fields look. +describe('describeFailure', () => { + it('names an Error by its class, never its message', () => { + expect(describeFailure(new TypeError('value "Qzx" is bad'))).toBe( + 'TypeError', + ) + }) + + it('appends known type, code and authCode identifiers', () => { + const err = Object.assign(new Error('boom Qzx'), { + type: 'EncryptionError', + code: 'UNKNOWN_COLUMN', + authCode: 'USAGE_LIMIT_EXCEEDED', + }) + expect(describeFailure(err)).toBe( + 'Error: EncryptionError: UNKNOWN_COLUMN: USAGE_LIMIT_EXCEEDED', + ) + }) + + it('reads identifiers from a nested encryptionError', () => { + const err = Object.assign(new Error('Qzx'), { + name: 'EncryptionFailedError', + encryptionError: { + type: 'EncryptionError', + message: 'Qzx', + authCode: 'USAGE_LIMIT_EXCEEDED', + }, + }) + expect(describeFailure(err)).toBe( + 'EncryptionFailedError: EncryptionError: USAGE_LIMIT_EXCEEDED', + ) + }) + + // An identifier-shaped field can still hold caller data, so the shape is not + // the test: only known values pass. + it('drops identifier-shaped values that are not known codes', () => { + const err = Object.assign(new Error('invalid value'), { + code: 'Qzx-secret-wvy', + type: 'alice.smith', + authCode: '123-45-6789', + }) + expect(describeFailure(err)).toBe('Error') + expect(describeFailure({ code: 'Qzx_secret', message: 'x' })).toBe('object') + expect(describeFailure({ code: 42883 })).toBe('object') + }) + + it('reports an unknown error class as Error', () => { + const renamed = new Error('x') + renamed.name = 'QzxSecret' + expect(describeFailure(renamed)).toBe('Error') + }) + + it('describes a non-object by its type', () => { + expect(describeFailure('Qzx')).toBe('string') + expect(describeFailure(null)).toBe('null') + expect(describeFailure(undefined)).toBe('undefined') + }) + + // Called from inside a catch: if describing the failure threw, Supabase would + // reject instead of returning `{ error }`, and DynamoDB would skip its + // errorHandler. + it('returns a fixed description when reading the error throws', () => { + const err = new Error('x') + Object.defineProperty(err, 'type', { + get() { + throw new Error('getter Qzx') + }, + }) + expect(describeFailure(err)).toBe('unknown failure') + + const { proxy, revoke } = Proxy.revocable({}, {}) + revoke() + expect(describeFailure(proxy)).toBe('unknown failure') + }) +}) diff --git a/languages/typescript/packages/stack/__tests__/dynamodb/resolve-decrypt.test.ts b/languages/typescript/packages/stack/__tests__/dynamodb/resolve-decrypt.test.ts index 4d80c8f6ec..5873cc6945 100644 --- a/languages/typescript/packages/stack/__tests__/dynamodb/resolve-decrypt.test.ts +++ b/languages/typescript/packages/stack/__tests__/dynamodb/resolve-decrypt.test.ts @@ -446,6 +446,47 @@ describe('handleError', () => { expect(rethrow('ECONNRESET').code).toBe('DYNAMODB_ENCRYPTION_ERROR') }) + // The message may quote a plaintext value (CIP-5161). It is returned to the + // caller on the error, but the library's own log names only the failure kind. + const leakyFailure = () => + Object.assign(new Error('value "Qzx-secret-wvy" rejected'), { + code: 'UNKNOWN_COLUMN', + }) + + it('logs the failure kind and code, never the message', () => { + const error = handleError(leakyFailure(), 'encryptModel') + + expect(error.message).toContain('Qzx-secret-wvy') + const logged = errorLog.mock.calls.flat().join('\n') + expect(logged).toContain('encryptModel') + expect(logged).toContain('UNKNOWN_COLUMN') + expect(logged).not.toContain('Qzx') + }) + + // `options.logger` is a log sink the caller wires to `console` or a log + // service, so it gets the same log-safe description as the shared logger. + // The full message stays on the returned error and on `errorHandler`'s. + it('hands the configured logger a log-safe error, and errorHandler the full one', () => { + const logged: unknown[] = [] + const handled: Error[] = [] + + const error = handleError(leakyFailure(), 'encryptModel', { + logger: { error: (message, err) => logged.push(message, err) }, + errorHandler: (err) => handled.push(err), + }) + + expect(error.message).toContain('Qzx-secret-wvy') + expect(handled[0]?.message).toContain('Qzx-secret-wvy') + const [message, loggedError] = logged as [string, Error & { code: string }] + expect(message).toContain('encryptModel') + expect(loggedError).toBeInstanceOf(Error) + expect(loggedError.code).toBe('UNKNOWN_COLUMN') + expect( + [message, loggedError.message, String(loggedError.stack)].join('\n'), + ).not.toContain('Qzx') + expect(loggedError.message).toContain('UNKNOWN_COLUMN') + }) + it('extracts the message from an Error, a plain object, or anything else', () => { expect( handleError(new Error('from an Error'), 'decryptModel').message, @@ -463,7 +504,7 @@ describe('handleError', () => { expect(handleError(null, 'decryptModel').message).toBe('null') }) - it('hands the constructed error to both the errorHandler and the caller logger', () => { + it('hands the constructed error to the errorHandler and a log-safe copy to the caller logger', () => { const seen: unknown[] = [] const callerLog = { error: vi.fn() } @@ -478,7 +519,16 @@ describe('handleError', () => { // classified one. expect(seen).toHaveLength(1) expect(seen[0]).toBe(error) - expect(callerLog.error).toHaveBeenCalledWith('Error in decryptModel', error) + // The logger gets a copy with the same code but a log-safe message + // (CIP-5161), not the caller's error. + expect(callerLog.error).toHaveBeenCalledWith( + 'Error in decryptModel', + expect.objectContaining({ + code: error.code, + message: expect.stringContaining('DynamoDB error in decryptModel'), + }), + ) + expect(callerLog.error.mock.calls[0][1]).not.toBe(error) expect(errorLog).toHaveBeenCalledWith( expect.stringContaining('DynamoDB error in decryptModel'), ) diff --git a/languages/typescript/packages/stack/__tests__/dynamodb/v2-type-coverage.test.ts b/languages/typescript/packages/stack/__tests__/dynamodb/v2-type-coverage.test.ts index 73e5e5a523..bac4867d21 100644 --- a/languages/typescript/packages/stack/__tests__/dynamodb/v2-type-coverage.test.ts +++ b/languages/typescript/packages/stack/__tests__/dynamodb/v2-type-coverage.test.ts @@ -641,6 +641,87 @@ describe('a stored v2 JSON document', () => { }) }) +/** + * What protect-dynamodb ACTUALLY wrote for a JSON attribute — and why Stack 1.x + * cannot read it. + * + * The `{ h, sv }` item above is the shape a SteVec document takes on DynamoDB, + * but `@cipherstash/schema@2.0.2` (the schema package protect-dynamodb 6.x was + * authored against) never enabled `searchableJson`: a `dataType('json')` column + * carried no `ste_vec` index, so protect-ffi stored the document as an ordinary + * scalar record and the adapter wrote its `c` — a Base85 STRING — to + * `__source`, exactly like a text column. + * + * EQL v3 has no index-less JSON domain: `types.Json` always carries `ste_vec`, + * so the reader takes the SteVec branch and reads `h` / `sv` off a string. Both + * are `undefined`, the stored ciphertext is never forwarded, and the read fails. + * + * This pins that GAP, not a contract. A legacy scalar JSON attribute has to be + * read some other way (e.g. `client.decrypt()` on a rebuilt `{ v: 2, k: 'ct' }` + * envelope). When a reader for it lands, this case should flip to asserting the + * document comes back. + */ +describe('a legacy scalar JSON attribute, as protect-dynamodb wrote it', () => { + const docs = encryptedTable('docs', { meta: types.Json('meta') }) + + it('drops the stored ciphertext and fails the read', async () => { + const { dynamo, received } = ffiStub({ + // A trap: were the stored ciphertext forwarded, this fixture would make + // the decrypt succeed and fail the test. Today the rebuilt envelope + // carries none, so the stub's missing-fixture guard raises the failure. + wire: { 'scalar-json-ct': { user: 'ada@example.com' } }, + tables: [docs], + }) + + const result = await dynamo.decryptModel( + { pk: 'doc#1', meta__source: 'scalar-json-ct' }, + docs, + { storedEqlVersion: 2 }, + ) + + // The envelope handed down carries neither the stored `c` nor a usable + // `h` / `sv`: the ciphertext is lost before it reaches the FFI. + expect(received[0]).toEqual({ + pk: 'doc#1', + meta: { i: { c: 'meta', t: 'docs' }, v: 2, k: 'sv' }, + }) + expect(JSON.stringify(received[0])).not.toContain('scalar-json-ct') + expect(result.failure).toBeDefined() + }) +}) + +/** + * The one way a legacy read returns gibberish instead of failing: a stored + * `__source` whose stem no longer matches a property key in the v3 + * `encryptedTable` (a rename) is not an envelope, so it is passed through as its + * raw ciphertext string inside a SUCCESSFUL `{ data }`. `helpers-v3.test.ts` + * pins the debug log at the helper level; this pins what the caller sees. + */ +describe('a renamed property key on a legacy read', () => { + const users = encryptedTable('users', { + givenName: types.TextEq('first_name'), + }) + + it('returns the raw ciphertext under the old attribute name, with no failure', async () => { + const { dynamo, received } = ffiStub({ wire: {}, tables: [users] }) + const stored = { + pk: 'user#1', + firstName__source: 'raw-base85-ct', + firstName__hmac: 'stored-hmac', + } + + const decrypted = unwrapResult( + await dynamo.decryptModel(stored, users, { storedEqlVersion: 2 }), + ) + + // Nothing was recognised as encrypted, so nothing reached the FFI as one, + // and the item comes back exactly as stored. + expect(received[0]).toEqual(stored) + expect(decrypted).toEqual(stored) + expect(decrypted).not.toHaveProperty('givenName') + }) +}) + // --------------------------------------------------------------------------- // bigint // --------------------------------------------------------------------------- diff --git a/languages/typescript/packages/stack/__tests__/match-needle-guard.test.ts b/languages/typescript/packages/stack/__tests__/match-needle-guard.test.ts index 664cac7e60..5fca1c0862 100644 --- a/languages/typescript/packages/stack/__tests__/match-needle-guard.test.ts +++ b/languages/typescript/packages/stack/__tests__/match-needle-guard.test.ts @@ -1,6 +1,10 @@ import { describe, expect, it } from 'vitest' import type { MatchIndexOpts } from '@/schema/internal' -import { matchNeedleError, matchNeedleMinLength } from '@/schema/match-defaults' +import { + likeWildcardError, + matchNeedleError, + matchNeedleMinLength, +} from '@/schema/match-defaults' // The floor a free-text needle must clear before it yields any ngram. A needle // below it tokenizes to nothing, so its bloom filter is EMPTY — and @@ -28,9 +32,21 @@ describe('matchNeedleError', () => { expect(matchNeedleError('lovelace', ngram)).toBeUndefined() }) - it('rejects a needle below the floor, naming the floor and the term', () => { + it('rejects a needle below the floor, naming the floor and the length', () => { expect(matchNeedleError('ad', ngram)).toMatch(/at least 3 characters/) - expect(matchNeedleError('ad', ngram)).toMatch(/"ad"/) + expect(matchNeedleError('ad', ngram)).toMatch(/has 2\b/) + }) + + // The search term is plaintext: a caller searching an encrypted column is + // searching for something sensitive. Adapters throw this reason to the caller + // and some log it, so it must never carry the term itself — only its length. + it('never echoes the search term in the message', () => { + for (const needle of ['Qz', 'Q', '\u{1F512}X', '"z']) { + const reason = matchNeedleError(needle, ngram) + expect(reason, needle).toBeTypeOf('string') + expect(reason, needle).not.toContain(needle) + expect(reason, needle).not.toContain(JSON.stringify(needle)) + } }) // The tokenizer counts Unicode CODEPOINTS. `'👍👍'` is 2 codepoints but 4 @@ -91,3 +107,16 @@ describe('matchNeedleError', () => { expect(matchNeedleError(null, ngram)).toBeUndefined() }) }) + +// Shared by the Supabase and Prisma like/ilike shims so neither can quote the +// pattern (CIP-5161): it is the caller's plaintext search term. +describe('likeWildcardError', () => { + it('names the wildcard problem and the pattern length in codepoints, never the pattern', () => { + for (const pattern of ['Qzx%wvy', 'Qzx_wvy', '\u{1F512}%Qz']) { + const reason = likeWildcardError(pattern) + expect(reason, pattern).toMatch(/cannot honor/) + expect(reason, pattern).toContain(`${[...pattern].length}-character`) + expect(reason, pattern).not.toContain('Qz') + } + }) +}) diff --git a/languages/typescript/packages/stack/package.json b/languages/typescript/packages/stack/package.json index f0fae33fa4..7ce53b3581 100644 --- a/languages/typescript/packages/stack/package.json +++ b/languages/typescript/packages/stack/package.json @@ -206,7 +206,7 @@ "devDependencies": { "@cipherstash/eql": "workspace:^", "@clack/prompts": "^1.8.1", - "@clerk/backend": "3.26.0", + "@clerk/backend": "3.26.5", "@supabase/postgrest-js": "2.118.0", "@supabase/supabase-js": "^2.118.0", "@types/pg": "^8.23.1", diff --git a/languages/typescript/packages/stack/src/adapter-kit.ts b/languages/typescript/packages/stack/src/adapter-kit.ts index 754d8c590e..7229956723 100644 --- a/languages/typescript/packages/stack/src/adapter-kit.ts +++ b/languages/typescript/packages/stack/src/adapter-kit.ts @@ -18,9 +18,13 @@ * The full member list is small on purpose; every addition is an audit decision. */ -// Model → encrypted-PG-composite helpers used by the v2 Supabase mutation path. +// Model → encrypted-PG-composite helpers used by the v2 Supabase mutation path, +// and `isEncryptedPayload`, the predicate model decryption uses to find +// ciphertext in a row — for adapters that must refuse a row they pass through +// undecrypted. export { bulkModelsToEncryptedPgComposites, + isEncryptedPayload, modelToEncryptedPgComposites, } from './encryption/helpers/index.js' @@ -65,7 +69,10 @@ export { unsupportedLeafReason, } from './eql/v3/selector-path.js' // Shared match-index guard (short-needle rejection), reused by both adapters. -export { matchNeedleError } from './schema/match-defaults.js' +export { + likeWildcardError, + matchNeedleError, +} from './schema/match-defaults.js' // The canonical EQL v2/v3 table discriminator. Added because the adapters must // make the same routing decision core does, and that function's own doctrine is // that every site routes through it — "a second hand-written spelling of the @@ -74,5 +81,8 @@ export { matchNeedleError } from './schema/match-defaults.js' // `./types`: deciding which wire version a table targets is adapter plumbing, // not something an end user should be reaching for. export { hasBuildColumnKeyMap } from './types.js' +// Log-safe failure description: adapters log an error's kind, never its +// message, which may quote a plaintext value. +export { describeFailure } from './utils/logger/describe-failure.js' // Shared structured logger (adapters log rejections through the same instance). export { logger } from './utils/logger/index.js' diff --git a/languages/typescript/packages/stack/src/dynamodb/helpers.ts b/languages/typescript/packages/stack/src/dynamodb/helpers.ts index 76f94f1155..85b4f05ce9 100644 --- a/languages/typescript/packages/stack/src/dynamodb/helpers.ts +++ b/languages/typescript/packages/stack/src/dynamodb/helpers.ts @@ -4,6 +4,7 @@ import { resolveEncryptColumnMap } from '@/encryption/helpers/model-helpers' import { DATE_LIKE_CASTS } from '@/eql/v3/columns' import type { EncryptedValue } from '@/types' import { logger } from '@/utils/logger' +import { describeFailure } from '@/utils/logger/describe-failure' import type { AnyEncryptedTable, EncryptedDynamoDBError } from './types' export const ciphertextAttrSuffix = '__source' @@ -68,14 +69,21 @@ export function handleError( context, }) - logger.error(`DynamoDB error in ${context}: ${errorMessage}`) + // Log-safe: see describeFailure. `options.logger` is a log sink too, so it + // gets a copy carrying the description; the full message stays on the + // returned error and reaches `errorHandler`. + const description = `DynamoDB error in ${context} (${describeFailure(error)}).` + logger.error(description) if (options?.errorHandler) { options.errorHandler(dynamoError) } if (options?.logger) { - options.logger.error(`Error in ${context}`, dynamoError) + options.logger.error( + `Error in ${context}`, + new EncryptedDynamoDBErrorImpl(description, errorCode, { context }), + ) } return dynamoError diff --git a/languages/typescript/packages/stack/src/schema/match-defaults.ts b/languages/typescript/packages/stack/src/schema/match-defaults.ts index 1ce3380882..807dd0897a 100644 --- a/languages/typescript/packages/stack/src/schema/match-defaults.ts +++ b/languages/typescript/packages/stack/src/schema/match-defaults.ts @@ -127,6 +127,10 @@ export function matchNeedleMinLength(opts: MatchIndexOpts): number | undefined { * measuring what its tokenizer actually receives: v2 needles carry SQL wildcards * (`'%ada%'`), so the floor may have to apply to the unwrapped term rather than * to the string the caller passed. + * + * The message never quotes the needle: it is the caller's plaintext search + * term, and every adapter throws this reason to its caller, who may log it. It + * reports the length, which is what the caller needs to fix the query. */ export function matchNeedleError( needle: unknown, @@ -142,5 +146,17 @@ export function matchNeedleError( return `free-text search needs a non-empty search term; an empty term produces no tokens and would match every row.` } if (min === undefined || length >= min) return undefined - return `free-text search needs at least ${min} characters (the index tokenizer's token_length), but the search term ${JSON.stringify(needle)} has ${length}. A shorter term produces no tokens and would match every row.` + return `free-text search needs at least ${min} characters (the index tokenizer's token_length), but the search term has ${length}. A shorter term produces no tokens and would match every row.` +} + +/** + * The reason a free-text `like`/`ilike` pattern was rejected for carrying a + * wildcard the bloom tokenizer cannot honour (an interior `%` or a `_`, which it + * would treat as an ordinary character and so silently match nothing). + * + * Only the pattern's length appears: it is plaintext, and callers may log the + * message. Adapters prefix their surface and append their own remedy. + */ +export function likeWildcardError(pattern: string): string { + return `the ${[...pattern].length}-character search pattern has wildcards fuzzy free-text matching cannot honor (an interior "%" or a "_").` } diff --git a/languages/typescript/packages/stack/src/utils/logger/describe-failure.ts b/languages/typescript/packages/stack/src/utils/logger/describe-failure.ts new file mode 100644 index 0000000000..3a86e9bb46 --- /dev/null +++ b/languages/typescript/packages/stack/src/utils/logger/describe-failure.ts @@ -0,0 +1,130 @@ +// Type-only imports: adapter-kit must stay importable without loading the +// native binding or the auth module, so the allowlists below are written out +// as `Record`s over the code unions, which makes the compiler prove them +// complete. +import type { AuthErrorCode } from '@cipherstash/auth' +import type { ProtectErrorCode } from '@cipherstash/protect-ffi' +import { EncryptionErrorTypes } from '@/errors' + +/** + * A log-safe description of a failure, for an adapter's error log. + * + * An adapter's catch sees errors from every layer below it (query validation, + * encryption, the database client, the network), and any of their messages may + * quote a plaintext value. The library promises never to log plaintext, so an + * error log names the failure's KIND, never its message. + * + * Everything in the result comes from a fixed allowlist, never from the error: + * + * - the error class, when it is a built-in JS error or one of this library's + * error classes, else `Error` (or `typeof` for a non-Error value); + * - the error's `type`, `code` and `authCode`, and those of a nested + * `encryptionError` (the Supabase adapter's `EncryptionFailedError`), when + * each is a known {@link EncryptionErrorTypes} value, FFI error code + * (`PROTECT_ERROR_CODES`) or auth code (`AuthErrorCode`). + * + * Any other value is dropped, however harmless it looks: a field that merely + * looks like an identifier can still hold caller data. If reading the error + * throws (a throwing getter, a revoked proxy), the result is `unknown failure`, + * so describing a failure never becomes a second failure. + * + * @example + * describeFailure(new TypeError('value "x" is bad')) // 'TypeError' + * describeFailure(Object.assign(new Error('…'), { code: 'UNKNOWN_COLUMN' })) + * // 'Error: UNKNOWN_COLUMN' + */ +export function describeFailure(err: unknown): string { + try { + const ids = [ + ...identifiersOf(err), + ...identifiersOf(fieldOf(err, 'encryptionError')), + ] + return [kindOf(err), ...new Set(ids)].join(': ') + } catch { + return 'unknown failure' + } +} + +// Any other name is reported as plain `Error`. +const ERROR_CLASSES: ReadonlySet = new Set([ + 'AggregateError', + 'EvalError', + 'RangeError', + 'ReferenceError', + 'SyntaxError', + 'TypeError', + 'URIError', + // This library's own error classes. + 'EncryptedDynamoDBError', + 'EncryptionFailedError', +]) + +// A `Record` over each union, so the compiler rejects a missing or unknown code. +const FFI_ERROR_CODES: Record = { + INVARIANT_VIOLATION: true, + UNKNOWN_QUERY_OP: true, + UNKNOWN_COLUMN: true, + MISSING_INDEX: true, + INVALID_QUERY_INPUT: true, + SHORT_MATCH_NEEDLE: true, + INVALID_JSON_PATH: true, + STE_VEC_REQUIRES_JSON_CAST_AS: true, + MATCH_REQUIRES_TEXT: true, + UNSUPPORTED_CONFIG_VERSION: true, + INVALID_EQL_VERSION: true, + EQL_V3_UNSUPPORTED_COLUMN: true, + EQL_V3_CONVERSION_FAILED: true, + INVALID_CIPHERTEXT: true, + UNKNOWN: true, +} + +const AUTH_ERROR_CODES: Record = { + REQUEST_ERROR: true, + ACCESS_DENIED: true, + EXPIRED_TOKEN: true, + INVALID_GRANT: true, + INVALID_CLIENT: true, + INVALID_URL: true, + INVALID_REGION: true, + INVALID_TOKEN: true, + USAGE_LIMIT_EXCEEDED: true, + ORG_NOT_PROVISIONED: true, + SERVER_ERROR: true, + NOT_AUTHENTICATED: true, + MISSING_WORKSPACE_CRN: true, + INVALID_ACCESS_KEY: true, + INVALID_CRN: true, + WORKSPACE_MISMATCH: true, + INVALID_WORKSPACE_ID: true, + ALREADY_CONSUMED: true, + INTERNAL_ERROR: true, + CUSTOM: true, + STORE_ERROR: true, +} + +const KNOWN_IDENTIFIERS: ReadonlySet = new Set([ + ...Object.values(EncryptionErrorTypes), + ...Object.keys(FFI_ERROR_CODES), + ...Object.keys(AUTH_ERROR_CODES), +]) + +function kindOf(err: unknown): string { + if (err instanceof Error) { + return ERROR_CLASSES.has(err.name) ? err.name : 'Error' + } + return err === null ? 'null' : typeof err +} + +function fieldOf(value: unknown, key: string): unknown { + return typeof value === 'object' && value !== null + ? (value as Record)[key] + : undefined +} + +function identifiersOf(value: unknown): string[] { + return (['type', 'code', 'authCode'] as const) + .map((key) => fieldOf(value, key)) + .filter( + (id): id is string => typeof id === 'string' && KNOWN_IDENTIFIERS.has(id), + ) +} diff --git a/languages/typescript/packages/test-kit/package.json b/languages/typescript/packages/test-kit/package.json index 5ff5b6cb13..61453937e9 100644 --- a/languages/typescript/packages/test-kit/package.json +++ b/languages/typescript/packages/test-kit/package.json @@ -19,7 +19,7 @@ "@cipherstash/stack": "workspace:*" }, "devDependencies": { - "@clerk/backend": "3.26.0", + "@clerk/backend": "3.26.5", "typescript": "catalog:repo", "vitest": "catalog:repo" } diff --git a/languages/typescript/packages/wizard/package.json b/languages/typescript/packages/wizard/package.json index 8b83be7502..4db10593b1 100644 --- a/languages/typescript/packages/wizard/package.json +++ b/languages/typescript/packages/wizard/package.json @@ -30,15 +30,15 @@ "lint": "biome check ." }, "dependencies": { - "@anthropic-ai/claude-agent-sdk": "^0.3.296", - "@anthropic-ai/sdk": "^0.133.0", + "@anthropic-ai/claude-agent-sdk": "^0.3.316", + "@anthropic-ai/sdk": "^0.137.0", "@cipherstash/auth": "workspace:*", "@clack/prompts": "1.8.1", - "@modelcontextprotocol/sdk": "^1.32.1", + "@modelcontextprotocol/sdk": "^1.32.2", "dotenv": "17.4.2", "pg": "8.23.1", "picocolors": "^1.1.1", - "posthog-node": "^5.55.2", + "posthog-node": "^5.61.1", "zod": "^3.25.76" }, "//optionalDependencies": "@cipherstash/auth ships per-platform native bindings as optional peerDependencies. pnpm does not auto-install platform-matched optional peer deps, so we declare them here as optionalDependencies — pnpm then picks the binary matching the host's os/cpu (from each sub-package's own package.json) and ignores the rest. All seven are workspace packages in one changesets `fixed` group, so `workspace:*` packs the same exact version for each.", diff --git a/package.json b/package.json index d8309a4f30..712d9e024d 100644 --- a/package.json +++ b/package.json @@ -42,12 +42,12 @@ "test:scripts": "vitest run --config scripts/vitest.config.mjs" }, "devDependencies": { - "@biomejs/biome": "^2.5.15", + "@biomejs/biome": "^2.6.4", "@changesets/cli": "^2.31.1", "@changesets/parse": "0.4.3", "@types/node": "^22.20.5", "js-yaml": "^4.3.1", - "rimraf": "^6.1.3", + "rimraf": "^6.1.4", "turbo": "2.11.10", "vitest": "catalog:repo" }, diff --git a/packages/eql/Cargo.lock b/packages/eql/Cargo.lock index 870d240704..5a7d968f35 100644 --- a/packages/eql/Cargo.lock +++ b/packages/eql/Cargo.lock @@ -4250,6 +4250,7 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "uuid", + "zeroize", ] [[package]] @@ -4881,9 +4882,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" dependencies = [ "atomic", "getrandom 0.4.2", diff --git a/packages/eql/crates/eql-bindings/bindings/v3/SteVecDocument.ts b/packages/eql/crates/eql-bindings/bindings/v3/SteVecDocument.ts index f0d423fc46..7fc4faecdb 100644 --- a/packages/eql/crates/eql-bindings/bindings/v3/SteVecDocument.ts +++ b/packages/eql/crates/eql-bindings/bindings/v3/SteVecDocument.ts @@ -7,11 +7,20 @@ import type { SteVecForm } from "./SteVecForm"; /** * `public.eql_v3_json_search` — a SteVec encrypted-JSON document - * (`{v, k, i, h, sv:[entry]}`, no root ciphertext — the root document + * (`{v, k, i, h, sv:[entry]}` plus an optional array-root flag `a`, no root ciphertext — the root document * ciphertext lives on the root sv entry). Strict. `k` is the `"sv"` form * discriminator (see [`SteVecForm`]); `h` is the document [`KeyHeader`], * stored once for the whole document (every entry encrypts under the * document's single data key, with per-entry nonces derived from the * entries' selectors). */ -export type SteVecDocument = { v: SchemaVersion, k: SteVecForm, i: Identifier, h: KeyHeader, sv: Array, }; +export type SteVecDocument = { v: SchemaVersion, k: SteVecForm, i: Identifier, h: KeyHeader, sv: Array, +/** + * Array-root marker. The SQL root validator allows it and the array + * accessors (`jsonb_array_length`, `jsonb_array_elements`, `->(doc, int)`) + * REQUIRE it (`eql_v3_internal.is_ste_vec_array`), so a document the + * database accepts must also parse here. Optional and non-nullable: SQL + * rejects `"a": null` (`jsonb_typeof(...) = 'boolean'`), so the schema + * and deserializer reject it too. + */ +a?: boolean, }; diff --git a/packages/eql/crates/eql-bindings/bindings/v3/SteVecEntry.ts b/packages/eql/crates/eql-bindings/bindings/v3/SteVecEntry.ts index 4b23d1c463..1474be670b 100644 --- a/packages/eql/crates/eql-bindings/bindings/v3/SteVecEntry.ts +++ b/packages/eql/crates/eql-bindings/bindings/v3/SteVecEntry.ts @@ -11,11 +11,11 @@ import type { Selector } from "./Selector"; * selector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the * decryption unit is `h` + `s` + `c`, with the document `h` grafted onto * extracted entries by `->`), an optional array-membership marker `a` - * (emitted only when true), and — for ordered (number/string) path entries + * (a boolean; producers emit it only when true), and — for ordered (number/string) path entries * only — the `op` ordering term. Value entries (value-inclusive selectors) * and non-orderable path entries are term-less: exact matching is selector * presence, so no per-entry equality term exists (`hm` is retired). The * optional `i`/`v`/`h` fields model metadata grafted onto an entry returned by * `->`; naming them explicitly keeps unknown keys rejectable. */ -export type SteVecEntry = { s: Selector, c: EntryCiphertext, a?: boolean | null, op?: OpeCllw, i?: Identifier, v?: SchemaVersion, h?: KeyHeader, }; +export type SteVecEntry = { s: Selector, c: EntryCiphertext, a?: boolean, op?: OpeCllw, i?: Identifier, v?: SchemaVersion, h?: KeyHeader, }; diff --git a/packages/eql/crates/eql-bindings/schema/v3/eql_v3_json_entry.json b/packages/eql/crates/eql-bindings/schema/v3/eql_v3_json_entry.json index 346f00bde0..3c12c619a8 100644 --- a/packages/eql/crates/eql-bindings/schema/v3/eql_v3_json_entry.json +++ b/packages/eql/crates/eql-bindings/schema/v3/eql_v3_json_entry.json @@ -44,13 +44,10 @@ "$id": "https://schemas.cipherstash.com/eql/v3/eql_v3_json_entry.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a\nselector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the\ndecryption unit is `h` + `s` + `c`, with the document `h` grafted onto\nextracted entries by `->`), an optional array-membership marker `a`\n(emitted only when true), and — for ordered (number/string) path entries\nonly — the `op` ordering term. Value entries (value-inclusive selectors)\nand non-orderable path entries are term-less: exact matching is selector\npresence, so no per-entry equality term exists (`hm` is retired). The\noptional `i`/`v`/`h` fields model metadata grafted onto an entry returned by\n`->`; naming them explicitly keeps unknown keys rejectable.", + "description": "`public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a\nselector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the\ndecryption unit is `h` + `s` + `c`, with the document `h` grafted onto\nextracted entries by `->`), an optional array-membership marker `a`\n(a boolean; producers emit it only when true), and — for ordered (number/string) path entries\nonly — the `op` ordering term. Value entries (value-inclusive selectors)\nand non-orderable path entries are term-less: exact matching is selector\npresence, so no per-entry equality term exists (`hm` is retired). The\noptional `i`/`v`/`h` fields model metadata grafted onto an entry returned by\n`->`; naming them explicitly keeps unknown keys rejectable.", "properties": { "a": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "c": { "$ref": "#/$defs/EntryCiphertext" diff --git a/packages/eql/crates/eql-bindings/schema/v3/eql_v3_json_search.json b/packages/eql/crates/eql-bindings/schema/v3/eql_v3_json_search.json index 99c8ab2f81..df9fc453e8 100644 --- a/packages/eql/crates/eql-bindings/schema/v3/eql_v3_json_search.json +++ b/packages/eql/crates/eql-bindings/schema/v3/eql_v3_json_search.json @@ -42,13 +42,10 @@ }, "SteVecEntry": { "additionalProperties": false, - "description": "`public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a\nselector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the\ndecryption unit is `h` + `s` + `c`, with the document `h` grafted onto\nextracted entries by `->`), an optional array-membership marker `a`\n(emitted only when true), and — for ordered (number/string) path entries\nonly — the `op` ordering term. Value entries (value-inclusive selectors)\nand non-orderable path entries are term-less: exact matching is selector\npresence, so no per-entry equality term exists (`hm` is retired). The\noptional `i`/`v`/`h` fields model metadata grafted onto an entry returned by\n`->`; naming them explicitly keeps unknown keys rejectable.", + "description": "`public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a\nselector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the\ndecryption unit is `h` + `s` + `c`, with the document `h` grafted onto\nextracted entries by `->`), an optional array-membership marker `a`\n(a boolean; producers emit it only when true), and — for ordered (number/string) path entries\nonly — the `op` ordering term. Value entries (value-inclusive selectors)\nand non-orderable path entries are term-less: exact matching is selector\npresence, so no per-entry equality term exists (`hm` is retired). The\noptional `i`/`v`/`h` fields model metadata grafted onto an entry returned by\n`->`; naming them explicitly keeps unknown keys rejectable.", "properties": { "a": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "c": { "$ref": "#/$defs/EntryCiphertext" @@ -112,8 +109,12 @@ "$id": "https://schemas.cipherstash.com/eql/v3/eql_v3_json_search.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`public.eql_v3_json_search` — a SteVec encrypted-JSON document\n(`{v, k, i, h, sv:[entry]}`, no root ciphertext — the root document\nciphertext lives on the root sv entry). Strict. `k` is the `\"sv\"` form\ndiscriminator (see [`SteVecForm`]); `h` is the document [`KeyHeader`],\nstored once for the whole document (every entry encrypts under the\ndocument's single data key, with per-entry nonces derived from the\nentries' selectors).", + "description": "`public.eql_v3_json_search` — a SteVec encrypted-JSON document\n(`{v, k, i, h, sv:[entry]}` plus an optional array-root flag `a`, no root ciphertext — the root document\nciphertext lives on the root sv entry). Strict. `k` is the `\"sv\"` form\ndiscriminator (see [`SteVecForm`]); `h` is the document [`KeyHeader`],\nstored once for the whole document (every entry encrypts under the\ndocument's single data key, with per-entry nonces derived from the\nentries' selectors).", "properties": { + "a": { + "description": "Array-root marker. The SQL root validator allows it and the array\naccessors (`jsonb_array_length`, `jsonb_array_elements`, `->(doc, int)`)\nREQUIRE it (`eql_v3_internal.is_ste_vec_array`), so a document the\ndatabase accepts must also parse here. Optional and non-nullable: SQL\nrejects `\"a\": null` (`jsonb_typeof(...) = 'boolean'`), so the schema\nand deserializer reject it too.", + "type": "boolean" + }, "h": { "$ref": "#/$defs/KeyHeader" }, diff --git a/packages/eql/crates/eql-bindings/src/v3/json.rs b/packages/eql/crates/eql-bindings/src/v3/json.rs index 3ae7642ff2..5ca9182486 100644 --- a/packages/eql/crates/eql-bindings/src/v3/json.rs +++ b/packages/eql/crates/eql-bindings/src/v3/json.rs @@ -80,7 +80,7 @@ impl JsonSchema for SteVecForm { } /// `public.eql_v3_json_search` — a SteVec encrypted-JSON document -/// (`{v, k, i, h, sv:[entry]}`, no root ciphertext — the root document +/// (`{v, k, i, h, sv:[entry]}` plus an optional array-root flag `a`, no root ciphertext — the root document /// ciphertext lives on the root sv entry). Strict. `k` is the `"sv"` form /// discriminator (see [`SteVecForm`]); `h` is the document [`KeyHeader`], /// stored once for the whole document (every entry encrypts under the @@ -100,13 +100,37 @@ pub struct SteVecDocument { pub i: Identifier, pub h: KeyHeader, pub sv: Vec, + /// Array-root marker. The SQL root validator allows it and the array + /// accessors (`jsonb_array_length`, `jsonb_array_elements`, `->(doc, int)`) + /// REQUIRE it (`eql_v3_internal.is_ste_vec_array`), so a document the + /// database accepts must also parse here. Optional and non-nullable: SQL + /// rejects `"a": null` (`jsonb_typeof(...) = 'boolean'`), so the schema + /// and deserializer reject it too. + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "deserialize_present_bool" + )] + #[schemars(with = "bool")] + #[ts(optional, type = "boolean")] + pub a: Option, +} + +/// Deserialize an optional boolean that, when present, must be a real boolean. +/// `Option`'s default deserializer maps JSON `null` to `None`; the SQL +/// CHECKs reject `null` for `a`, so the wire types must too. +fn deserialize_present_bool<'de, D>(deserializer: D) -> Result, D::Error> +where + D: serde::Deserializer<'de>, +{ + bool::deserialize(deserializer).map(Some) } /// `public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a /// selector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the /// decryption unit is `h` + `s` + `c`, with the document `h` grafted onto /// extracted entries by `->`), an optional array-membership marker `a` -/// (emitted only when true), and — for ordered (number/string) path entries +/// (a boolean; producers emit it only when true), and — for ordered (number/string) path entries /// only — the `op` ordering term. Value entries (value-inclusive selectors) /// and non-orderable path entries are term-less: exact matching is selector /// presence, so no per-entry equality term exists (`hm` is retired). The @@ -123,13 +147,20 @@ pub struct SteVecDocument { pub struct SteVecEntry { pub s: Selector, pub c: EntryCiphertext, - // `#[ts(optional = nullable)]` emits `a?: boolean | null` — ts-rs does NOT + // `#[ts(optional, type = "boolean")]` emits `a?: boolean` — ts-rs does NOT // infer optionality from serde `default`/`skip_serializing_if` (10.1: only an - // explicit `#[ts(optional)]`/`optional = nullable` does), so without this the - // TS binding would render `a` REQUIRED and drift from the JSON Schema, which - // excludes `a` from `required`. `= nullable` keeps the `| null`. - #[serde(default, skip_serializing_if = "Option::is_none")] - #[ts(optional = nullable)] + // explicit `#[ts(optional)]` does), so without this the TS binding would + // render `a` REQUIRED and drift from the JSON Schema, which excludes `a` + // from `required`. Non-nullable: the SQL entry CHECK requires + // `jsonb_typeof(VALUE->'a') = 'boolean'`, so `"a": null` is rejected there + // and must not be advertised (or accepted) here. + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "deserialize_present_bool" + )] + #[schemars(with = "bool")] + #[ts(optional, type = "boolean")] pub a: Option, #[serde(default, skip_serializing_if = "Option::is_none")] #[ts(optional)] diff --git a/packages/eql/crates/eql-bindings/src/v3/mod.rs b/packages/eql/crates/eql-bindings/src/v3/mod.rs index 456822802f..4e4f0af19a 100644 --- a/packages/eql/crates/eql-bindings/src/v3/mod.rs +++ b/packages/eql/crates/eql-bindings/src/v3/mod.rs @@ -23,22 +23,24 @@ //! For the generated flat-scalar families, every payload has the shared envelope //! keys (required by every scalar domain CHECK, mirroring `ENVELOPE_KEYS` in //! `eql-domains`): `v`, `i`, `c`. Then the domain's required term keys — `hm` -//! for `_eq`, `ob` for `_ord`/`_ord_ore`, `op` for `_ord_ope`, `bf` for -//! `_match`, none for -//! storage-only. `Option` does not appear in the generated scalar structs: the +//! for `_eq`, `op` for `_ord`/`_ord_ope`, `ob` for `_ord_ore`, `bf` for +//! `_match` (and, alongside the ordering term, for the `_search` domains), +//! none for storage-only. `Option` does not appear in the generated scalar structs: the //! capability **is** the type identity. Hold a [`integer::IntegerEq`] and `hm` is //! present, guaranteed by the Rust type and (SQL-side) by the domain CHECK. A //! missing term key is a deserialization error — the Rust analogue of the CHECK //! constraint. //! -//! One exception to "`ob` for `_ord`": `text`'s ordered domains carry **both** -//! `hm` and the ordering term (`text_ord`/`text_ord_ore`/`text_search` carry -//! `hm` + `ob`; `text_ord_ope` carries `hm` + `op`), where the non-text +//! One exception to "the ordering term alone": `text`'s ordered domains carry **both** +//! `hm` and the ordering term (`text_ord`/`text_ord_ope` carry `hm` + `op`; +//! `text_ord_ore` carries `hm` + `ob`; `text_search` carries `hm` + `op` + +//! `bf`; `text_search_ore` carries `hm` + `ob` + `bf`), where the non-text //! ordered domains carry the ordering term alone. Text routes `=`/`<>` //! through `hm` rather than the ordering term because lexicographic ORE/OPE //! over text is not equality-lossless, so equality needs the HMAC. The //! generated struct doc surfaces this structurally — its required-keys line -//! lists `hm` `ob` (or `hm` `op`) rather than just the ordering key. +//! lists `hm` `op` (or `hm` `ob`, plus `bf` for the `_search` domains) rather than +//! just the ordering key. //! //! The generated flat-scalar types are also **strict**: every scalar struct is //! `#[serde(deny_unknown_fields)]`, so a payload carrying keys outside the diff --git a/packages/eql/crates/eql-bindings/tests/v3_conformance.rs b/packages/eql/crates/eql-bindings/tests/v3_conformance.rs index 6231b75807..81b30ae64d 100644 --- a/packages/eql/crates/eql-bindings/tests/v3_conformance.rs +++ b/packages/eql/crates/eql-bindings/tests/v3_conformance.rs @@ -459,6 +459,41 @@ fn stevec_document_round_trips_and_enforces_envelope() { assert!(serde_json::from_value::(extra).is_err()); } +#[test] +fn stevec_array_root_flag_matches_sql_contract() { + use eql_bindings::v3::json::{SteVecDocument, SteVecEntry}; + // The SQL root validator allows root `a`, and the array accessors require + // it, so an array document the database accepts must parse and round-trip + // here — including an empty one. + let wire = json!({ + "v": 3, "k": "sv", "i": { "t": "users", "c": "tags" }, + "h": "kh", "a": true, "sv": [] + }); + let parsed: SteVecDocument = serde_json::from_value(wire.clone()).unwrap(); + assert_eq!(parsed.a, Some(true)); + assert_eq!(serde_json::to_value(&parsed).unwrap(), wire); + // Absent `a` stays absent on re-serialization. + let mut no_a = wire.clone(); + no_a.as_object_mut().unwrap().remove("a"); + let parsed: SteVecDocument = serde_json::from_value(no_a.clone()).unwrap(); + assert_eq!(parsed.a, None); + assert_eq!(serde_json::to_value(&parsed).unwrap(), no_a); + // SQL rejects a non-boolean `a` (null included) at root and entry level. + for bad in [json!(null), json!("true"), json!(1)] { + let mut w = wire.clone(); + w["a"] = bad.clone(); + assert!( + serde_json::from_value::(w).is_err(), + "root a = {bad} must fail" + ); + assert!( + serde_json::from_value::(json!({ "s": "sel", "c": "ct", "a": bad })) + .is_err(), + "entry a = {bad} must fail" + ); + } +} + #[test] fn stevec_entry_term_is_optional_and_op_only() { use eql_bindings::v3::json::SteVecEntry; @@ -524,6 +559,7 @@ fn stevec_document_and_query_schemas_are_strict() { }, h: "kh".to_string().into(), sv: vec![], + a: None, }; let sdoc = serde_json::to_value(doc.schema()).unwrap(); assert_eq!(sdoc.pointer("/additionalProperties"), Some(&json!(false))); @@ -541,6 +577,26 @@ fn stevec_document_and_query_schemas_are_strict() { Some(&json!("#/$defs/SteVecForm")) ); assert_eq!(sdoc.pointer("/$defs/SteVecForm/const"), Some(&json!("sv"))); + // Root `a` is optional (not required) and non-nullable, matching the SQL + // CHECKs (`jsonb_typeof(val->'a') = 'boolean'`); same for the entry's `a`. + assert_eq!( + sdoc.pointer("/properties/a/type"), + Some(&json!("boolean")), + "root a must be a plain boolean, not nullable" + ); + assert!( + !sdoc["required"].as_array().unwrap().contains(&json!("a")), + "root a must not be required" + ); + let entry: eql_bindings::v3::json::SteVecEntry = + serde_json::from_value(json!({ "s": "sel", "c": "ct" })).unwrap(); + let sentry = serde_json::to_value(entry.schema()).unwrap(); + assert_eq!( + sentry.pointer("/properties/a/type"), + Some(&json!("boolean")), + "entry a must be a plain boolean, not nullable" + ); + assert!(!sentry["required"].as_array().unwrap().contains(&json!("a"))); let q = SteVecQuery { sv: vec![] }; let sq = serde_json::to_value(q.schema()).unwrap(); assert_eq!(sq.pointer("/additionalProperties"), Some(&json!(false))); @@ -592,15 +648,15 @@ fn stevec_ts_exports_have_expected_shape() { }; // SteVecEntry: direct fields s/c, optional op and extracted metadata, and - // the OPTIONAL nullable array marker `a`. `a?: boolean | null` (not `a: boolean | - // null`) pins ts-rs optionality so the TS binding agrees with the JSON Schema, + // the OPTIONAL, non-nullable array marker `a`. `a?: boolean` (not `a: boolean`) + // pins ts-rs optionality so the TS binding agrees with the JSON Schema, // which excludes `a` from `required` — the drift a bare `Option` without - // `#[ts(optional = nullable)]` silently reintroduces. + // `#[ts(optional)]` silently reintroduces. let entry = export_body("SteVecEntry.ts", "SteVecEntry"); for needle in [ "s: Selector", "c: EntryCiphertext", - "a?: boolean | null", + "a?: boolean", "op?: OpeCllw", "i?: Identifier", "v?: SchemaVersion", @@ -617,14 +673,14 @@ fn stevec_ts_exports_have_expected_shape() { // in `json.rs` (which changes the wire/consumer contract) fails here rather // than escaping to a manual diff. assert!( - entry.contains("{ s: Selector, c: EntryCiphertext, a?: boolean | null, op?: OpeCllw, i?: Identifier, v?: SchemaVersion, h?: KeyHeader, }"), + entry.contains("{ s: Selector, c: EntryCiphertext, a?: boolean, op?: OpeCllw, i?: Identifier, v?: SchemaVersion, h?: KeyHeader, }"), "SteVecEntry.ts field order must be s, c, a, op, i, v, h; got: {entry}" ); let document = export_body("SteVecDocument.ts", "SteVecDocument"); assert!( document.contains( - "{ v: SchemaVersion, k: SteVecForm, i: Identifier, h: KeyHeader, sv: Array, }" + "{ v: SchemaVersion, k: SteVecForm, i: Identifier, h: KeyHeader, sv: Array, a?: boolean, }" ), - "SteVecDocument.ts field order must be v, k, i, h, sv, got: {document}" + "SteVecDocument.ts field order must be v, k, i, h, sv, a, got: {document}" ); } diff --git a/packages/eql/crates/eql-codegen/src/context.rs b/packages/eql/crates/eql-codegen/src/context.rs index e0a87dc90f..8b15a278e8 100644 --- a/packages/eql/crates/eql-codegen/src/context.rs +++ b/packages/eql/crates/eql-codegen/src/context.rs @@ -348,7 +348,7 @@ pub enum FnEntry { required: Option, }, Wrapper { - op: String, // SQL operator used in the body, e.g. = + op: String, // schema-qualified body operator, e.g. OPERATOR(pg_catalog.=) function_name: String, // e.g. eq args: [SqlParam; 2], call_a: String, // e.g. eql_v3.eq_term(a) (embeds extract_arg cast logic) @@ -363,6 +363,12 @@ pub enum FnEntry { function_name: String, // e.g. lt / "->" / "#>" args: [SqlParam; 2], returns: String, // boolean / text / jsonb / domain (selection STAYS in Rust) + // `Some(" and ")` (sql_str-escaped) for a blocker that rejects a + // storage domain paired with ANOTHER domain's query twin: the template + // then emits compact docs (there is one per ordered pair of domains in a + // family) and a message naming both operands. `None` for every other + // blocker. + mismatch: Option, }, } @@ -404,17 +410,13 @@ fn extractor_entry_requiring(term: Term, required: Option) -> FnEn /// Build an inlinable comparison-wrapper entry for a supported operator. /// `dom` is the schema-qualified domain name; `op` is the already-resolved -/// operator (the caller iterates `OPERATORS`, so no symbol re-lookup is needed). -pub fn wrapper_entry( - dom: &str, - op: &Operator, - arg_a: &str, - arg_b: &str, - extractor: &str, -) -> FnEntry { +/// operator (the caller iterates `OPERATORS`, so no symbol re-lookup is needed); +/// `term` is the term serving `op`, which supplies both the extractor and the +/// schema the body's operator is named in. +pub fn wrapper_entry(dom: &str, op: &Operator, arg_a: &str, arg_b: &str, term: Term) -> FnEntry { + let extractor = term.extractor(); FnEntry::Wrapper { - // Body operator: `symbol` for all but `@@`, whose body uses bloom `@>`. - op: op.body_operator().to_string(), + op: qualified_body_operator(op, term), // Supported path → the public wrapper name. Differs from `function_name` // (the blocker name) only for `@@`, whose wrapper is `eql_v3.matches`. function_name: op.wrapper_function_name().to_string(), @@ -434,6 +436,23 @@ pub fn wrapper_entry( } } +/// The wrapper body's operator, schema-qualified as `OPERATOR(.)`. +/// +/// `sym` is `op.body_operator()` (the symbol itself for all but `@@`, whose +/// body uses bloom `@>`); `` is `term.operator_schema()`. A wrapper is +/// unpinned `LANGUAGE sql` so it can inline, which means its body is parsed +/// under the caller's `search_path` — a bare operator would resolve to whatever +/// that path finds. See [`Term::operator_schema`] for the ORE failure this +/// closes. Qualifying keeps the wrapper inlinable: the inlined +/// expression carries the same operator OID either way. +pub fn qualified_body_operator(op: &Operator, term: Term) -> String { + format!( + "OPERATOR({}.{})", + term.operator_schema(), + op.body_operator() + ) +} + /// Build an unsupported-operator entry. Every such entry shares one uniform /// `RAISE EXCEPTION` body; only signature facts vary. `op` is the /// already-resolved operator (no symbol re-lookup needed). @@ -444,6 +463,30 @@ pub fn unsupported_entry(op: &Operator, args: [SqlParam; 2], returns: &str) -> F function_name: op.function_name.to_string(), args, returns: returns.to_string(), + mismatch: None, + } +} + +/// Build a blocker for a storage domain paired with another domain's query twin +/// (see [`FnEntry::Unsupported::mismatch`]). Same marker text as every other +/// blocker, so the lints that recognise blockers by message keep seeing it. +pub fn mismatch_blocker_entry(op: &Operator, args: [SqlParam; 2], returns: &str) -> FnEntry { + let operands = sql_str(&format!("{} and {}", args[0].ty, args[1].ty)); + match unsupported_entry(op, args, returns) { + FnEntry::Unsupported { + operator_lit, + function_name, + args, + returns, + .. + } => FnEntry::Unsupported { + operator_lit, + function_name, + args, + returns, + mismatch: Some(operands), + }, + other => other, } } @@ -483,7 +526,7 @@ pub fn operator_entry(op: &Operator, leftarg: &str, rightarg: &str, supported: b }; // A supported operator is backed by a public comparison wrapper (SCHEMA); a // blocked one by an internal blocker (INTERNAL_SCHEMA). `supported` tracks - // wrapper emission exactly: `is_supported(op) ⟹ extractor_for_operator is + // wrapper emission exactly: `is_supported(op) ⟹ term_for_operator is // Some`, so `render_functions_file` always emits a wrapper for a supported // operator and a blocker otherwise. let function_schema = if supported { SCHEMA } else { INTERNAL_SCHEMA }; diff --git a/packages/eql/crates/eql-codegen/src/generate.rs b/packages/eql/crates/eql-codegen/src/generate.rs index df759a5665..99b72bf136 100644 --- a/packages/eql/crates/eql-codegen/src/generate.rs +++ b/packages/eql/crates/eql-codegen/src/generate.rs @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf}; use eql_domains::{Domain, DomainFamily, Role, Term}; use crate::context::{domain_name, is_ord_capable, query_domain_name}; -use crate::operator_surface::OPERATORS; +use crate::operator_surface::{Operator, OperatorSignature, TypeSlot, OPERATORS}; /// REQUIRE edge for the v3 schema file — pulled in by every generated file. const V3_SCHEMA: &str = "src/v3/schema.sql"; @@ -180,14 +180,14 @@ pub fn render_functions_file(family_name: &str, domain: &Domain) -> String { entries.push(extractor_entry(term)); } for op in OPERATORS { - let extractor = Term::extractor_for_operator(domain.terms, op.symbol.as_str()); + let term = Term::term_for_operator(domain.terms, op.symbol.as_str()); for sig in op.signatures { let rendered = sig.render(&dom); // A `blocker_only` overload (the `@@` jsonpath predicate) always falls // through to the blocker, even when the domain supports the symbol. if is_supported(op.symbol.as_str()) && !sig.blocker_only { - if let Some(ex) = extractor { - entries.push(wrapper_entry(&dom, op, &rendered.left, &rendered.right, ex)); + if let Some(t) = term { + entries.push(wrapper_entry(&dom, op, &rendered.left, &rendered.right, t)); continue; } } @@ -268,6 +268,47 @@ fn query_types_path(family_name: &str) -> String { scalar_path(family_name, &format!("query_{family_name}_types.sql")) } +/// The family's term-bearing storage domains OTHER than `domain` — the operands +/// that must never be compared with `domain`'s query twin. Storage-only domains +/// (no terms, no operators) are left out: every pair costs two schema objects +/// (see [`cross_pair_operators`]). +fn cross_pair_domains(spec: &DomainFamily, domain: &Domain) -> Vec<&'static Domain> { + spec.domains + .iter() + .filter(|d| d.is_scalar() && d.name != domain.name && !d.terms.is_empty()) + .collect() +} + +/// The operators (with their `(domain, domain)` signature) blocked for a +/// `(sibling storage domain, this domain's query twin)` pair: those BOTH domains +/// advertise. A query twin of a different domain is a DIFFERENT index family, so +/// there is no sound comparison to offer — the pair raises rather than flatten to +/// native `jsonb jsonb`. +/// +/// The intersection, not the union, is deliberate. Each blocked pair costs a +/// function and an operator, and the uninstaller takes a lock per object against +/// a stock budget it already approaches (docs/upgrading/v3.0.md, U-009), so the +/// set is held to the operators a caller can reasonably believe both sides +/// support. The remaining unblocked cases name an operator one side does not +/// support at all, which is a second mistake on top of the wrong query domain. +fn cross_pair_operators( + domain: &Domain, + sibling: &Domain, +) -> Vec<(&'static Operator, OperatorSignature)> { + let ours = Term::operators_for_terms(domain.terms); + let theirs = Term::operators_for_terms(sibling.terms); + OPERATORS + .iter() + .filter(|op| ours.contains(&op.symbol.as_str()) && theirs.contains(&op.symbol.as_str())) + .filter_map(|op| { + op.signatures + .iter() + .find(|s| s.left == TypeSlot::Domain && s.right == TypeSlot::Domain) + .map(|s| (op, *s)) + }) + .collect() +} + /// Body for a term-bearing domain's query__functions.sql: the /// query-operand extractor OVERLOADS (the same extractors, on /// `eql_v3.query_`) plus the comparison WRAPPERS binding the storage @@ -275,11 +316,19 @@ fn query_types_path(family_name: &str) -> String { /// both directions. Reuses the same `functions.sql` template as the storage /// surface; a query operand carries the same terms, so each wrapper compares /// `extractor(a)` to `extractor(b)` with no ciphertext cast. -pub fn render_query_functions_file(family_name: &str, domain: &Domain) -> String { +/// +/// `siblings` are the family's OTHER scalar storage domains (see +/// [`cross_pair_domains`]). Each gets exact-signature blockers against this +/// query twin in both directions — see [`cross_pair_operators`]. +pub fn render_query_functions_file( + family_name: &str, + domain: &Domain, + siblings: &[&Domain], +) -> String { use crate::consts::sql_str; use crate::context::{ - domain_name, environment, query_domain_name, query_extractor_entry, - v4_optional_query_terms, wrapper_entry, FunctionsContext, + domain_name, environment, mismatch_blocker_entry, query_domain_name, query_extractor_entry, + v4_optional_query_terms, wrapper_entry, FunctionsContext, SqlParam, }; let name = domain.full_name(family_name); let query_name = domain.query_name(family_name); @@ -296,38 +345,65 @@ pub fn render_query_functions_file(family_name: &str, domain: &Domain) -> String } // Comparison wrappers: (storage, query) and its (query, storage) commutator, // for supported operators only (a query operand is never sent for a blocked - // operator). `is_supported(op) ⟹ extractor_for_operator is Some`. + // operator). `is_supported(op) ⟹ term_for_operator is Some`. // - // Query twins deliberately emit NO blockers (unlike the storage surface). A - // query operand only ever appears as the RHS of `col operand`, and for - // an unsupported `` that predicate resolves against the STORAGE domain's - // `(, jsonb)` blocker (the query operand degrades to its `jsonb` - // base), which raises — so the realistic path is already protected. The only - // unblocked cases are nonsensical `operand operand` / `operand - // jsonb`, which no caller writes; blocking them would mean emitting the full - // blocker matrix against every query twin for zero real-world coverage. + // Query twins emit no blockers against their OWN storage domain or `jsonb`: + // a query operand only ever appears as the RHS of `col operand`, and + // for an unsupported `` that predicate resolves against the STORAGE + // domain's `(, jsonb)` blocker, which raises. The pairs that are + // NOT covered that way are a DIFFERENT domain's operand against this twin, + // handled by the cross-pair blockers below. for op in OPERATORS { if !supported.contains(&op.symbol.as_str()) { continue; } - let extractor = Term::extractor_for_operator(domain.terms, op.symbol.as_str()) - .expect("a supported operator resolves an extractor"); + let term = Term::term_for_operator(domain.terms, op.symbol.as_str()) + .expect("a supported operator resolves a term"); entries.push(wrapper_entry( &query_dom, op, &storage_dom, &query_dom, - extractor, + term, )); entries.push(wrapper_entry( &query_dom, op, &query_dom, &storage_dom, - extractor, + term, )); } + // Cross-pair blockers: a DIFFERENT domain of this family against this query + // twin. Both are domains over `jsonb`, so without an exact signature + // PostgreSQL flattens the pair to native `jsonb jsonb` and answers + // silently (`eql_v3_text_ord = query_text_eq` is false for equal values). + for sibling in siblings { + let sibling_dom = domain_name(&sibling.full_name(family_name)); + for (op, sig) in cross_pair_operators(domain, sibling) { + for (left, right) in [ + (sibling_dom.clone(), query_dom.clone()), + (query_dom.clone(), sibling_dom.clone()), + ] { + entries.push(mismatch_blocker_entry( + op, + [ + SqlParam { + name: "a", + ty: left, + }, + SqlParam { + name: arg_b_name(op.symbol.as_str()), + ty: right, + }, + ], + &sig.render(&query_dom).returns, + )); + } + } + } + let mut requires = vec![ V3_SCHEMA.to_string(), query_types_path(family_name), @@ -357,7 +433,14 @@ pub fn render_query_functions_file(family_name: &str, domain: &Domain) -> String /// `CREATE OPERATOR` binding `(storage_domain, query_)` for every /// supported operator, plus its `(query_, storage_domain)` commutator, so /// `col $1::eql_v3.query_` resolves to the query wrapper. -pub fn render_query_operators_file(family_name: &str, domain: &Domain) -> String { +/// +/// `siblings` as for [`render_query_functions_file`]: each binds a blocker for +/// the `(sibling, query)` pair and its commutator. +pub fn render_query_operators_file( + family_name: &str, + domain: &Domain, + siblings: &[&Domain], +) -> String { use crate::context::{ domain_name, environment, operator_entry, query_domain_name, OperatorsContext, }; @@ -375,7 +458,13 @@ pub fn render_query_operators_file(family_name: &str, domain: &Domain) -> String operators.push(operator_entry(op, &storage_dom, &query_dom, true)); operators.push(operator_entry(op, &query_dom, &storage_dom, true)); } - + for sibling in siblings { + let sibling_dom = domain_name(&sibling.full_name(family_name)); + for (op, _) in cross_pair_operators(domain, sibling) { + operators.push(operator_entry(op, &sibling_dom, &query_dom, false)); + operators.push(operator_entry(op, &query_dom, &sibling_dom, false)); + } + } let ctx = OperatorsContext { requires: vec![ V3_SCHEMA.to_string(), @@ -560,22 +649,6 @@ fn json_entry_cross_blocked_operators(spec: &DomainFamily) -> Vec<&'static str> .collect() } -/// The extractor this surface uses on BOTH operands: [`JSON_ENTRY_TERM`]'s own -/// (`ord_term` → `ope_cllw`), asked of the `Term` rather than spelled out, so an -/// extractor rename stays a single catalog-side change. -/// -/// Used for every operator rather than resolving per-operator through -/// `Term::extractor_for_operator`. That generic rule picks the first capable term -/// in the operand's list, so on a dual-term `[Hm, Ope]` operand (text's `_ord`) -/// it routes `=`/`<>` through `eq_term` — the per-value HMAC a SteVec scalar leaf -/// never carries. That rule is right for a scalar column and wrong for this seam: -/// `json_entry` serves exactly one term, so the extractor is a property of the -/// SEAM, not of the operator. Since [`json_entry_cross_operators`] already limits -/// the emitted set to what this term provides, the pairing is total. -fn json_entry_extractor() -> &'static str { - JSON_ENTRY_TERM.extractor() -} - /// Body for a family's json_entry__functions.sql: comparison /// WRAPPERS binding the fixed `public.eql_v3_json_entry` leaf to the family's /// `_ord` / `_ord_ope` query operands, for every operator json_entry can serve @@ -603,7 +676,17 @@ pub fn render_json_entry_cross_functions( let family_name = spec.name; let json_entry = json_entry_type(); - let extractor = json_entry_extractor(); + // The seam's own term on BOTH operands, for every operator — not resolved + // per operator through `Term::term_for_operator`. That generic rule picks the + // first capable term in the operand's list, so on a dual-term `[Hm, Ope]` + // operand (text's `_ord`) it would route `=`/`<>` through `eq_term`, the + // per-value HMAC a SteVec scalar leaf never carries. `json_entry` serves + // exactly one term, so the term is a property of the SEAM, not of the + // operator; [`json_entry_cross_operators`] already limits the emitted set to + // what it provides, so the pairing is total. Passing the `Term` (not an + // extractor name) lets `wrapper_entry` ask the catalog for both the + // extractor and the schema of the body's operator. + let term = JSON_ENTRY_TERM; let supported = json_entry_cross_operators(spec); let blocked = json_entry_cross_blocked_operators(spec); let mut requires = vec![ @@ -634,14 +717,14 @@ pub fn render_json_entry_cross_functions( op, &json_entry, &query_dom, - extractor, + term, )); entries.push(wrapper_entry( &json_entry, op, &query_dom, &json_entry, - extractor, + term, )); } else if blocked.contains(&symbol) { // Both directions, so neither can fall through to `jsonb = jsonb`. @@ -984,11 +1067,11 @@ pub fn render_type(spec: &DomainFamily, out_dir: &Path) -> Vec<(PathBuf, String) let query_name = d.query_name(family_name); rendered.push(( out_dir.join(format!("{query_name}_functions.sql")), - render_query_functions_file(family_name, d), + render_query_functions_file(family_name, d, &cross_pair_domains(spec, d)), )); rendered.push(( out_dir.join(format!("{query_name}_operators.sql")), - render_query_operators_file(family_name, d), + render_query_operators_file(family_name, d, &cross_pair_domains(spec, d)), )); } if let Some(agg) = render_aggregates_file(family_name, d) { @@ -1181,6 +1264,51 @@ pub fn clean_all(out_root: &Path) -> Result, WriteError> { #[cfg(test)] mod tests { + /// A query twin carries blockers for every OTHER term-bearing + /// domain of its family (both directions, only operators both sides + /// advertise) and none for the family's own storage domain or storage-only + /// domains, so a mismatched pair raises instead of flattening to `jsonb`. + #[test] + fn query_twin_blocks_other_domains_of_its_family() { + let text = eql_domains::CATALOG + .iter() + .find(|f| f.name == "text") + .expect("text family"); + let eq = text.domains.iter().find(|d| d.name == "eq").unwrap(); + let ord = text.domains.iter().find(|d| d.name == "ord").unwrap(); + let siblings = cross_pair_domains(text, eq); + assert!(siblings + .iter() + .all(|d| d.name != "eq" && !d.terms.is_empty())); + assert!(siblings.iter().any(|d| d.name == "ord")); + + let sql = render_query_functions_file("text", eq, &siblings); + for (l, r) in [ + ("public.eql_v3_text_ord", "eql_v3.query_text_eq"), + ("eql_v3.query_text_eq", "public.eql_v3_text_ord"), + ] { + assert!( + sql.contains(&format!("eql_v3_internal.eq(a {l}, b {r})")), + "missing {l} = {r} blocker" + ); + } + // query_text_eq advertises only `=`/`<>`: no ordering blocker. + assert!(!sql.contains("eql_v3_internal.lt(a public.eql_v3_text_ord")); + // Never the own twin, never the storage-only base domain. + assert!(!sql.contains("eql_v3_internal.eq(a public.eql_v3_text_eq")); + assert!(!sql.contains("eql_v3_internal.eq(a public.eql_v3_text,")); + + let ops = render_query_operators_file("text", eq, &siblings); + assert!(ops.contains( + "FUNCTION = eql_v3_internal.eq,\n LEFTARG = public.eql_v3_text_ord, RIGHTARG = eql_v3.query_text_eq\n" + )); + + // The ordering twin gets ordering blockers against `search`. + let ord_sql = render_query_functions_file("text", ord, &cross_pair_domains(text, ord)); + assert!(ord_sql + .contains("eql_v3_internal.lt(a public.eql_v3_text_search, b eql_v3.query_text_ord)")); + } + use super::*; use eql_domains::CATALOG; @@ -1226,6 +1354,30 @@ mod tests { v3(super::render_ore_fallback_file()) } + fn render_query_functions_file( + family_name: &str, + domain: &Domain, + siblings: &[&Domain], + ) -> String { + v3(super::render_query_functions_file( + family_name, + domain, + siblings, + )) + } + + fn render_query_operators_file( + family_name: &str, + domain: &Domain, + siblings: &[&Domain], + ) -> String { + v3(super::render_query_operators_file( + family_name, + domain, + siblings, + )) + } + fn render_json_entry_cross_functions( spec: &DomainFamily, domains: &[&Domain], @@ -1259,6 +1411,102 @@ mod tests { use std::fs; + /// Every comparison-wrapper body — scalar, query-twin and json_entry + /// surfaces, every catalog family — names its operator schema-qualified. + /// + /// Wrappers are unpinned `LANGUAGE sql` (to stay inlinable), so their body + /// is parsed under the CALLER's `search_path`; a bare operator resolves to + /// whatever that path finds. For the ORE term, whose operators live in + /// `public`, a caller without `public` on the path got pg_catalog's RECORD + /// comparison — byte-wise ciphertext order, no error. A bare + /// operator token anywhere in a wrapper body fails here. + #[test] + fn every_wrapper_body_schema_qualifies_its_operators() { + use crate::render::{belongs_to, render_str, EqlVersion}; + let mut bodies = 0; + for family in CATALOG { + for (path, src) in super::render_type(family, std::path::Path::new("out")) { + for version in EqlVersion::ALL { + if !belongs_to(&src, version).expect("a well-formed directive") { + continue; + } + let sql = render_str(&src, version).expect("renders"); + let prefix = version.prefix(); + let opens = format!("AS $$ SELECT {prefix}."); + let ore_term = format!("{prefix}.ord_term_ore("); + for line in sql.lines().filter(|l| l.starts_with(&opens)) { + bodies += 1; + let bare: Vec<&str> = line + .split_whitespace() + .filter(|tok| tok.chars().all(|c| "<>=@!~#&|-+*/%^".contains(c))) + .collect(); + assert!( + bare.is_empty(), + "{}: wrapper body uses unqualified operator(s) {bare:?}: {line}", + path.display() + ); + // The schema each term's operators actually live in, spelled + // out here rather than read from `Term::operator_schema`, so a + // wrong mapping there fails this test for every family. The + // ORE term compares a composite type whose operators are in + // `public`; naming pg_catalog there reaches the built-in + // RECORD comparison, the byte-order bug this guards. + let want = if line.contains(&ore_term) { + " OPERATOR(public." + } else { + " OPERATOR(pg_catalog." + }; + assert!( + line.contains(want), + "{}: wrapper body does not name its operator as{want}…: {line}", + path.display() + ); + let other = if want.contains("public") { + " OPERATOR(pg_catalog." + } else { + " OPERATOR(public." + }; + assert!( + !line.contains(other), + "{}: wrapper body names an operator in the wrong schema: {line}", + path.display() + ); + } + } + } + } + // Wrapper bodies open with an `eql_vN.(a)` call (extractor + // bodies call an `eql_vN_internal` constructor and are skipped). Each + // file is checked in every EQL version it belongs to. Guards the filter + // itself: a template change that stopped emitting single-line + // `AS $$ SELECT eql_vN.` bodies would otherwise pass vacuously. + assert!(bodies > 500, "only {bodies} wrapper bodies inspected"); + } + + /// The `_ord_ore` wrappers compare `eql_v3_internal.ore_block_256` values, + /// a composite type: only `OPERATOR(public.)` reaches the ORE + /// comparator. Pins the exact body per operator, on both the storage and + /// query-twin surfaces (the catalog-wide schema check is + /// `every_wrapper_body_schema_qualifies_its_operators`). + #[test] + fn ord_ore_wrappers_name_the_public_ore_operators() { + let s = spec("integer"); + let d = domain(s, "ord_ore"); + let storage = render_functions_file("integer", d); + let query = render_query_functions_file("integer", d, &cross_pair_domains(s, d)); + for op in ["=", "<>", "<", "<=", ">", ">="] { + let body = format!( + "SELECT eql_v3.ord_term_ore(a) OPERATOR(public.{op}) eql_v3.ord_term_ore(b) $$;" + ); + assert!(storage.contains(&body), "storage wrapper for {op}: {body}"); + assert!(query.contains(&body), "query wrapper for {op}: {body}"); + assert!( + !storage.contains(&format!("eql_v3.ord_term_ore(a) {op} ")), + "bare {op} on ORE terms" + ); + } + } + #[test] fn arg_b_name_is_selector_only_for_path_operators() { assert_eq!(arg_b_name("->"), "selector"); @@ -1658,8 +1906,9 @@ mod tests { "CREATE FUNCTION eql_v3.matches(a public.eql_v3_text_match, b public.eql_v3_text_match)" )); assert!(fns.contains( - "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)" + "SELECT eql_v3.match_term(a) OPERATOR(pg_catalog.@>) eql_v3.match_term(b) \ + AND (pg_catalog.cardinality(eql_v3.match_term(b)) OPERATOR(pg_catalog.>) 0 \ + OR pg_catalog.cardinality(eql_v3.match_term(a)) OPERATOR(pg_catalog.=) 0)" )); // The guarded match wrapper is NOT STRICT: a STRICT SQL function with a // non-strict body (the guard's AND/OR) would stop inlining, losing the @@ -2186,8 +2435,6 @@ mod tests { "{excluded} must never reach the extract surface" ); } - // And the extractor is the term's own, not a spelled-out literal. - assert_eq!(json_entry_extractor(), Term::Ope.extractor()); } #[test] @@ -2303,7 +2550,7 @@ mod tests { assert!(sql.contains( "CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_integer_ord)" )); - assert!(sql.contains("SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b)")); + assert!(sql.contains("SELECT eql_v3.ord_term(a) OPERATOR(pg_catalog.<) eql_v3.ord_term(b)")); assert!(sql.contains( "CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_integer_ord_ope)" )); @@ -2322,7 +2569,7 @@ mod tests { "equality must not be a public wrapper on the extract surface" ); assert!( - !sql.contains("SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b)"), + !sql.contains("SELECT eql_v3.ord_term(a) OPERATOR(pg_catalog.=) eql_v3.ord_term(b)"), "op-equality is gone — equality is document containment, not an extract op" ); // The dropped `_eq` operand never appears, and no hmac equality route @@ -2409,7 +2656,7 @@ mod tests { assert!(sql.contains( "CREATE FUNCTION eql_v3.lt(a public.eql_v3_json_entry, b eql_v3.query_text_ord)" )); - assert!(sql.contains("SELECT eql_v3.ord_term(a) < eql_v3.ord_term(b)")); + assert!(sql.contains("SELECT eql_v3.ord_term(a) OPERATOR(pg_catalog.<) eql_v3.ord_term(b)")); assert!(sql.contains( "CREATE FUNCTION eql_v3.gte(a public.eql_v3_json_entry, b eql_v3.query_text_ord)" )); @@ -2424,7 +2671,7 @@ mod tests { ); } assert!( - !sql.contains("SELECT eql_v3.ord_term(a) = eql_v3.ord_term(b)"), + !sql.contains("SELECT eql_v3.ord_term(a) OPERATOR(pg_catalog.=) eql_v3.ord_term(b)"), "op-equality on text is a FALSE POSITIVE (orderize_string collates)" ); @@ -2643,7 +2890,11 @@ mod tests { // Each v4 extractor over the operand raises without its term; v3's // reads the term as before. - let functions = super::render_query_functions_file("text", domain(text, "search")); + let functions = super::render_query_functions_file( + "text", + domain(text, "search"), + &super::cross_pair_domains(text, domain(text, "search")), + ); let f3 = render_str(&functions, EqlVersion::V3).unwrap(); let f4 = render_str(&functions, EqlVersion::V4).unwrap(); assert!(!f3.contains("require_query_term"), "{f3}"); @@ -2661,7 +2912,11 @@ mod tests { } // A query operand whose terms are not optional reads them directly, // in one form for both versions. - let eq = super::render_query_functions_file("text", domain(text, "eq")); + let eq = super::render_query_functions_file( + "text", + domain(text, "eq"), + &super::cross_pair_domains(text, domain(text, "eq")), + ); assert!(!eq.contains("require_query_term") && !eq.contains("{{#v")); } diff --git a/packages/eql/crates/eql-codegen/src/range.rs b/packages/eql/crates/eql-codegen/src/range.rs index 62fcd9aa3d..bcf3b9159a 100644 --- a/packages/eql/crates/eql-codegen/src/range.rs +++ b/packages/eql/crates/eql-codegen/src/range.rs @@ -220,6 +220,11 @@ struct Between { column: String, range: String, extractor: &'static str, + /// The schema of the comparison operators over the term, which the body + /// names them in: see [`Term::operator_schema`]. `between` is unpinned + /// `LANGUAGE sql` so that it inlines, so a bare operator would resolve + /// against the caller's `search_path`. + op_schema: &'static str, /// An ORE range, whose index needs the opclass a non-superuser /// install skips: the generated docs say so. ore: bool, @@ -304,6 +309,7 @@ pub fn render_range_functions_file(spec: &DomainFamily) -> Option { column: domain_name(&full), range: range.clone(), extractor: term.extractor(), + op_schema: term.operator_schema(), ore: term == Term::Ore, ope_columns: if term == Term::Ore { ope_columns.clone() @@ -433,11 +439,14 @@ mod tests { EqlVersion::V4, ) .unwrap(); + // The operators are schema-qualified: `between` inlines, so a bare one + // would resolve against the caller's search_path, and with `public` + // off it the ORE term (a composite type) would compare as a record. 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) $$;" + AS $$ SELECT eql_v4.ord_term_ore(a) OPERATOR(public.>=) eql_v4_internal.lo(r) AND eql_v4.ord_term_ore(a) OPERATOR(public.<=) 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"] { @@ -445,7 +454,7 @@ mod tests { "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) $$;" + AS $$ SELECT eql_v4.ord_term(a) OPERATOR(pg_catalog.>=) eql_v4_internal.lo(r) AND eql_v4.ord_term(a) OPERATOR(pg_catalog.<=) eql_v4_internal.hi(r) $$;" )), "{column}"); } assert_eq!(v4.matches("CREATE FUNCTION eql_v4.between(").count(), 3); diff --git a/packages/eql/crates/eql-codegen/templates/functions/unsupported.sql.j2 b/packages/eql/crates/eql-codegen/templates/functions/unsupported.sql.j2 index de76fa1e62..02ad5d421f 100644 --- a/packages/eql/crates/eql-codegen/templates/functions/unsupported.sql.j2 +++ b/packages/eql/crates/eql-codegen/templates/functions/unsupported.sql.j2 @@ -1,3 +1,9 @@ +{% if e.mismatch -%} +--! @brief Unsupported operator blocker for {{ dom }}: {{ e.mismatch }} (mismatched query domain). +--! @param {{ e.args[0].name }} {{ e.args[0].ty }} left operand +--! @param {{ e.args[1].name }} {{ e.args[1].ty }} right operand +--! @return {{ e.returns }} never returned — the function always raises +{% else -%} --! @brief Unsupported operator blocker for {{ dom }}. --! --! Intercepts an operator that is not supported on {{ dom }} and always raises; @@ -7,7 +13,12 @@ --! @param {{ e.args[0].name }} {{ e.args[0].ty }} left operand of the blocked operator --! @param {{ e.args[1].name }} {{ e.args[1].ty }} right operand of the blocked operator --! @return {{ e.returns }} never returned — the function always raises "operator not supported" +{% endif -%} CREATE FUNCTION {{ internal_schema }}.{{ e.function_name }}({{ e.args[0].name }} {{ e.args[0].ty }}, {{ e.args[1].name }} {{ e.args[1].ty }}) RETURNS {{ e.returns }} IMMUTABLE PARALLEL SAFE +{% if e.mismatch -%} +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '{{ e.operator_lit }}', '{{ e.mismatch }}'; END; $$ +{% else -%} AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %', '{{ e.operator_lit }}', '{{ domain_lit }}'; END; $$ +{% endif -%} LANGUAGE plpgsql; diff --git a/packages/eql/crates/eql-codegen/templates/functions/wrapper.sql.j2 b/packages/eql/crates/eql-codegen/templates/functions/wrapper.sql.j2 index a2573958b3..88b377c245 100644 --- a/packages/eql/crates/eql-codegen/templates/functions/wrapper.sql.j2 +++ b/packages/eql/crates/eql-codegen/templates/functions/wrapper.sql.j2 @@ -4,4 +4,4 @@ --! @return boolean CREATE FUNCTION {{ schema }}.{{ e.function_name }}({{ e.args[0].name }} {{ e.args[0].ty }}, {{ e.args[1].name }} {{ e.args[1].ty }}) RETURNS boolean LANGUAGE sql IMMUTABLE{% if not e.empty_bloom_guard %} STRICT{% endif %} PARALLEL SAFE -AS $$ SELECT {{ e.call_a }} {{ e.op }} {{ e.call_b }}{% if e.empty_bloom_guard %} AND (cardinality({{ e.call_b }}) > 0 OR cardinality({{ e.call_a }}) = 0){% endif %} $$; +AS $$ SELECT {{ e.call_a }} {{ e.op }} {{ e.call_b }}{% if e.empty_bloom_guard %} AND (pg_catalog.cardinality({{ e.call_b }}) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{ e.call_a }}) OPERATOR(pg_catalog.=) 0){% endif %} $$; diff --git a/packages/eql/crates/eql-codegen/templates/range_functions.sql.j2 b/packages/eql/crates/eql-codegen/templates/range_functions.sql.j2 index c11eed2b8c..a6faeaa55b 100644 --- a/packages/eql/crates/eql-codegen/templates/range_functions.sql.j2 +++ b/packages/eql/crates/eql-codegen/templates/range_functions.sql.j2 @@ -58,5 +58,5 @@ AS $$ SELECT {{ a.body }} $$; 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) $$; +AS $$ SELECT {{ schema }}.{{ b.extractor }}(a) OPERATOR({{ b.op_schema }}.>=) {{ internal_schema }}.lo(r) AND {{ schema }}.{{ b.extractor }}(a) OPERATOR({{ b.op_schema }}.<=) {{ internal_schema }}.hi(r) $$; {% endfor -%} diff --git a/packages/eql/crates/eql-domains/src/term.rs b/packages/eql/crates/eql-domains/src/term.rs index a5aee9b497..aa48badadb 100644 --- a/packages/eql/crates/eql-domains/src/term.rs +++ b/packages/eql/crates/eql-domains/src/term.rs @@ -101,6 +101,33 @@ impl Term { } } + /// The schema holding the comparison operators over this term's index-term + /// type — the schema a generated wrapper body names its operator in, as + /// `OPERATOR(.)`. + /// + /// Wrapper bodies are unpinned `LANGUAGE sql` (pinning would defeat + /// inlining, and with it functional-index matching), so they are parsed + /// under the CALLER's `search_path`. A bare operator there resolves against + /// whatever that path finds. For `Ore` that was a silent wrong answer: + /// `eql_v3_internal.ore_block_256` is a composite type whose comparison + /// operators live in `public`, and with `public` off the path a bare `<` + /// resolves to pg_catalog's built-in RECORD comparison, ordering the + /// ciphertext bytes lexicographically with no error. Naming the + /// schema makes resolution independent of the caller's path. + /// + /// The other terms are domains over built-in types (`text`, `smallint[]`, + /// `bytea`) whose operators are pg_catalog's. Qualifying them too keeps one + /// rule for every generated wrapper body (checked catalog-wide by + /// eql-codegen's tests), and stops a schema listed ahead of pg_catalog on + /// the caller's path from shadowing a wrapper's operator. + pub const fn operator_schema(self) -> &'static str { + match self { + // Created in src/v3/sem/ore_block_256/operators.sql. + Term::Ore => "public", + Term::Hm | Term::Bloom | Term::Ope => "pg_catalog", + } + } + /// True when this term provides ordering operators (`<` `<=` `>` `>=`). /// A per-term *capability*, distinct from [`Role`] (the whole-domain file /// role derived from the first term). New ordering terms opt in here, so @@ -284,10 +311,14 @@ impl Term { /// The extractor that supports `op` for a domain carrying `terms`, or /// `None`. First supporting term wins. pub fn extractor_for_operator(terms: &[Term], op: &str) -> Option<&'static str> { - terms - .iter() - .find(|t| t.operators().contains(&op)) - .map(|t| t.extractor()) + Self::term_for_operator(terms, op).map(Term::extractor) + } + + /// The term that supports `op` for a domain carrying `terms`, or `None`. + /// First supporting term wins — the same choice as + /// [`Term::extractor_for_operator`], which reads its extractor. + pub fn term_for_operator(terms: &[Term], op: &str) -> Option { + terms.iter().copied().find(|t| t.operators().contains(&op)) } /// Generated-file [`Role`] for a domain with these terms. No terms => @@ -311,6 +342,45 @@ impl Term { mod tests { use super::*; + #[test] + fn operator_schema_maps_each_term_to_where_its_operators_live() { + // ORE's comparison operators are created in `public` + // (src/v3/sem/ore_block_256/operators.sql); every other term is a + // domain over a built-in type and uses pg_catalog's operators. + assert_eq!(Term::Ore.operator_schema(), "public"); + assert_eq!(Term::Hm.operator_schema(), "pg_catalog"); + assert_eq!(Term::Bloom.operator_schema(), "pg_catalog"); + assert_eq!(Term::Ope.operator_schema(), "pg_catalog"); + } + + #[test] + fn term_for_operator_agrees_with_extractor_for_operator() { + for terms in [ + &[Term::Hm][..], + &[Term::Ore], + &[Term::Hm, Term::Ore], + &[Term::Hm, Term::Ope], + &[Term::Bloom], + &[], + ] { + for op in ["=", "<>", "<", "<=", ">", ">=", "@@", "@>"] { + assert_eq!( + Term::term_for_operator(terms, op).map(Term::extractor), + Term::extractor_for_operator(terms, op), + "{terms:?} {op}" + ); + } + } + assert_eq!( + Term::term_for_operator(&[Term::Hm, Term::Ore], "="), + Some(Term::Hm) + ); + assert_eq!( + Term::term_for_operator(&[Term::Hm, Term::Ore], "<"), + Some(Term::Ore) + ); + } + #[test] fn binding_newtype_maps_each_term() { assert_eq!(Term::Hm.binding_newtype(), "Hmac256"); diff --git a/packages/eql/docs/reference/json-support.md b/packages/eql/docs/reference/json-support.md index aabbce99ac..b7dacd0200 100644 --- a/packages/eql/docs/reference/json-support.md +++ b/packages/eql/docs/reference/json-support.md @@ -214,7 +214,7 @@ separate equality-indexed scalar column when server-side grouping is required. - **`eql_v3.jsonb_document_contains(a public.eql_v3_json_search, b public.eql_v3_json_search) RETURNS boolean`** — true if every selector in `b` is present in `a` (selector-subset containment); backs the `@>` operator. - **`eql_v3.jsonb_contains(a jsonb, b jsonb)` / `eql_v3.jsonb_contained_by(a jsonb, b jsonb)`** — function-form containment entrypoints for platforms that cannot type an operator call (Supabase PostgREST RPC, for example); same result as `@>` / `<@` (a parity test pins this). - **`eql_v3.jsonb_array(val jsonb) RETURNS jsonb[]`** — function-form array accessor for the same platforms. -- **`eql_v3.to_ste_vec_query(val public.eql_v3_json_search) RETURNS eql_v3.query_json`** — the GIN-indexable query shape `@>` inlines to. +- **`eql_v3.to_ste_vec_query(val public.eql_v3_json_search) RETURNS eql_v3.query_json`** — the GIN-indexable query shape `@>` inlines to. This is the only document-to-needle conversion: `doc::eql_v3.query_json` is **not** equivalent (PostgreSQL ignores casts from a domain, so it is a plain coercion that fails the `query_json` CHECK for a stored document, whose `sv` entries carry ciphertext). - **`eql_v3.meta_data(val jsonb)`** — envelope accessor: returns `{i, v, h}` (the key header `h` included so an extracted entry can be decrypted). **`eql_v3.ciphertext(val jsonb)`** — returns the `c` field; on the ste_vec surface `c` is raw AEAD output, decryptable only together with the entry's `s` and the document `h`. **`eql_v3.selector(val jsonb)` / `(entry public.eql_v3_json_entry)`** — selector accessor. ### Path query functions diff --git a/packages/eql/docs/upgrading/v3.0.md b/packages/eql/docs/upgrading/v3.0.md index 573c636133..b6c15e5131 100644 --- a/packages/eql/docs/upgrading/v3.0.md +++ b/packages/eql/docs/upgrading/v3.0.md @@ -21,7 +21,7 @@ the `eql_v3` surface (U-001 through U-010 below). 6. **`public.eql_v3_text_search` is backed by CLLW-OPE too, and `public.eql_v3_text_search_ore` is new** ([U-006](#u-006-text_search-is-backed-by-cllw-ope)). The combined search domain now requires `hm` + `op` + `bf` and orders via `eql_v3.ord_term(col)`; equality (`hm`) and bloom fuzzy match (`bf`) are unchanged. The block-ORE shape (`hm` + `ob` + `bf`) lives on the new `public.eql_v3_text_search_ore`. `text_search` now accepts the empty string. 7. **The encrypted-JSON domains are renamed, and `public.eql_v3_json` is now storage-only** ([U-007](#u-007-the-encrypted-json-domains-are-renamed-and-publiceql_v3_json-is-now-storage-only)). The searchable SteVec document `public.eql_v3_json` → `public.eql_v3_json_search`, `public.eql_v3_jsonb_entry` → `public.eql_v3_json_entry`, `eql_v3.query_jsonb` → `eql_v3.query_json`; the bare `public.eql_v3_json` is now a new ciphertext-only storage-only domain. Only affects 3.0.0 pre-release adopters. 8. **Text bloom fuzzy match is `@@` / `eql_v3.matches`, not `@>` / `eql_v3.contains`** ([U-008](#u-008-text-bloom-fuzzy-match-is-renamed-to---eql_v3matches)). On `public.eql_v3_text_match` / `text_search` / `text_search_ore` the fuzzy match is now the single directional operator `@@` (backed by `eql_v3.matches`); `@>` / `<@` (and `eql_v3.contains` / `contained_by`) now **raise** on these domains. It is n-gram token matching, not containment. The GIN index recipe is unchanged. Genuine JSON containment keeps `@>` / `<@`. -9. **Uninstalling can exceed the stock lock budget** ([U-009](#u-009-the-uninstaller-can-exceed-postgress-default-lock-budget)). The single-transaction uninstaller drops ~6,400+ objects, each taking one lock — right at the capacity a default `max_locks_per_transaction = 64` cluster affords. A lone uninstall on a quiet cluster normally succeeds; under concurrent load it can fail with `out of shared memory`. Raise `max_locks_per_transaction` (needs a restart) or uninstall during a quiet window. Installation is unaffected. +9. **Uninstalling can exceed the stock lock budget** ([U-009](#u-009-the-uninstaller-can-exceed-postgress-default-lock-budget)). The single-transaction uninstaller drops ~8,550 objects, each taking one lock — beyond the capacity a default `max_locks_per_transaction = 64` cluster affords. A lone uninstall on a quiet cluster normally succeeds; under concurrent load it can fail with `out of shared memory`. Raise `max_locks_per_transaction` (needs a restart) or uninstall during a quiet window. Installation is unaffected. 10. **SteVec exact match is value-selector presence, and the document wire format is restructured** ([U-010](#u-010-stevec-value-inclusive-selectors-and-the-envelope-wire-format)). Encrypted-JSON field equality now works exactly for *every* type (including `text` / `bigint` / `numeric`) via document containment on a value-inclusive selector — spell it `col @> $1::eql_v3.query_json`; the per-value `hm` term is retired, and extract-surface equality (`-> 'sel' = …`) is blocked (ranges stay). The document now carries a once-per-document key header `h` (no root `c`); each entry's `c` is raw AEAD output with a selector-derived nonce; `eql_v3.jsonb_array_elements_text` is removed. **Re-encryption required** — there is no mechanical conversion. 11. **An empty-bloom fuzzy-match term no longer matches every row** ([U-011](#u-011-an-empty-bloom-fuzzy-match-term-no-longer-matches-every-row)). `col @@ $1` (`eql_v3.matches`) on the text match/search domains matched the *entire table* when the query term carried an empty bloom filter (a search string with no n-gram tokens — e.g. a value below the tokeniser's trigram floor), because empty-array containment is vacuously true. It now uses `LIKE ''` semantics: an empty needle matches only a value whose own bloom is also empty. Normal (non-empty needle) queries are unchanged and still index-accelerated. No re-encryption, no schema change. @@ -53,7 +53,7 @@ the `eql_v3` surface (U-001 through U-010 below). | `eql_v3.ore_cllw(entry)` / `eql_v3.has_ore_cllw(entry)` / `eql_v3_internal.ore_cllw` (+ comparator, operators, opclass) | **Removed.** Entry ordering is `eql_v3.ord_term(entry)` — see U-004. | | Text bloom fuzzy match (`public.eql_v3_text_match` / `text_search` / `text_search_ore`) | **Changed.** `@>` / `<@` (`eql_v3.contains` / `contained_by`) → the single directional `@@` (`eql_v3.matches`); `@>` / `<@` now raise on these domains — see U-008. | | Empty-bloom fuzzy-match needle (`@@` / `eql_v3.matches`) | **Changed.** An empty needle bloom matched every row (vacuous containment); now `LIKE ''`-shaped — matches only empty-bloom values. Normal queries and the GIN index recipe unchanged — see U-011. | -| Uninstaller lock footprint | **Grown.** The single-transaction uninstall takes ~6,400+ locks — at/over the default `max_locks_per_transaction = 64` cluster budget under concurrent load — see U-009. Installation unaffected. | +| Uninstaller lock footprint | **Grown.** The single-transaction uninstall takes ~8,550 locks — over the default `max_locks_per_transaction = 64` cluster budget under concurrent load — see U-009. Installation unaffected. | | JSON containment (`public.eql_v3_json_search` `@>` / `<@`, `eql_v3.jsonb_document_contains`) | **Unchanged.** Genuine containment keeps the containment vocabulary — see U-008. (The implementation was called `eql_v3.ste_vec_contains` until 3.0.5 renamed it; the operators never changed. See [Upgrading to EQL 3.0.5](./v3.0.5.md).) | | Legacy `eql_v2` wire documentation (`docs/reference/schema/eql-payload-v2.*.schema.json`) | **Unchanged.** Stays `v: 2`. | @@ -651,8 +651,9 @@ operator/function name moved — so no re-encryption or index rebuild is involve **What changed.** The v3 surface has grown to the point where the shipped uninstaller — whose core is `DROP SCHEMA eql_v3 CASCADE` followed by -`DROP SCHEMA eql_v3_internal CASCADE` — takes **6,433 locks** when run as a -single transaction (measured on this release: one per dropped function, +`DROP SCHEMA eql_v3_internal CASCADE` — takes **8,558 locks** when run as a +single transaction (measured on this release, including the mismatched-query-domain +blockers, which account for about 2,100 of them: one per dropped function, operator, type, and cast, all held until commit). Note the shipped file contains no `BEGIN`/`COMMIT` of its own: run it with `psql --single-transaction -f cipherstash-encrypt-uninstall.sql` to get the @@ -662,7 +663,7 @@ commits separately (fewer locks at once, but `eql_v3` can drop while its shared lock table once at startup as `max_locks_per_transaction × (max_connections + max_prepared_transactions)`; at the defaults (64 × 100) that is **6,400 slots for the whole cluster**, so a full single-transaction -uninstall now exceeds what the default configuration nominally affords. +uninstall now exceeds what the default configuration nominally affords by about a third. **Who is affected.** Anyone running `cipherstash-encrypt-uninstall.sql` on a cluster with the default `max_locks_per_transaction = 64` — in practice only diff --git a/packages/eql/packages/eql/src/generated/schema/v3/eql_v3_json_entry.json b/packages/eql/packages/eql/src/generated/schema/v3/eql_v3_json_entry.json index 346f00bde0..3c12c619a8 100644 --- a/packages/eql/packages/eql/src/generated/schema/v3/eql_v3_json_entry.json +++ b/packages/eql/packages/eql/src/generated/schema/v3/eql_v3_json_entry.json @@ -44,13 +44,10 @@ "$id": "https://schemas.cipherstash.com/eql/v3/eql_v3_json_entry.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a\nselector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the\ndecryption unit is `h` + `s` + `c`, with the document `h` grafted onto\nextracted entries by `->`), an optional array-membership marker `a`\n(emitted only when true), and — for ordered (number/string) path entries\nonly — the `op` ordering term. Value entries (value-inclusive selectors)\nand non-orderable path entries are term-less: exact matching is selector\npresence, so no per-entry equality term exists (`hm` is retired). The\noptional `i`/`v`/`h` fields model metadata grafted onto an entry returned by\n`->`; naming them explicitly keeps unknown keys rejectable.", + "description": "`public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a\nselector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the\ndecryption unit is `h` + `s` + `c`, with the document `h` grafted onto\nextracted entries by `->`), an optional array-membership marker `a`\n(a boolean; producers emit it only when true), and — for ordered (number/string) path entries\nonly — the `op` ordering term. Value entries (value-inclusive selectors)\nand non-orderable path entries are term-less: exact matching is selector\npresence, so no per-entry equality term exists (`hm` is retired). The\noptional `i`/`v`/`h` fields model metadata grafted onto an entry returned by\n`->`; naming them explicitly keeps unknown keys rejectable.", "properties": { "a": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "c": { "$ref": "#/$defs/EntryCiphertext" diff --git a/packages/eql/packages/eql/src/generated/schema/v3/eql_v3_json_search.json b/packages/eql/packages/eql/src/generated/schema/v3/eql_v3_json_search.json index 99c8ab2f81..df9fc453e8 100644 --- a/packages/eql/packages/eql/src/generated/schema/v3/eql_v3_json_search.json +++ b/packages/eql/packages/eql/src/generated/schema/v3/eql_v3_json_search.json @@ -42,13 +42,10 @@ }, "SteVecEntry": { "additionalProperties": false, - "description": "`public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a\nselector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the\ndecryption unit is `h` + `s` + `c`, with the document `h` grafted onto\nextracted entries by `->`), an optional array-membership marker `a`\n(emitted only when true), and — for ordered (number/string) path entries\nonly — the `op` ordering term. Value entries (value-inclusive selectors)\nand non-orderable path entries are term-less: exact matching is selector\npresence, so no per-entry equality term exists (`hm` is retired). The\noptional `i`/`v`/`h` fields model metadata grafted onto an entry returned by\n`->`; naming them explicitly keeps unknown keys rejectable.", + "description": "`public.eql_v3_json_entry` — one sv element (returned by `->`). Carries a\nselector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the\ndecryption unit is `h` + `s` + `c`, with the document `h` grafted onto\nextracted entries by `->`), an optional array-membership marker `a`\n(a boolean; producers emit it only when true), and — for ordered (number/string) path entries\nonly — the `op` ordering term. Value entries (value-inclusive selectors)\nand non-orderable path entries are term-less: exact matching is selector\npresence, so no per-entry equality term exists (`hm` is retired). The\noptional `i`/`v`/`h` fields model metadata grafted onto an entry returned by\n`->`; naming them explicitly keeps unknown keys rejectable.", "properties": { "a": { - "type": [ - "boolean", - "null" - ] + "type": "boolean" }, "c": { "$ref": "#/$defs/EntryCiphertext" @@ -112,8 +109,12 @@ "$id": "https://schemas.cipherstash.com/eql/v3/eql_v3_json_search.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, - "description": "`public.eql_v3_json_search` — a SteVec encrypted-JSON document\n(`{v, k, i, h, sv:[entry]}`, no root ciphertext — the root document\nciphertext lives on the root sv entry). Strict. `k` is the `\"sv\"` form\ndiscriminator (see [`SteVecForm`]); `h` is the document [`KeyHeader`],\nstored once for the whole document (every entry encrypts under the\ndocument's single data key, with per-entry nonces derived from the\nentries' selectors).", + "description": "`public.eql_v3_json_search` — a SteVec encrypted-JSON document\n(`{v, k, i, h, sv:[entry]}` plus an optional array-root flag `a`, no root ciphertext — the root document\nciphertext lives on the root sv entry). Strict. `k` is the `\"sv\"` form\ndiscriminator (see [`SteVecForm`]); `h` is the document [`KeyHeader`],\nstored once for the whole document (every entry encrypts under the\ndocument's single data key, with per-entry nonces derived from the\nentries' selectors).", "properties": { + "a": { + "description": "Array-root marker. The SQL root validator allows it and the array\naccessors (`jsonb_array_length`, `jsonb_array_elements`, `->(doc, int)`)\nREQUIRE it (`eql_v3_internal.is_ste_vec_array`), so a document the\ndatabase accepts must also parse here. Optional and non-nullable: SQL\nrejects `\"a\": null` (`jsonb_typeof(...) = 'boolean'`), so the schema\nand deserializer reject it too.", + "type": "boolean" + }, "h": { "$ref": "#/$defs/KeyHeader" }, diff --git a/packages/eql/packages/eql/src/generated/v3/SteVecDocument.ts b/packages/eql/packages/eql/src/generated/v3/SteVecDocument.ts index f0d423fc46..7fc4faecdb 100644 --- a/packages/eql/packages/eql/src/generated/v3/SteVecDocument.ts +++ b/packages/eql/packages/eql/src/generated/v3/SteVecDocument.ts @@ -7,11 +7,20 @@ import type { SteVecForm } from "./SteVecForm"; /** * `public.eql_v3_json_search` — a SteVec encrypted-JSON document - * (`{v, k, i, h, sv:[entry]}`, no root ciphertext — the root document + * (`{v, k, i, h, sv:[entry]}` plus an optional array-root flag `a`, no root ciphertext — the root document * ciphertext lives on the root sv entry). Strict. `k` is the `"sv"` form * discriminator (see [`SteVecForm`]); `h` is the document [`KeyHeader`], * stored once for the whole document (every entry encrypts under the * document's single data key, with per-entry nonces derived from the * entries' selectors). */ -export type SteVecDocument = { v: SchemaVersion, k: SteVecForm, i: Identifier, h: KeyHeader, sv: Array, }; +export type SteVecDocument = { v: SchemaVersion, k: SteVecForm, i: Identifier, h: KeyHeader, sv: Array, +/** + * Array-root marker. The SQL root validator allows it and the array + * accessors (`jsonb_array_length`, `jsonb_array_elements`, `->(doc, int)`) + * REQUIRE it (`eql_v3_internal.is_ste_vec_array`), so a document the + * database accepts must also parse here. Optional and non-nullable: SQL + * rejects `"a": null` (`jsonb_typeof(...) = 'boolean'`), so the schema + * and deserializer reject it too. + */ +a?: boolean, }; diff --git a/packages/eql/packages/eql/src/generated/v3/SteVecEntry.ts b/packages/eql/packages/eql/src/generated/v3/SteVecEntry.ts index 4b23d1c463..1474be670b 100644 --- a/packages/eql/packages/eql/src/generated/v3/SteVecEntry.ts +++ b/packages/eql/packages/eql/src/generated/v3/SteVecEntry.ts @@ -11,11 +11,11 @@ import type { Selector } from "./Selector"; * selector `s`, raw AEAD ciphertext `c` (see [`EntryCiphertext`] — the * decryption unit is `h` + `s` + `c`, with the document `h` grafted onto * extracted entries by `->`), an optional array-membership marker `a` - * (emitted only when true), and — for ordered (number/string) path entries + * (a boolean; producers emit it only when true), and — for ordered (number/string) path entries * only — the `op` ordering term. Value entries (value-inclusive selectors) * and non-orderable path entries are term-less: exact matching is selector * presence, so no per-entry equality term exists (`hm` is retired). The * optional `i`/`v`/`h` fields model metadata grafted onto an entry returned by * `->`; naming them explicitly keeps unknown keys rejectable. */ -export type SteVecEntry = { s: Selector, c: EntryCiphertext, a?: boolean | null, op?: OpeCllw, i?: Identifier, v?: SchemaVersion, h?: KeyHeader, }; +export type SteVecEntry = { s: Selector, c: EntryCiphertext, a?: boolean, op?: OpeCllw, i?: Identifier, v?: SchemaVersion, h?: KeyHeader, }; diff --git a/packages/eql/src/v3/json/functions.sql b/packages/eql/src/v3/json/functions.sql index b5f00798d0..1fe1621780 100644 --- a/packages/eql/src/v3/json/functions.sql +++ b/packages/eql/src/v3/json/functions.sql @@ -199,7 +199,9 @@ AS $$ INTO ary FROM jsonb_array_elements(sv) AS elem; - RETURN ary; + -- array_agg over zero rows is NULL; an empty sv is an empty array, and + -- callers (array length / elements) loop over its bounds. + RETURN COALESCE(ary, '{}'::jsonb[]); END; $$ LANGUAGE plpgsql; @@ -212,7 +214,10 @@ CREATE FUNCTION {{prefix}}_internal.is_ste_vec_array(val jsonb) SET search_path = pg_catalog, extensions, public AS $$ BEGIN - IF val ? 'a' THEN + -- Guard the cast: a non-boolean `a` (e.g. 'maybe') would otherwise raise. + -- The document validator rejects one at storage time; raw jsonb callers + -- get "not an array" instead of a cast error. + IF jsonb_typeof(val->'a') = 'boolean' THEN RETURN (val->>'a')::boolean; END IF; RETURN false; @@ -323,7 +328,9 @@ AS $$ BEGIN result := false; - FOR idx IN 1..array_length(a, 1) LOOP + -- array_length('{}'::jsonb[], 1) is NULL, which a FOR bound rejects; + -- cardinality() is 0 for an empty array and NULL only for NULL (STRICT). + FOR idx IN 1..cardinality(a) LOOP _a := a[idx]; result := result OR ({{prefix}}.selector(_a) = {{prefix}}.selector(b)); EXIT WHEN result; @@ -461,7 +468,9 @@ AS $$ BEGIN IF {{prefix}}_internal.is_ste_vec_array(val) THEN sv := {{prefix}}.ste_vec(val); - RETURN array_length(sv, 1); + -- cardinality(), not array_length(sv, 1): the latter is NULL for an + -- empty sv, and an empty array has length 0. + RETURN cardinality(sv); END IF; RAISE 'cannot get array length of a non-array'; @@ -489,7 +498,7 @@ AS $$ meta := {{prefix}}.meta_data(val); sv := {{prefix}}.ste_vec(val); - FOR idx IN 1..array_length(sv, 1) LOOP + FOR idx IN 1..cardinality(sv) LOOP item = sv[idx]; RETURN NEXT (meta || item)::public.{{prefix}}_json_entry; END LOOP; diff --git a/packages/eql/src/v3/json/operators.sql b/packages/eql/src/v3/json/operators.sql index fbdeb44aaf..21f88fb209 100644 --- a/packages/eql/src/v3/json/operators.sql +++ b/packages/eql/src/v3/json/operators.sql @@ -278,7 +278,7 @@ CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b public.{{prefix} RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) + SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; CREATE OPERATOR < ( @@ -299,7 +299,7 @@ CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b public.{{prefix RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) + SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; CREATE OPERATOR <= ( @@ -320,7 +320,7 @@ CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b public.{{prefix} RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) + SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; CREATE OPERATOR > ( @@ -341,7 +341,7 @@ CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b public.{{prefix RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS $$ - SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) + SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; CREATE OPERATOR >= ( diff --git a/packages/eql/src/v3/json/types.sql b/packages/eql/src/v3/json/types.sql index 3daca3e507..a7dfdd6955 100644 --- a/packages/eql/src/v3/json/types.sql +++ b/packages/eql/src/v3/json/types.sql @@ -92,7 +92,8 @@ $$; --! 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. +--! rejected; `k` and `a` remain optional, and `a`, when present, must be a +--! JSON boolean (matching the sv entry validator). CREATE OR REPLACE FUNCTION public.{{prefix}}_is_valid_ste_vec_document_payload(val jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE @@ -105,6 +106,7 @@ AS $$ AND jsonb_typeof(val -> 'h') = 'string' AND jsonb_typeof(val -> 'sv') = 'array' AND val - ARRAY['v', 'k', 'i', 'h', 'sv', 'a']::text[] = '{}'::jsonb + AND (NOT (val ? 'a') OR jsonb_typeof(val -> 'a') = 'boolean') AND NOT EXISTS ( SELECT 1 FROM jsonb_array_elements( @@ -250,6 +252,13 @@ $$; --! GIN index expression: --! `GIN ({{prefix}}.to_ste_vec_query(col)::jsonb jsonb_path_ops)`. --! +--! @note There is deliberately no `CREATE CAST` from `public.{{prefix}}_json_search` +--! to `{{prefix}}.query_json`. PostgreSQL ignores a cast whose source type is a +--! domain (it warns "cast will be ignored because the source data type is a +--! domain"), so `doc::{{prefix}}.query_json` would never call +--! `to_ste_vec_query`; it is a plain binary coercion that then fails the +--! `query_json` CHECK. Call `{{prefix}}.to_ste_vec_query(col)` explicitly. +--! --! @param e public.{{prefix}}_json_search Source encrypted payload --! @return {{prefix}}.query_json Query-shaped needle, sv elements normalised. --! @see {{prefix}}.query_json @@ -292,7 +301,3 @@ AS $$ ) )::{{prefix}}.query_json $$; - -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/scalars/bigint/bigint_eq_functions.sql b/packages/eql/src/v3/scalars/bigint/bigint_eq_functions.sql index c28ef106c7..ba5b4e7ca2 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_eq_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_eq. --! @param a public.{{prefix}}_bigint_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_bigint_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_bigint_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_big --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_bigint_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_bigint_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_eq. --! @param a public.{{prefix}}_bigint_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_bigint_eq) = {{prefix}}.eq_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_eq. --! @param a public.{{prefix}}_bigint_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_bigint_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_bigint_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_bi --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_bigint_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_bigint_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_bigint_eq. --! 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 ad9b327d03..26661ca95d 100644 --- a/packages/eql/src/v3/scalars/bigint/bigint_ord_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/bigint_ord_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_b --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) = {{prefix}}.o --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) <> {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_b --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) < {{prefix}}.o --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) <= {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_b --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) > {{prefix}}.o --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord. --! 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 70ef509249..53298a5c48 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 @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_b --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) = {{prefix --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) <> {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_b --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) < {{prefix --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) <= {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_b --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) > {{prefix --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_bigint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ope. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_bigint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_bigint_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ope. --! 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 aedbcafc21..96b308ed0b 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 @@ -22,7 +22,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) = {{pr --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) <> {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) < {{pr --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) <= {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) > {{pr --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_bigint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_bigint_ord_ore. --! @param a jsonb @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_bigint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_bigint_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_bigint_ord_ore. --! 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 2098bf8307..81d0d2e7db 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 @@ -72,7 +72,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_bigint_ord @@ -80,7 +80,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -88,7 +88,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_bigint_ord @@ -96,7 +96,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -104,7 +104,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_bigint_ord @@ -112,7 +112,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -120,7 +120,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_bigint_ord @@ -128,7 +128,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! @@ -192,7 +192,7 @@ LANGUAGE plpgsql; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_bigint_ord_ope @@ -200,7 +200,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -208,7 +208,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_bigint_ord_ope @@ -216,7 +216,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -224,7 +224,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_bigint_ord_ope @@ -232,7 +232,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -240,7 +240,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_bigint_ord_ope @@ -248,4 +248,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; 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 7983a84ae3..2afe33de92 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_eq. --! @param a {{prefix}}.query_bigint_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_eq. --! @param a public.{{prefix}}_bigint_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_eq. --! @param a {{prefix}}.query_bigint_eq @@ -44,4 +44,112 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_eq (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: {{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_eq left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_eq (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: {{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_eq left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_eq (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: {{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_eq left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_eq (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: {{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_eq left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_eq (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: {{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_eq left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_eq (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_eq: {{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_eq left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_eq, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_eq and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 d726740a70..acf8ae2825 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 @@ -29,3 +29,63 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_eq, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); 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 c85509ab28..d4a9b2d50f 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a {{prefix}}.query_bigint_ord @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a {{prefix}}.query_bigint_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a {{prefix}}.query_bigint_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a {{prefix}}.query_bigint_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a {{prefix}}.query_bigint_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a public.{{prefix}}_bigint_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord. --! @param a {{prefix}}.query_bigint_ord @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_eq left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_eq (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_eq left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_eq (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord: {{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_bigint_ord, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_bigint_ord and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 6315451b98..70e21f586a 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a {{prefix}}.query_bigint_ord_ope @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a {{prefix}}.query_bigint_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a {{prefix}}.query_bigint_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a {{prefix}}.query_bigint_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a {{prefix}}.query_bigint_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a public.{{prefix}}_bigint_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ope. --! @param a {{prefix}}.query_bigint_ord_ope @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_eq left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_eq (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_eq left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_eq (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ore left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint_ord_ore, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_bigint_ord_ore and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ope: {{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ope left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_bigint_ord_ope, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_bigint_ord_ope and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; 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 2f01b668a9..63b35e54d3 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_bigint_ord_ope, RIGHTARG = public.{{prefix}}_bigint_ord +); 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 42274269fe..64d1320b8a 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ore, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_bigint_ord, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); 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 8aa94e2f86..b2306959af 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a {{prefix}}.query_bigint_ord_ore @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a {{prefix}}.query_bigint_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a {{prefix}}.query_bigint_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a {{prefix}}.query_bigint_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a {{prefix}}.query_bigint_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a public.{{prefix}}_bigint_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_bigint_ord_ore. --! @param a {{prefix}}.query_bigint_ord_ore @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_eq left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_eq (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_eq left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_eq, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_eq and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_eq (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint_ord, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_bigint_ord and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_bigint_ord_ope left operand +--! @param b {{prefix}}.query_bigint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_bigint_ord_ope, b {{prefix}}.query_bigint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_bigint_ord_ope and {{prefix}}.query_bigint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_bigint_ord_ore: {{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_bigint_ord_ore left operand +--! @param b public.{{prefix}}_bigint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_bigint_ord_ore, b public.{{prefix}}_bigint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_bigint_ord_ore and public.{{prefix}}_bigint_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 a86c283104..bf775ac3d8 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_eq, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint_ord, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_bigint_ord_ope, RIGHTARG = {{prefix}}.query_bigint_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_bigint_ord_ore, RIGHTARG = public.{{prefix}}_bigint_ord_ope +); 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 index 712b5e9aed..cd73e4fa05 100644 --- a/packages/eql/src/v3/scalars/bigint/query_bigint_range_functions.sql +++ b/packages/eql/src/v3/scalars/bigint/query_bigint_range_functions.sql @@ -114,7 +114,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_bigint_ord value lies in a range, both bounds included. --! @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_bigint_ord_ope value lies in a range, both bounds included. --! @@ -174,4 +174,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 ca4cd6750b..ff5c074cbc 100644 --- a/packages/eql/src/v3/scalars/date/date_eq_functions.sql +++ b/packages/eql/src/v3/scalars/date/date_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_eq. --! @param a public.{{prefix}}_date_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_date_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_date_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_date_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_dat --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_date_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_date_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_eq. --! @param a public.{{prefix}}_date_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_date_eq) = {{prefix}}.eq_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_eq. --! @param a public.{{prefix}}_date_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_date_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_date_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_date_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_da --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_date_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_date_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_date_eq. --! 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 859031af8b..403bdc1667 100644 --- a/packages/eql/src/v3/scalars/date/date_ord_functions.sql +++ b/packages/eql/src/v3/scalars/date/date_ord_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) = {{prefix}}.ord --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) <> {{prefix}}.or --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) < {{prefix}}.ord --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) <= {{prefix}}.or --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) > {{prefix}}.ord --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a public.{{prefix}}_date_ord @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_date_ord. --! 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 c64f823006..45ef087164 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 @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) = {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) <> {{prefix} --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) < {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) <= {{prefix} --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) > {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_date_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ope. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_date_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_date_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ope. --! 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 6c7da44299..efae6dc129 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 @@ -22,7 +22,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) = {{pref --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) <> {{pre --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) < {{pref --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) <= {{pre --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) > {{pref --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_date_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_date_ord_ore. --! @param a jsonb @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_date_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_date_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_date_ord_ore. --! 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 11dc752129..9d2f3e9395 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_eq. --! @param a {{prefix}}.query_date_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_eq. --! @param a public.{{prefix}}_date_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_eq. --! @param a {{prefix}}.query_date_eq @@ -44,4 +44,112 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_eq (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: {{prefix}}.query_date_eq and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_eq left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_eq and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_eq (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: {{prefix}}.query_date_eq and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_eq left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_eq and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: public.{{prefix}}_date_ord and {{prefix}}.query_date_eq (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: {{prefix}}.query_date_eq and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_eq left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_eq and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: public.{{prefix}}_date_ord and {{prefix}}.query_date_eq (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: {{prefix}}.query_date_eq and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_eq left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_eq and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_eq (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: {{prefix}}.query_date_eq and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_eq left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_eq and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_eq (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_eq: {{prefix}}.query_date_eq and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_eq left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_eq, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_eq and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 fac95ee103..37d14f9b76 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 @@ -29,3 +29,63 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_eq, RIGHTARG = public.{{prefix}}_date_ord_ope +); 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 856f51cea2..53fda356ac 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a {{prefix}}.query_date_ord @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a public.{{prefix}}_date_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a {{prefix}}.query_date_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a public.{{prefix}}_date_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a {{prefix}}.query_date_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a public.{{prefix}}_date_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a {{prefix}}.query_date_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a public.{{prefix}}_date_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a {{prefix}}.query_date_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a public.{{prefix}}_date_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord. --! @param a {{prefix}}.query_date_ord @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_eq and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_eq left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_eq and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_eq (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord and public.{{prefix}}_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_eq and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_eq left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_eq and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_eq (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord and public.{{prefix}}_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord: {{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_date_ord, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_date_ord and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 f8c65dff70..8715f9c1c6 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a {{prefix}}.query_date_ord_ope @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a {{prefix}}.query_date_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a {{prefix}}.query_date_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a {{prefix}}.query_date_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a {{prefix}}.query_date_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a public.{{prefix}}_date_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ope. --! @param a {{prefix}}.query_date_ord_ope @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_eq and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_eq left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_eq and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_eq (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_eq and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_eq left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_eq and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_eq (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ore left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date_ord_ore, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_date_ord_ore and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ope: {{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ope left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_date_ord_ope, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_date_ord_ope and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; 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 c1de6b14ca..379e3c2998 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_date_ord_ope, RIGHTARG = public.{{prefix}}_date_ord +); 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 c555e1b20b..aa5b67fd77 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date_ord_ore, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_date_ord, RIGHTARG = public.{{prefix}}_date_ord_ope +); 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 5150c1f404..2fcc1fe1b2 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a {{prefix}}.query_date_ord_ore @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a {{prefix}}.query_date_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a {{prefix}}.query_date_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a {{prefix}}.query_date_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a {{prefix}}.query_date_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a public.{{prefix}}_date_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_date_ord_ore. --! @param a {{prefix}}.query_date_ord_ore @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_eq and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_eq left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_eq and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_eq (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_eq and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_eq left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_eq, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_eq and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_eq (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date_ord, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_date_ord and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_date_ord_ope left operand +--! @param b {{prefix}}.query_date_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_date_ord_ope, b {{prefix}}.query_date_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_date_ord_ope and {{prefix}}.query_date_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_date_ord_ore: {{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_date_ord_ore left operand +--! @param b public.{{prefix}}_date_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_date_ord_ore, b public.{{prefix}}_date_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_date_ord_ore and public.{{prefix}}_date_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 4e22bab872..bdbf2fa9c8 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_eq, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date_ord, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_date_ord_ope, RIGHTARG = {{prefix}}.query_date_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_date_ord_ore, RIGHTARG = public.{{prefix}}_date_ord_ope +); 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 index b1e45cd41f..44d8f1285f 100644 --- a/packages/eql/src/v3/scalars/date/query_date_range_functions.sql +++ b/packages/eql/src/v3/scalars/date/query_date_range_functions.sql @@ -114,7 +114,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_date_ord value lies in a range, both bounds included. --! @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_date_ord_ope value lies in a range, both bounds included. --! @@ -174,4 +174,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 597bb5b4e1..0cc074ac8a 100644 --- a/packages/eql/src/v3/scalars/double/double_eq_functions.sql +++ b/packages/eql/src/v3/scalars/double/double_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_eq. --! @param a public.{{prefix}}_double_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_double_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_double_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_double_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_dou --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_double_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_double_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_eq. --! @param a public.{{prefix}}_double_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_double_eq) = {{prefix}}.eq_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_eq. --! @param a public.{{prefix}}_double_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_double_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_double_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_double_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_do --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_double_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_double_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_double_eq. --! 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 c599d065ec..288b783e7e 100644 --- a/packages/eql/src/v3/scalars/double/double_ord_functions.sql +++ b/packages/eql/src/v3/scalars/double/double_ord_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) = {{prefix}}.o --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) <> {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) < {{prefix}}.o --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) <= {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) > {{prefix}}.o --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a public.{{prefix}}_double_ord @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_double_ord. --! 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 62ae689f7a..7cc8f97427 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 @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) = {{prefix --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) <> {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) < {{prefix --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) <= {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_d --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) > {{prefix --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_double_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ope. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_double_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_double_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ope. --! 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 0c7bdd2a2b..5b8b27394a 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 @@ -22,7 +22,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) = {{pr --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) <> {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) < {{pr --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) <= {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) > {{pr --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_double_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_double_ord_ore. --! @param a jsonb @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_double_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_double_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_double_ord_ore. --! 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 03159abde2..a820644ff8 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 @@ -72,7 +72,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_double_ord @@ -80,7 +80,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -88,7 +88,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_double_ord @@ -96,7 +96,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -104,7 +104,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_double_ord @@ -112,7 +112,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -120,7 +120,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_double_ord @@ -128,7 +128,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_double_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! @@ -192,7 +192,7 @@ LANGUAGE plpgsql; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_double_ord_ope @@ -200,7 +200,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -208,7 +208,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_double_ord_ope @@ -216,7 +216,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -224,7 +224,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_double_ord_ope @@ -232,7 +232,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -240,7 +240,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_double_ord_ope @@ -248,4 +248,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; 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 814bf588e0..ba433576c6 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_eq. --! @param a {{prefix}}.query_double_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_eq. --! @param a public.{{prefix}}_double_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_eq. --! @param a {{prefix}}.query_double_eq @@ -44,4 +44,112 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_eq (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: {{prefix}}.query_double_eq and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_eq left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_eq and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_eq (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: {{prefix}}.query_double_eq and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_eq left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_eq and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: public.{{prefix}}_double_ord and {{prefix}}.query_double_eq (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: {{prefix}}.query_double_eq and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_eq left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_eq and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: public.{{prefix}}_double_ord and {{prefix}}.query_double_eq (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: {{prefix}}.query_double_eq and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_eq left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_eq and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_eq (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: {{prefix}}.query_double_eq and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_eq left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_eq and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_eq (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_eq: {{prefix}}.query_double_eq and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_eq left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_eq, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_eq and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 f6294d8d44..c6699e83a4 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 @@ -29,3 +29,63 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_eq, RIGHTARG = public.{{prefix}}_double_ord_ope +); 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 de3f645c54..e541630b94 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a {{prefix}}.query_double_ord @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a public.{{prefix}}_double_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a {{prefix}}.query_double_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a public.{{prefix}}_double_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a {{prefix}}.query_double_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a public.{{prefix}}_double_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a {{prefix}}.query_double_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a public.{{prefix}}_double_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a {{prefix}}.query_double_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a public.{{prefix}}_double_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord. --! @param a {{prefix}}.query_double_ord @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_eq and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_eq left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_eq and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_eq (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord and public.{{prefix}}_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_eq and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_eq left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_eq and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_eq (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord and public.{{prefix}}_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord: {{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_double_ord, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_double_ord and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 dfa4f59089..94ecee5e3b 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a {{prefix}}.query_double_ord_ope @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a {{prefix}}.query_double_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a {{prefix}}.query_double_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a {{prefix}}.query_double_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a {{prefix}}.query_double_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a public.{{prefix}}_double_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ope. --! @param a {{prefix}}.query_double_ord_ope @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_eq and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_eq left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_eq and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_eq (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_eq and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_eq left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_eq and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_eq (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ore left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double_ord_ore, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_double_ord_ore and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ope: {{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ope left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_double_ord_ope, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_double_ord_ope and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; 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 99f6594d29..78691a633a 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_double_ord_ope, RIGHTARG = public.{{prefix}}_double_ord +); 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 fe4aa9e5e4..1428b67809 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double_ord_ore, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_double_ord, RIGHTARG = public.{{prefix}}_double_ord_ope +); 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 fe4943c207..97fedac6c6 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a {{prefix}}.query_double_ord_ore @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a {{prefix}}.query_double_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a {{prefix}}.query_double_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a {{prefix}}.query_double_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a {{prefix}}.query_double_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a public.{{prefix}}_double_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_double_ord_ore. --! @param a {{prefix}}.query_double_ord_ore @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_eq and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_eq left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_eq and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_eq (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_eq and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_eq left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_eq, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_eq and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_eq (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double_ord, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_double_ord and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_double_ord_ope left operand +--! @param b {{prefix}}.query_double_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_double_ord_ope, b {{prefix}}.query_double_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_double_ord_ope and {{prefix}}.query_double_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_double_ord_ore: {{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_double_ord_ore left operand +--! @param b public.{{prefix}}_double_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_double_ord_ore, b public.{{prefix}}_double_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_double_ord_ore and public.{{prefix}}_double_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 00a024cc5b..096b4f7764 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_eq, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double_ord, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_double_ord_ope, RIGHTARG = {{prefix}}.query_double_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_double_ord_ore, RIGHTARG = public.{{prefix}}_double_ord_ope +); 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 index a14662ab59..c35efdeb4b 100644 --- a/packages/eql/src/v3/scalars/double/query_double_range_functions.sql +++ b/packages/eql/src/v3/scalars/double/query_double_range_functions.sql @@ -114,7 +114,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_double_ord value lies in a range, both bounds included. --! @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_double_ord_ope value lies in a range, both bounds included. --! @@ -174,4 +174,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 8247eb048d..83692e6880 100644 --- a/packages/eql/src/v3/scalars/integer/integer_eq_functions.sql +++ b/packages/eql/src/v3/scalars/integer/integer_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_eq. --! @param a public.{{prefix}}_integer_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_integer_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_integer_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_int --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_integer_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_integer_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_eq. --! @param a public.{{prefix}}_integer_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_integer_eq) = {{prefix}}.eq --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_eq. --! @param a public.{{prefix}}_integer_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_integer_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_integer_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_in --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_integer_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_integer_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_integer_eq. --! 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 b1ba2ddae8..c3348b1d25 100644 --- a/packages/eql/src/v3/scalars/integer/integer_ord_functions.sql +++ b/packages/eql/src/v3/scalars/integer/integer_ord_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_i --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) = {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) <> {{prefix}} --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_i --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) < {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) <= {{prefix}} --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_i --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) > {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord. --! 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 dc9b5a81bd..a91ba1ebd3 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 @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_i --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) = {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) <> {{pref --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_i --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) < {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) <= {{pref --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_i --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) > {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_integer_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ope. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_integer_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_integer_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ope. --! 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 cfbb1ecbd2..5e73c11e48 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 @@ -22,7 +22,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) = {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) <> {{ --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) < {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) <= {{ --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) > {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_integer_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_integer_ord_ore. --! @param a jsonb @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_integer_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_integer_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_integer_ord_ore. --! 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 5aec516403..a2c82f1c09 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 @@ -72,7 +72,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_integer_ord @@ -80,7 +80,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -88,7 +88,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_integer_ord @@ -96,7 +96,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -104,7 +104,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_integer_ord @@ -112,7 +112,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -120,7 +120,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_integer_ord @@ -128,7 +128,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! @@ -192,7 +192,7 @@ LANGUAGE plpgsql; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_integer_ord_ope @@ -200,7 +200,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -208,7 +208,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_integer_ord_ope @@ -216,7 +216,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -224,7 +224,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_integer_ord_ope @@ -232,7 +232,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -240,7 +240,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_integer_ord_ope @@ -248,4 +248,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; 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 003be0b361..9b80334c0f 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_eq. --! @param a {{prefix}}.query_integer_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_eq. --! @param a public.{{prefix}}_integer_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_eq. --! @param a {{prefix}}.query_integer_eq @@ -44,4 +44,112 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_eq (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: {{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_eq left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_eq (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: {{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_eq left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_eq (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: {{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_eq left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_eq (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: {{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_eq left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_eq (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: {{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_eq left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_eq (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_eq: {{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_eq left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_eq, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_eq and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 70693b1e7c..a99acd9d6f 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 @@ -29,3 +29,63 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_eq, RIGHTARG = public.{{prefix}}_integer_ord_ope +); 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 ad05920206..252519860c 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a {{prefix}}.query_integer_ord @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a {{prefix}}.query_integer_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a {{prefix}}.query_integer_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a {{prefix}}.query_integer_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a {{prefix}}.query_integer_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a public.{{prefix}}_integer_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord. --! @param a {{prefix}}.query_integer_ord @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_eq left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_eq (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_eq left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_eq (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord: {{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_integer_ord, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_integer_ord and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 6f643a649a..f85a139253 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a {{prefix}}.query_integer_ord_ope @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a {{prefix}}.query_integer_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a {{prefix}}.query_integer_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a {{prefix}}.query_integer_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a {{prefix}}.query_integer_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a public.{{prefix}}_integer_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ope. --! @param a {{prefix}}.query_integer_ord_ope @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_eq left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_eq (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_eq left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_eq (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ore left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer_ord_ore, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_integer_ord_ore and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ope: {{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ope left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_integer_ord_ope, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_integer_ord_ope and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; 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 fb5505e1b8..573ccb560e 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_integer_ord_ope, RIGHTARG = public.{{prefix}}_integer_ord +); 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 786245e45b..869a0ff50a 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer_ord_ore, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_integer_ord, RIGHTARG = public.{{prefix}}_integer_ord_ope +); 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 824fcb264e..f83b0d42d2 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a {{prefix}}.query_integer_ord_ore @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a {{prefix}}.query_integer_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a {{prefix}}.query_integer_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a {{prefix}}.query_integer_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a {{prefix}}.query_integer_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a public.{{prefix}}_integer_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_integer_ord_ore. --! @param a {{prefix}}.query_integer_ord_ore @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_eq left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_eq (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_eq left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_eq, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_eq and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_eq (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer_ord, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_integer_ord and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_integer_ord_ope left operand +--! @param b {{prefix}}.query_integer_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_integer_ord_ope, b {{prefix}}.query_integer_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_integer_ord_ope and {{prefix}}.query_integer_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_integer_ord_ore: {{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_integer_ord_ore left operand +--! @param b public.{{prefix}}_integer_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_integer_ord_ore, b public.{{prefix}}_integer_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_integer_ord_ore and public.{{prefix}}_integer_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 d897eac843..d4c33cd5dc 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_eq, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer_ord, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_integer_ord_ope, RIGHTARG = {{prefix}}.query_integer_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_integer_ord_ore, RIGHTARG = public.{{prefix}}_integer_ord_ope +); 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 index 9b05920bd7..d8c32d80e5 100644 --- a/packages/eql/src/v3/scalars/integer/query_integer_range_functions.sql +++ b/packages/eql/src/v3/scalars/integer/query_integer_range_functions.sql @@ -114,7 +114,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_integer_ord value lies in a range, both bounds included. --! @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_integer_ord_ope value lies in a range, both bounds included. --! @@ -174,4 +174,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 d5110a0657..4e3dbe1ded 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 @@ -72,7 +72,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_numeric_ord @@ -80,7 +80,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -88,7 +88,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_numeric_ord @@ -96,7 +96,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -104,7 +104,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_numeric_ord @@ -112,7 +112,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -120,7 +120,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_numeric_ord @@ -128,7 +128,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! @@ -192,7 +192,7 @@ LANGUAGE plpgsql; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_numeric_ord_ope @@ -200,7 +200,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -208,7 +208,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_numeric_ord_ope @@ -216,7 +216,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -224,7 +224,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_numeric_ord_ope @@ -232,7 +232,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -240,7 +240,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_numeric_ord_ope @@ -248,4 +248,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; 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 a69b337591..d6eef12511 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_eq_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_eq. --! @param a public.{{prefix}}_numeric_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_numeric_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_numeric_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_num --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_numeric_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_numeric_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_eq. --! @param a public.{{prefix}}_numeric_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_numeric_eq) = {{prefix}}.eq --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_eq. --! @param a public.{{prefix}}_numeric_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_numeric_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_numeric_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_nu --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_numeric_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_numeric_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_numeric_eq. --! 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 079c1be40f..b21de59986 100644 --- a/packages/eql/src/v3/scalars/numeric/numeric_ord_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/numeric_ord_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_n --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) = {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) <> {{prefix}} --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_n --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) < {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) <= {{prefix}} --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_n --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) > {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord. --! 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 4ca0974f4c..10dd992c2c 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 @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_n --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) = {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) <> {{pref --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_n --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) < {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) <= {{pref --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_n --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) > {{prefi --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_numeric_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ope. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_numeric_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_numeric_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ope. --! 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 519252c7b1..23d6e47b2c 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 @@ -22,7 +22,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) = {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) <> {{ --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) < {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) <= {{ --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) > {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_numeric_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_numeric_ord_ore. --! @param a jsonb @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_numeric_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_numeric_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_numeric_ord_ore. --! 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 b250bac08a..9a9dd1af9c 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_eq. --! @param a {{prefix}}.query_numeric_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_eq. --! @param a public.{{prefix}}_numeric_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_eq. --! @param a {{prefix}}.query_numeric_eq @@ -44,4 +44,112 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_eq (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: {{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_eq left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_eq (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: {{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_eq left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_eq (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: {{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_eq left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_eq (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: {{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_eq left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_eq (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: {{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_eq left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_eq (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_eq: {{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_eq left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_eq, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_eq and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 78ad85f814..f570c954d6 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 @@ -29,3 +29,63 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_eq, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); 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 08cfcf2fcf..541991914e 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a {{prefix}}.query_numeric_ord @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a {{prefix}}.query_numeric_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a {{prefix}}.query_numeric_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a {{prefix}}.query_numeric_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a {{prefix}}.query_numeric_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a public.{{prefix}}_numeric_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord. --! @param a {{prefix}}.query_numeric_ord @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_eq left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_eq (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_eq left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_eq (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord: {{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_numeric_ord, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_numeric_ord and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 cafc3daa9b..aa3fe61bc7 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a {{prefix}}.query_numeric_ord_ope @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a {{prefix}}.query_numeric_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a {{prefix}}.query_numeric_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a {{prefix}}.query_numeric_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a {{prefix}}.query_numeric_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a public.{{prefix}}_numeric_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ope. --! @param a {{prefix}}.query_numeric_ord_ope @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_eq left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_eq (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_eq left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_eq (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ore left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric_ord_ore, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_numeric_ord_ore and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ope: {{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ope left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_numeric_ord_ope, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_numeric_ord_ope and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; 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 2a16ae3af9..29e811d797 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_numeric_ord_ope, RIGHTARG = public.{{prefix}}_numeric_ord +); 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 88ba9557ee..653bc1f021 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ore, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_numeric_ord, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); 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 3426a40552..92233be821 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a {{prefix}}.query_numeric_ord_ore @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a {{prefix}}.query_numeric_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a {{prefix}}.query_numeric_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a {{prefix}}.query_numeric_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a {{prefix}}.query_numeric_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a public.{{prefix}}_numeric_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_numeric_ord_ore. --! @param a {{prefix}}.query_numeric_ord_ore @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_eq left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_eq (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_eq left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_eq, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_eq and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_eq (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric_ord, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_numeric_ord and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_numeric_ord_ope left operand +--! @param b {{prefix}}.query_numeric_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_numeric_ord_ope, b {{prefix}}.query_numeric_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_numeric_ord_ope and {{prefix}}.query_numeric_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_numeric_ord_ore: {{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_numeric_ord_ore left operand +--! @param b public.{{prefix}}_numeric_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_numeric_ord_ore, b public.{{prefix}}_numeric_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_numeric_ord_ore and public.{{prefix}}_numeric_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 b9d1959cc8..25b7445880 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_eq, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric_ord, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_numeric_ord_ope, RIGHTARG = {{prefix}}.query_numeric_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_numeric_ord_ore, RIGHTARG = public.{{prefix}}_numeric_ord_ope +); 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 index 6929ccff70..f899d891e6 100644 --- a/packages/eql/src/v3/scalars/numeric/query_numeric_range_functions.sql +++ b/packages/eql/src/v3/scalars/numeric/query_numeric_range_functions.sql @@ -114,7 +114,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_numeric_ord value lies in a range, both bounds included. --! @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_numeric_ord_ope value lies in a range, both bounds included. --! @@ -174,4 +174,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 47803945fc..8cdb3887de 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 @@ -72,7 +72,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_real_ord @@ -80,7 +80,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -88,7 +88,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_real_ord @@ -96,7 +96,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -104,7 +104,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_real_ord @@ -112,7 +112,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -120,7 +120,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_real_ord @@ -128,7 +128,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_real_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! @@ -192,7 +192,7 @@ LANGUAGE plpgsql; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_real_ord_ope @@ -200,7 +200,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -208,7 +208,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_real_ord_ope @@ -216,7 +216,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -224,7 +224,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_real_ord_ope @@ -232,7 +232,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -240,7 +240,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_real_ord_ope @@ -248,4 +248,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; 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 637bd50451..22e2e017a4 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_eq. --! @param a {{prefix}}.query_real_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_eq. --! @param a public.{{prefix}}_real_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_eq. --! @param a {{prefix}}.query_real_eq @@ -44,4 +44,112 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_eq (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: {{prefix}}.query_real_eq and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_eq left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_eq and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_eq (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: {{prefix}}.query_real_eq and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_eq left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_eq and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: public.{{prefix}}_real_ord and {{prefix}}.query_real_eq (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: {{prefix}}.query_real_eq and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_eq left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_eq and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: public.{{prefix}}_real_ord and {{prefix}}.query_real_eq (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: {{prefix}}.query_real_eq and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_eq left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_eq and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_eq (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: {{prefix}}.query_real_eq and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_eq left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_eq and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_eq (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_eq: {{prefix}}.query_real_eq and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_eq left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_eq, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_eq and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 340424f446..f82e0e448b 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 @@ -29,3 +29,63 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_eq, RIGHTARG = public.{{prefix}}_real_ord_ope +); 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 b1292e6e43..27406721d5 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a {{prefix}}.query_real_ord @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a public.{{prefix}}_real_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a {{prefix}}.query_real_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a public.{{prefix}}_real_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a {{prefix}}.query_real_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a public.{{prefix}}_real_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a {{prefix}}.query_real_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a public.{{prefix}}_real_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a {{prefix}}.query_real_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a public.{{prefix}}_real_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord. --! @param a {{prefix}}.query_real_ord @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_eq and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_eq left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_eq and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_eq (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord and public.{{prefix}}_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_eq and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_eq left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_eq and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_eq (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord and public.{{prefix}}_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord: {{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_real_ord, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_real_ord and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 6e71401eab..abefe6a515 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a {{prefix}}.query_real_ord_ope @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a {{prefix}}.query_real_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a {{prefix}}.query_real_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a {{prefix}}.query_real_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a {{prefix}}.query_real_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ope. --! @param a {{prefix}}.query_real_ord_ope @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_eq and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_eq left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_eq and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_eq (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_eq and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_eq left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_eq and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_eq (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ore left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real_ord_ore, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_real_ord_ore and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ope: {{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ope left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_real_ord_ope, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_real_ord_ope and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; 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 b8b13b85e6..03e43dd6e5 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_real_ord_ope, RIGHTARG = public.{{prefix}}_real_ord +); 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 6ae8849571..131eac61a2 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real_ord_ore, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_real_ord, RIGHTARG = public.{{prefix}}_real_ord_ope +); 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 40e4836881..d151c8b086 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a {{prefix}}.query_real_ord_ore @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a {{prefix}}.query_real_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a {{prefix}}.query_real_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a {{prefix}}.query_real_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a {{prefix}}.query_real_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_real_ord_ore. --! @param a {{prefix}}.query_real_ord_ore @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_eq and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_eq left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_eq and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_eq (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_eq and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_eq left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_eq, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_eq and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_eq (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real_ord, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_real_ord and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_real_ord_ope left operand +--! @param b {{prefix}}.query_real_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_real_ord_ope, b {{prefix}}.query_real_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_real_ord_ope and {{prefix}}.query_real_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_real_ord_ore: {{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_real_ord_ore left operand +--! @param b public.{{prefix}}_real_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_real_ord_ore, b public.{{prefix}}_real_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_real_ord_ore and public.{{prefix}}_real_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 8e8d624d80..01937ba393 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_eq, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real_ord, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_real_ord_ope, RIGHTARG = {{prefix}}.query_real_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_real_ord_ore, RIGHTARG = public.{{prefix}}_real_ord_ope +); 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 index 4e0e3e6264..09dd5abd97 100644 --- a/packages/eql/src/v3/scalars/real/query_real_range_functions.sql +++ b/packages/eql/src/v3/scalars/real/query_real_range_functions.sql @@ -114,7 +114,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_real_ord value lies in a range, both bounds included. --! @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_real_ord_ope value lies in a range, both bounds included. --! @@ -174,4 +174,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 382829281e..e878b2921a 100644 --- a/packages/eql/src/v3/scalars/real/real_eq_functions.sql +++ b/packages/eql/src/v3/scalars/real/real_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_eq. --! @param a public.{{prefix}}_real_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_real_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_real_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_real_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_rea --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_real_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_real_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_eq. --! @param a public.{{prefix}}_real_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_real_eq) = {{prefix}}.eq_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_eq, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_eq. --! @param a public.{{prefix}}_real_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_real_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_real_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_real_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_re --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_real_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_real_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_real_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_real_eq. --! 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 2b54c43125..e9f408c4bf 100644 --- a/packages/eql/src/v3/scalars/real/real_ord_functions.sql +++ b/packages/eql/src/v3/scalars/real/real_ord_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_r --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) = {{prefix}}.ord --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) <> {{prefix}}.or --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_r --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) < {{prefix}}.ord --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) <= {{prefix}}.or --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_r --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) > {{prefix}}.ord --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a public.{{prefix}}_real_ord @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_real_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_real_ord. --! 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 7143e3fa6d..7dfba9dd85 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 @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_r --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) = {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) <> {{prefix} --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_r --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) < {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) <= {{prefix} --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_r --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) > {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a public.{{prefix}}_real_ord_ope @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_real_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ope. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_real_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_real_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ope. --! 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 44da6bc7fa..c975e8c013 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 @@ -22,7 +22,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) = {{pref --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) <> {{pre --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) < {{pref --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) <= {{pre --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) > {{pref --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a public.{{prefix}}_real_ord_ore @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_real_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_real_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_real_ord_ore. --! @param a jsonb @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_real_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_real_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_real_ord_ore. --! 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 7f3614d94b..2add42a4c9 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 @@ -72,7 +72,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_smallint_ord @@ -80,7 +80,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -88,7 +88,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_smallint_ord @@ -96,7 +96,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -104,7 +104,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_smallint_ord @@ -112,7 +112,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -120,7 +120,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_smallint_ord @@ -128,7 +128,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! @@ -192,7 +192,7 @@ LANGUAGE plpgsql; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_smallint_ord_ope @@ -200,7 +200,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -208,7 +208,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_smallint_ord_ope @@ -216,7 +216,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -224,7 +224,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_smallint_ord_ope @@ -232,7 +232,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -240,7 +240,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_smallint_ord_ope @@ -248,4 +248,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; 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 15357ca4a7..f613ccf931 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_eq. --! @param a {{prefix}}.query_smallint_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_eq. --! @param a public.{{prefix}}_smallint_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_eq. --! @param a {{prefix}}.query_smallint_eq @@ -44,4 +44,112 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_eq (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: {{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_eq left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_eq (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: {{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_eq left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_eq (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: {{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_eq left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_eq (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: {{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_eq left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_eq (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: {{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_eq left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_eq (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_eq: {{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_eq left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_eq, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_eq and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 1d91a489c6..5a33f468df 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 @@ -29,3 +29,63 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_eq, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); 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 59d9eda075..3f9759deaf 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a {{prefix}}.query_smallint_ord @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a {{prefix}}.query_smallint_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a {{prefix}}.query_smallint_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a {{prefix}}.query_smallint_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a {{prefix}}.query_smallint_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord. --! @param a {{prefix}}.query_smallint_ord @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_eq left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_eq (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_eq left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_eq (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord: {{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_smallint_ord, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_smallint_ord and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 0b14e08314..d90efb0689 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a {{prefix}}.query_smallint_ord_ope @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a {{prefix}}.query_smallint_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a {{prefix}}.query_smallint_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a {{prefix}}.query_smallint_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a {{prefix}}.query_smallint_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ope. --! @param a {{prefix}}.query_smallint_ord_ope @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_eq left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_eq (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_eq left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_eq (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ore left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint_ord_ore, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_smallint_ord_ore and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ope: {{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ope left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_smallint_ord_ope, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_smallint_ord_ope and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; 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 0f37d5b4e1..1852868daf 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_smallint_ord_ope, RIGHTARG = public.{{prefix}}_smallint_ord +); 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 73dc194f70..3657a13904 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ore, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_smallint_ord, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); 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 db35558c1b..182c9ef723 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a {{prefix}}.query_smallint_ord_ore @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a {{prefix}}.query_smallint_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a {{prefix}}.query_smallint_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a {{prefix}}.query_smallint_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a {{prefix}}.query_smallint_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_smallint_ord_ore. --! @param a {{prefix}}.query_smallint_ord_ore @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_eq left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_eq (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_eq left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_eq, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_eq and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_eq (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint_ord, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_smallint_ord and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_smallint_ord_ope left operand +--! @param b {{prefix}}.query_smallint_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_smallint_ord_ope, b {{prefix}}.query_smallint_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_smallint_ord_ope and {{prefix}}.query_smallint_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_smallint_ord_ore: {{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_smallint_ord_ore left operand +--! @param b public.{{prefix}}_smallint_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_smallint_ord_ore, b public.{{prefix}}_smallint_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_smallint_ord_ore and public.{{prefix}}_smallint_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 85bccdbf8e..a563c0af65 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_eq, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint_ord, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_smallint_ord_ope, RIGHTARG = {{prefix}}.query_smallint_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_smallint_ord_ore, RIGHTARG = public.{{prefix}}_smallint_ord_ope +); 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 index 3ac62a2f56..1f7bb12af9 100644 --- a/packages/eql/src/v3/scalars/smallint/query_smallint_range_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/query_smallint_range_functions.sql @@ -114,7 +114,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_smallint_ord value lies in a range, both bounds included. --! @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_smallint_ord_ope value lies in a range, both bounds included. --! @@ -174,4 +174,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 ec5cf49115..263bc933b9 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_eq_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_eq. --! @param a public.{{prefix}}_smallint_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_smallint_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_smallint_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_sma --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_smallint_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_smallint_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_eq. --! @param a public.{{prefix}}_smallint_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_smallint_eq) = {{prefix}}.e --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_eq, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_eq. --! @param a public.{{prefix}}_smallint_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_smallint_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_smallint_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_sm --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_smallint_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_smallint_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_smallint_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_smallint_eq. --! 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 973876d47b..65cf84831b 100644 --- a/packages/eql/src/v3/scalars/smallint/smallint_ord_functions.sql +++ b/packages/eql/src/v3/scalars/smallint/smallint_ord_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_s --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) = {{prefix}} --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) <> {{prefix} --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_s --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) < {{prefix}} --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) <= {{prefix} --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_s --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) > {{prefix}} --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a public.{{prefix}}_smallint_ord @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_smallint_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord. --! 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 0c1d4ee14c..355d37625c 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 @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_s --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) = {{pref --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) <> {{pre --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_s --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) < {{pref --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) <= {{pre --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_s --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) > {{pref --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a public.{{prefix}}_smallint_ord_ope @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_smallint_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ope. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_smallint_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_smallint_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ope. --! 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 c01347c89d..a0f57ed167 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 @@ -22,7 +22,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) = {{ --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) <> { --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) < {{ --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) <= { --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) > {{ --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a public.{{prefix}}_smallint_ord_ore @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_smallint_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_smallint_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_smallint_ord_ore. --! @param a jsonb @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_smallint_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_smallint_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_smallint_ord_ore. --! 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 2eb87eb1f1..0f23214bae 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 @@ -72,7 +72,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_text_ord @@ -80,7 +80,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -88,7 +88,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_text_ord @@ -96,7 +96,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -104,7 +104,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_text_ord @@ -112,7 +112,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -120,7 +120,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_json_entry, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_text_ord @@ -128,7 +128,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_ord, b public.{{prefix}}_json_entry) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_json_entry. --! @@ -192,7 +192,7 @@ LANGUAGE plpgsql; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_text_ord_ope @@ -200,7 +200,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -208,7 +208,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_text_ord_ope @@ -216,7 +216,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -224,7 +224,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_text_ord_ope @@ -232,7 +232,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a public.{{prefix}}_json_entry @@ -240,7 +240,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_json_entry. --! @param a {{prefix}}.query_text_ord_ope @@ -248,7 +248,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for 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 0e6260a19e..3ed3dc6ae3 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_eq. --! @param a {{prefix}}.query_text_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_eq. --! @param a public.{{prefix}}_text_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_eq. --! @param a {{prefix}}.query_text_eq @@ -44,4 +44,184 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_eq and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_eq and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_ord and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_eq and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_ord and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_eq and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_eq and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_eq and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_eq and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_eq and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_search and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_eq and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: public.{{prefix}}_text_search and {{prefix}}.query_text_eq (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_eq: {{prefix}}.query_text_eq and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_eq left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_eq, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_eq and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; 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 08ad73c9cf..cf9c110ed5 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 @@ -29,3 +29,103 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_eq, RIGHTARG = public.{{prefix}}_text_search +); 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 e877edf215..19dddc204b 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_match, b {{prefix}}.query_text_match) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for {{prefix}}.query_text_match. --! @param a {{prefix}}.query_text_match @@ -28,4 +28,40 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinali --! @return boolean CREATE FUNCTION {{prefix}}.matches(a {{prefix}}.query_text_match, b public.{{prefix}}_text_match) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_match: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_match (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_match right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_match) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_match'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_match: {{prefix}}.query_text_match and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_match left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a {{prefix}}.query_text_match, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', '{{prefix}}.query_text_match and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_match: public.{{prefix}}_text_search and {{prefix}}.query_text_match (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_match right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_search, b {{prefix}}.query_text_match) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', 'public.{{prefix}}_text_search and {{prefix}}.query_text_match'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_match: {{prefix}}.query_text_match and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_match left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a {{prefix}}.query_text_match, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', '{{prefix}}.query_text_match and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; 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 91dc013b8a..10740c0ac2 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 @@ -17,3 +17,23 @@ CREATE OPERATOR @@ ( LEFTARG = {{prefix}}.query_text_match, RIGHTARG = public.{{prefix}}_text_match, RESTRICT = contsel, JOIN = contjoinsel ); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_match +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = {{prefix}}.query_text_match, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_match +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = {{prefix}}.query_text_match, RIGHTARG = public.{{prefix}}_text_search +); 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 e54be6f50a..29e961b227 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 @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a {{prefix}}.query_text_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a public.{{prefix}}_text_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a {{prefix}}.query_text_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a public.{{prefix}}_text_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a {{prefix}}.query_text_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a public.{{prefix}}_text_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a {{prefix}}.query_text_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a public.{{prefix}}_text_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a {{prefix}}.query_text_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a public.{{prefix}}_text_ord @@ -108,7 +108,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord. --! @param a {{prefix}}.query_text_ord @@ -116,4 +116,472 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_eq and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_eq and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: public.{{prefix}}_text_search and {{prefix}}.query_text_ord (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord: {{prefix}}.query_text_ord and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; 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 6ddd10e43f..07ce453e86 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 @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a {{prefix}}.query_text_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a {{prefix}}.query_text_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a {{prefix}}.query_text_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a {{prefix}}.query_text_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a {{prefix}}.query_text_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -108,7 +108,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ope. --! @param a {{prefix}}.query_text_ord_ope @@ -116,4 +116,472 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_eq and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_eq and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ope: {{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ope left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord_ope, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord_ope and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; 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 2e15e64d4d..dea2af0618 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 @@ -77,3 +77,263 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord_ope, RIGHTARG = public.{{prefix}}_text_search +); 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 8313a604a0..d51a8d91a1 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 @@ -77,3 +77,263 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord, RIGHTARG = public.{{prefix}}_text_search +); 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 4295a73682..b6d89c5324 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 @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a {{prefix}}.query_text_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a {{prefix}}.query_text_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a {{prefix}}.query_text_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a {{prefix}}.query_text_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a {{prefix}}.query_text_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -108,7 +108,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_ord_ore. --! @param a {{prefix}}.query_text_ord_ore @@ -116,4 +116,472 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_eq and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_eq and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_ord_ore: {{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_ord_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_ord_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_ord_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; 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 52d75e747f..5241503fe1 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 @@ -77,3 +77,263 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_ord_ore, RIGHTARG = public.{{prefix}}_text_search +); 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 index bf59c58225..c671d64e9a 100644 --- a/packages/eql/src/v3/scalars/text/query_text_range_functions.sql +++ b/packages/eql/src/v3/scalars/text/query_text_range_functions.sql @@ -116,7 +116,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_text_search_ore value lies in a range, both bounds included. --! @@ -151,7 +151,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_text_ord value lies in a range, both bounds included. --! @@ -181,7 +181,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_text_ord_ope value lies in a range, both bounds included. --! @@ -211,7 +211,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_text_search value lies in a range, both bounds included. --! @@ -241,4 +241,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 4b63185a4a..89a443debb 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 @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}_internal.bloom_filter({{prefix}}_internal.require_query_ --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a {{prefix}}.query_text_search @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a public.{{prefix}}_text_search @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a {{prefix}}.query_text_search @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a public.{{prefix}}_text_search @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a {{prefix}}.query_text_search @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a public.{{prefix}}_text_search @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a {{prefix}}.query_text_search @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a public.{{prefix}}_text_search @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a {{prefix}}.query_text_search @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a public.{{prefix}}_text_search @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a {{prefix}}.query_text_search @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a public.{{prefix}}_text_search @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search. --! @param a {{prefix}}.query_text_search @@ -165,4 +165,508 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinali --! @return boolean CREATE FUNCTION {{prefix}}.matches(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_eq and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_eq and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_match and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_match left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_match, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', 'public.{{prefix}}_text_match and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_match (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_match right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a {{prefix}}.query_text_search, b public.{{prefix}}_text_match) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', '{{prefix}}.query_text_search and public.{{prefix}}_text_match'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_search and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_search and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_search and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_search and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_search and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search (mismatched query domain). +--! @param a public.{{prefix}}_text_search_ore left operand +--! @param b {{prefix}}.query_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_search_ore, b {{prefix}}.query_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', 'public.{{prefix}}_text_search_ore and {{prefix}}.query_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search: {{prefix}}.query_text_search and public.{{prefix}}_text_search_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search left operand +--! @param b public.{{prefix}}_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a {{prefix}}.query_text_search, b public.{{prefix}}_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', '{{prefix}}.query_text_search and public.{{prefix}}_text_search_ore'; END; $$ +LANGUAGE plpgsql; 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 546618c7e5..7fccc6bfca 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 @@ -89,3 +89,283 @@ CREATE OPERATOR @@ ( LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search, RESTRICT = contsel, JOIN = contjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_match +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search_ore +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_search_ore, RIGHTARG = {{prefix}}.query_text_search +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = {{prefix}}.query_text_search, RIGHTARG = public.{{prefix}}_text_search_ore +); 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 2815a05b3d..64e64046e2 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 @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}_internal.bloom_filter({{prefix}}_internal.require_query_ --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a {{prefix}}.query_text_search_ore @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a {{prefix}}.query_text_search_ore @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a {{prefix}}.query_text_search_ore @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a {{prefix}}.query_text_search_ore @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a {{prefix}}.query_text_search_ore @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a {{prefix}}.query_text_search_ore @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for {{prefix}}.query_text_search_ore. --! @param a {{prefix}}.query_text_search_ore @@ -165,4 +165,508 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinali --! @return boolean 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 {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_eq and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_eq and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_eq left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_eq, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_eq and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_eq (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_match and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_match left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_match, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', 'public.{{prefix}}_text_match and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_match (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_match right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_match) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_match'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ore left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord_ore, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord_ore and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_ord_ope left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_ord_ope, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_ord_ope and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore (mismatched query domain). +--! @param a public.{{prefix}}_text_search left operand +--! @param b {{prefix}}.query_text_search_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a public.{{prefix}}_text_search, b {{prefix}}.query_text_search_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', 'public.{{prefix}}_text_search and {{prefix}}.query_text_search_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_text_search_ore: {{prefix}}.query_text_search_ore and public.{{prefix}}_text_search (mismatched query domain). +--! @param a {{prefix}}.query_text_search_ore left operand +--! @param b public.{{prefix}}_text_search right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal."@@"(a {{prefix}}.query_text_search_ore, b public.{{prefix}}_text_search) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '@@', '{{prefix}}.query_text_search_ore and public.{{prefix}}_text_search'; END; $$ +LANGUAGE plpgsql; 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 1d148ee5f9..283837ae47 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 @@ -89,3 +89,283 @@ CREATE OPERATOR @@ ( LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search_ore, RESTRICT = contsel, JOIN = contjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_eq, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_eq +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_match, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_match +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord_ore, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_ord_ope, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = public.{{prefix}}_text_search, RIGHTARG = {{prefix}}.query_text_search_ore +); + +CREATE OPERATOR @@ ( + FUNCTION = {{prefix}}_internal."@@", + LEFTARG = {{prefix}}.query_text_search_ore, RIGHTARG = public.{{prefix}}_text_search +); 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 bbdc0441fe..ead1bb0bb0 100644 --- a/packages/eql/src/v3/scalars/text/text_eq_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_eq. --! @param a public.{{prefix}}_text_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_text_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_text_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_tex --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_eq. --! @param a public.{{prefix}}_text_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_eq) = {{prefix}}.eq_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_eq, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_eq. --! @param a public.{{prefix}}_text_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_text_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_text_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_eq. --! 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 a897526118..096ab4484e 100644 --- a/packages/eql/src/v3/scalars/text/text_match_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_match_functions.sql @@ -497,7 +497,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_match, b public.{{prefix}}_text_match) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for public.{{prefix}}_text_match. --! @param a public.{{prefix}}_text_match @@ -505,7 +505,7 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinali --! @return boolean CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_match, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -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) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b::public.{{prefix}}_text_match) AND (pg_catalog.cardinality({{prefix}}.match_term(b::public.{{prefix}}_text_match)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for public.{{prefix}}_text_match. --! @param a jsonb @@ -513,7 +513,7 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b::public.{{prefi --! @return boolean CREATE FUNCTION {{prefix}}.matches(a jsonb, b public.{{prefix}}_text_match) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -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) $$; +AS $$ SELECT {{prefix}}.match_term(a::public.{{prefix}}_text_match) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a::public.{{prefix}}_text_match)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_match. --! 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 afd8d5e8c9..434c7b1999 100644 --- a/packages/eql/src/v3/scalars/text/text_ord_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_ord_functions.sql @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_ord) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_text_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_tex --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord) = {{prefix}}.eq_t --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_ord) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_text_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord) <> {{prefix}}.eq_ --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) < {{prefix}}.ord --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) <= {{prefix}}.or --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) > {{prefix}}.ord --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a public.{{prefix}}_text_ord @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_text_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord. --! @param a jsonb @@ -166,7 +166,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_ord. --! 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 6a35660365..88e297e9fc 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 @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_tex --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ope) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ope) = {{prefix}}. --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ope) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ope) <> {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) < {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) <= {{prefix} --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) > {{prefix}} --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a public.{{prefix}}_text_ord_ope @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_text_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ope. --! @param a jsonb @@ -166,7 +166,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ope. --! 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 74f3e200b6..b377fb7718 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 @@ -31,7 +31,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -39,7 +39,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb @@ -47,7 +47,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_tex --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ore) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ore) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -55,7 +55,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ore) = {{prefix}}. --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -63,7 +63,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_text_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb @@ -71,7 +71,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ore) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ore) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -79,7 +79,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_ord_ore) <> {{prefix}} --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -87,7 +87,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb @@ -95,7 +95,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -103,7 +103,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) < {{pref --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -111,7 +111,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb @@ -119,7 +119,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -127,7 +127,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) <= {{pre --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -135,7 +135,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb @@ -143,7 +143,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -151,7 +151,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) > {{pref --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a public.{{prefix}}_text_ord_ore @@ -159,7 +159,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_ord_ore. --! @param a jsonb @@ -167,7 +167,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_ord_ore. --! 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 22dfe90434..907fc981a2 100644 --- a/packages/eql/src/v3/scalars/text/text_search_functions.sql +++ b/packages/eql/src/v3/scalars/text/text_search_functions.sql @@ -39,7 +39,7 @@ AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -47,7 +47,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_search) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_text_search) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb @@ -55,7 +55,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_tex --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -63,7 +63,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search) = {{prefix}}.e --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -71,7 +71,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_search) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_text_search) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb @@ -79,7 +79,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -87,7 +87,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search) <> {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -95,7 +95,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb @@ -103,7 +103,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -111,7 +111,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) < {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -119,7 +119,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb @@ -127,7 +127,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -135,7 +135,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) <= {{prefix}} --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -143,7 +143,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb @@ -151,7 +151,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -159,7 +159,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) > {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -167,7 +167,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_text_search) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb @@ -175,7 +175,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_text_search) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! @@ -407,7 +407,7 @@ LANGUAGE plpgsql; --! @return boolean CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a public.{{prefix}}_text_search @@ -415,7 +415,7 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinali --! @return boolean CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -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) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b::public.{{prefix}}_text_search) AND (pg_catalog.cardinality({{prefix}}.match_term(b::public.{{prefix}}_text_search)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search. --! @param a jsonb @@ -423,7 +423,7 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b::public.{{prefi --! @return boolean CREATE FUNCTION {{prefix}}.matches(a jsonb, b public.{{prefix}}_text_search) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -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) $$; +AS $$ SELECT {{prefix}}.match_term(a::public.{{prefix}}_text_search) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a::public.{{prefix}}_text_search)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_search. --! 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 c15e310638..35b0fde4ae 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 @@ -40,7 +40,7 @@ AS $$ SELECT {{prefix}}_internal.bloom_filter(a::jsonb) $$; --! @return boolean 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 {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -48,7 +48,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_text_search_ore) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_text_search_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb @@ -56,7 +56,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_tex --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search_ore) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search_ore) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -64,7 +64,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search_ore) = {{prefix --! @return boolean 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 {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -72,7 +72,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_text_search_ore) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_text_search_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb @@ -80,7 +80,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_te --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search_ore) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search_ore) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -88,7 +88,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_text_search_ore) <> {{prefi --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -96,7 +96,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb @@ -104,7 +104,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -112,7 +112,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) < {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -120,7 +120,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb @@ -128,7 +128,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -136,7 +136,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) <= {{ --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb @@ -152,7 +152,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -160,7 +160,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) > {{p --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -168,7 +168,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_text_search_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb @@ -176,7 +176,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_text_search_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! @@ -408,7 +408,7 @@ LANGUAGE plpgsql; --! @return boolean 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 {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinality({{prefix}}.match_term(b)) > 0 OR cardinality({{prefix}}.match_term(a)) = 0) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a public.{{prefix}}_text_search_ore @@ -416,7 +416,7 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b) AND (cardinali --! @return boolean CREATE FUNCTION {{prefix}}.matches(a public.{{prefix}}_text_search_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -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) $$; +AS $$ SELECT {{prefix}}.match_term(a) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b::public.{{prefix}}_text_search_ore) AND (pg_catalog.cardinality({{prefix}}.match_term(b::public.{{prefix}}_text_search_ore)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Operator wrapper for public.{{prefix}}_text_search_ore. --! @param a jsonb @@ -424,7 +424,7 @@ AS $$ SELECT {{prefix}}.match_term(a) @> {{prefix}}.match_term(b::public.{{prefi --! @return boolean CREATE FUNCTION {{prefix}}.matches(a jsonb, b public.{{prefix}}_text_search_ore) RETURNS boolean LANGUAGE sql IMMUTABLE PARALLEL SAFE -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) $$; +AS $$ SELECT {{prefix}}.match_term(a::public.{{prefix}}_text_search_ore) OPERATOR(pg_catalog.@>) {{prefix}}.match_term(b) AND (pg_catalog.cardinality({{prefix}}.match_term(b)) OPERATOR(pg_catalog.>) 0 OR pg_catalog.cardinality({{prefix}}.match_term(a::public.{{prefix}}_text_search_ore)) OPERATOR(pg_catalog.=) 0) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_text_search_ore. --! 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 9adbce317a..3ebcad4f8f 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_eq. --! @param a {{prefix}}.query_timestamp_eq @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_eq. --! @param a public.{{prefix}}_timestamp_eq @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_eq. --! @param a {{prefix}}.query_timestamp_eq @@ -44,4 +44,112 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_eq (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: {{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_eq left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_eq (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: {{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_eq left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_eq (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: {{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_eq left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_eq (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: {{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_eq left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_eq (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: {{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_eq left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_eq (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_eq: {{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_eq left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_eq, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_eq and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 da1d3981f2..32b96a1562 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 @@ -29,3 +29,63 @@ CREATE OPERATOR <> ( LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_eq, COMMUTATOR = <>, NEGATOR = =, RESTRICT = neqsel, JOIN = neqjoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_eq, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); 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 fb15aea1cb..fa5d1c58a7 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a {{prefix}}.query_timestamp_ord @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a {{prefix}}.query_timestamp_ord @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a {{prefix}}.query_timestamp_ord @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a {{prefix}}.query_timestamp_ord @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a {{prefix}}.query_timestamp_ord @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord. --! @param a {{prefix}}.query_timestamp_ord @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_eq left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_eq (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_eq left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_eq (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord: {{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_timestamp_ord, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_timestamp_ord and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 a6073f7002..172c8b6b21 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a {{prefix}}.query_timestamp_ord_ope @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a {{prefix}}.query_timestamp_ord_ope @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a {{prefix}}.query_timestamp_ord_ope @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a {{prefix}}.query_timestamp_ord_ope @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a {{prefix}}.query_timestamp_ord_ope @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ope. --! @param a {{prefix}}.query_timestamp_ord_ope @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_eq left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_eq (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_eq left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_eq (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ore left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp_ord_ore, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_timestamp_ord_ore and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ope: {{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ope left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_timestamp_ord_ope, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_timestamp_ord_ope and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; 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 5bd5cdd907..13b36a1dd5 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ope, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_timestamp_ord_ope, RIGHTARG = public.{{prefix}}_timestamp_ord +); 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 303def9299..24b16a4791 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ore, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_timestamp_ord, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); 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 5b583178cf..4223e7e2fb 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 @@ -20,7 +20,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a {{prefix}}.query_timestamp_ord_ore @@ -28,7 +28,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -36,7 +36,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a {{prefix}}.query_timestamp_ord_ore @@ -44,7 +44,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -52,7 +52,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a {{prefix}}.query_timestamp_ord_ore @@ -60,7 +60,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -68,7 +68,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a {{prefix}}.query_timestamp_ord_ore @@ -76,7 +76,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -84,7 +84,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a {{prefix}}.query_timestamp_ord_ore @@ -92,7 +92,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -100,7 +100,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for {{prefix}}.query_timestamp_ord_ore. --! @param a {{prefix}}.query_timestamp_ord_ore @@ -108,4 +108,256 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_eq left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_eq (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_eq left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_eq, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_eq and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_eq (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_eq right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_eq) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_eq'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp_ord, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_timestamp_ord and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.eq(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '=', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.neq(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<>', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lt(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.lte(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '<=', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gt(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore (mismatched query domain). +--! @param a public.{{prefix}}_timestamp_ord_ope left operand +--! @param b {{prefix}}.query_timestamp_ord_ore right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a public.{{prefix}}_timestamp_ord_ope, b {{prefix}}.query_timestamp_ord_ore) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', 'public.{{prefix}}_timestamp_ord_ope and {{prefix}}.query_timestamp_ord_ore'; END; $$ +LANGUAGE plpgsql; + +--! @brief Unsupported operator blocker for {{prefix}}.query_timestamp_ord_ore: {{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope (mismatched query domain). +--! @param a {{prefix}}.query_timestamp_ord_ore left operand +--! @param b public.{{prefix}}_timestamp_ord_ope right operand +--! @return boolean never returned — the function always raises +CREATE FUNCTION {{prefix}}_internal.gte(a {{prefix}}.query_timestamp_ord_ore, b public.{{prefix}}_timestamp_ord_ope) +RETURNS boolean IMMUTABLE PARALLEL SAFE +AS $$ BEGIN RAISE EXCEPTION 'operator % is not supported for %: use the query domain that matches the column', '>=', '{{prefix}}.query_timestamp_ord_ore and public.{{prefix}}_timestamp_ord_ope'; END; $$ +LANGUAGE plpgsql; 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 13b0cecd90..2229dd9b91 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 @@ -77,3 +77,143 @@ CREATE OPERATOR >= ( LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ore, COMMUTATOR = <=, NEGATOR = <, RESTRICT = scalargesel, JOIN = scalargejoinsel ); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_eq +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_eq, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_eq +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp_ord, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR = ( + FUNCTION = {{prefix}}_internal.eq, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR <> ( + FUNCTION = {{prefix}}_internal.neq, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR < ( + FUNCTION = {{prefix}}_internal.lt, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR <= ( + FUNCTION = {{prefix}}_internal.lte, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR > ( + FUNCTION = {{prefix}}_internal.gt, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = public.{{prefix}}_timestamp_ord_ope, RIGHTARG = {{prefix}}.query_timestamp_ord_ore +); + +CREATE OPERATOR >= ( + FUNCTION = {{prefix}}_internal.gte, + LEFTARG = {{prefix}}.query_timestamp_ord_ore, RIGHTARG = public.{{prefix}}_timestamp_ord_ope +); 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 index c554f792d5..576f37fe3c 100644 --- a/packages/eql/src/v3/scalars/timestamp/query_timestamp_range_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/query_timestamp_range_functions.sql @@ -114,7 +114,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(jsonb_build_object('op', r::jsonb -> ' 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) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_timestamp_ord value lies in a range, both bounds included. --! @@ -144,7 +144,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}_internal.lo(r) AND {{prefi 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; --! @brief Whether a public.{{prefix}}_timestamp_ord_ope value lies in a range, both bounds included. --! @@ -174,4 +174,4 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}_internal.lo(r) AND {{prefix}}. 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) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}_internal.lo(r) AND {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}_internal.hi(r) $$; 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 9ffb046cde..ae2800bba5 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_eq_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_eq_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.hmac_256(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. --! @param a public.{{prefix}}_timestamp_eq @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_timestamp_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b::public.{{prefix}}_timestamp_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) = {{prefix}}.eq_term(b::public.{{prefix}}_tim --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_timestamp_eq) = {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_timestamp_eq) OPERATOR(pg_catalog.=) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. --! @param a public.{{prefix}}_timestamp_eq @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_timestamp_eq) = {{prefix}}. --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_eq, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. --! @param a public.{{prefix}}_timestamp_eq @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_eq, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_timestamp_eq) $$; +AS $$ SELECT {{prefix}}.eq_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b::public.{{prefix}}_timestamp_eq) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_eq. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.eq_term(a) <> {{prefix}}.eq_term(b::public.{{prefix}}_ti --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_timestamp_eq) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_timestamp_eq) <> {{prefix}}.eq_term(b) $$; +AS $$ SELECT {{prefix}}.eq_term(a::public.{{prefix}}_timestamp_eq) OPERATOR(pg_catalog.<>) {{prefix}}.eq_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_eq. --! 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 d912cf0b96..c1fc531fd2 100644 --- a/packages/eql/src/v3/scalars/timestamp/timestamp_ord_functions.sql +++ b/packages/eql/src/v3/scalars/timestamp/timestamp_ord_functions.sql @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) = {{prefix} --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) <> {{prefix --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) < {{prefix} --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) <= {{prefix --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) > {{prefix} --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a public.{{prefix}}_timestamp_ord @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_timestamp_ord) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord. --! 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 d625524822..4914c85856 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 @@ -21,7 +21,7 @@ AS $$ SELECT {{prefix}}_internal.ope_cllw(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -29,7 +29,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb @@ -37,7 +37,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) = {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) = {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) OPERATOR(pg_catalog.=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -45,7 +45,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) = {{pre --! @return boolean 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 {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -53,7 +53,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb @@ -61,7 +61,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <> {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) <> {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) OPERATOR(pg_catalog.<>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -69,7 +69,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) <> {{pr --! @return boolean 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 {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -77,7 +77,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb @@ -85,7 +85,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) < {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) < {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) OPERATOR(pg_catalog.<) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -93,7 +93,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) < {{pre --! @return boolean 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 {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -101,7 +101,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb @@ -109,7 +109,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) <= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) <= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) OPERATOR(pg_catalog.<=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -117,7 +117,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) <= {{pr --! @return boolean 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 {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -125,7 +125,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb @@ -133,7 +133,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) > {{prefix}}.ord_term(b::public.{{prefix}}_t --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) > {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) OPERATOR(pg_catalog.>) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -141,7 +141,7 @@ AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) > {{pre --! @return boolean 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 {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a public.{{prefix}}_timestamp_ord_ope @@ -149,7 +149,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord_ope, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; +AS $$ SELECT {{prefix}}.ord_term(a) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b::public.{{prefix}}_timestamp_ord_ope) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ope. --! @param a jsonb @@ -157,7 +157,7 @@ AS $$ SELECT {{prefix}}.ord_term(a) >= {{prefix}}.ord_term(b::public.{{prefix}}_ --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_timestamp_ord_ope) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) >= {{prefix}}.ord_term(b) $$; +AS $$ SELECT {{prefix}}.ord_term(a::public.{{prefix}}_timestamp_ord_ope) OPERATOR(pg_catalog.>=) {{prefix}}.ord_term(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ope. --! 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 1727ad6da0..b0ada2e094 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 @@ -22,7 +22,7 @@ AS $$ SELECT {{prefix}}_internal.{{ore_block}}(a::jsonb) $$; --! @return boolean 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 {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -30,7 +30,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.eq(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb @@ -38,7 +38,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) = {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.eq(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) = {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) OPERATOR(public.=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -46,7 +46,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) = { --! @return boolean 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 {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -54,7 +54,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.neq(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb @@ -62,7 +62,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <> {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.neq(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) <> {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) OPERATOR(public.<>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -70,7 +70,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) <> --! @return boolean 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 {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -78,7 +78,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lt(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<) {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb @@ -86,7 +86,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) < {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.lt(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) < {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) OPERATOR(public.<) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -94,7 +94,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) < { --! @return boolean 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 {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -102,7 +102,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.lte(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb @@ -110,7 +110,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) <= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.lte(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) <= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) OPERATOR(public.<=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -118,7 +118,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) <= --! @return boolean 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 {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -126,7 +126,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gt(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>) {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb @@ -134,7 +134,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) > {{prefix}}.ord_term_ore(b::public.{{pr --! @return boolean CREATE FUNCTION {{prefix}}.gt(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) > {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) OPERATOR(public.>) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -142,7 +142,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) > { --! @return boolean 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 {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a public.{{prefix}}_timestamp_ord_ore @@ -150,7 +150,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b) $$; --! @return boolean CREATE FUNCTION {{prefix}}.gte(a public.{{prefix}}_timestamp_ord_ore, b jsonb) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b::public.{{prefix}}_timestamp_ord_ore) $$; --! @brief Operator wrapper for public.{{prefix}}_timestamp_ord_ore. --! @param a jsonb @@ -158,7 +158,7 @@ AS $$ SELECT {{prefix}}.ord_term_ore(a) >= {{prefix}}.ord_term_ore(b::public.{{p --! @return boolean CREATE FUNCTION {{prefix}}.gte(a jsonb, b public.{{prefix}}_timestamp_ord_ore) RETURNS boolean LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE -AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) >= {{prefix}}.ord_term_ore(b) $$; +AS $$ SELECT {{prefix}}.ord_term_ore(a::public.{{prefix}}_timestamp_ord_ore) OPERATOR(public.>=) {{prefix}}.ord_term_ore(b) $$; --! @brief Unsupported operator blocker for public.{{prefix}}_timestamp_ord_ore. --! diff --git a/packages/eql/tasks/test/splinter.sh b/packages/eql/tasks/test/splinter.sh index 058689892f..bb1ecb3873 100755 --- a/packages/eql/tasks/test/splinter.sh +++ b/packages/eql/tasks/test/splinter.sh @@ -101,7 +101,7 @@ function_search_path_mutable eql_v3 @> function Containment (@>) operator wrappe function_search_path_mutable eql_v3 <@ function Contained-by (<@) operator wrapper on the eql_v3 encrypted-JSONB surface: same rationale as eql_v3.@>. Three overloads. function_search_path_mutable eql_v3 selector function STE-vec entry selector extractor: typed (public.eql_v3_jsonb_entry) overload, inlinable so `eql_v3.selector(col -> 'sel')` folds into the calling query. Structural domain-arg skip. The (jsonb) overload is plpgsql with a pinned search_path and does not surface. function_search_path_mutable eql_v3 ope_term function STE-vec ordered-term extractor for public.eql_v3_jsonb_entry: inlinable so `eql_v3.ope_term(col -> 'sel')` folds into the calling range query and matches the functional btree index built on the same expression. SET search_path would disable SQL function inlining. The deprecated eq_term(json_entry) compatibility alias is pinned and does not surface. -function_search_path_mutable eql_v3 to_ste_vec_query function Encrypted-JSONB query-document constructor (CAST WITH FUNCTION for eql_v3.query_jsonb): inlinable SQL over a public.eql_v3_json domain arg, structural domain-arg skip. Builds the ste_vec query value the @>/<@ wrappers compare against; must inline to fold into the calling query. +function_search_path_mutable eql_v3 to_ste_vec_query function Encrypted-JSONB containment-needle constructor, called explicitly (there is no CAST to eql_v3.query_json; PostgreSQL ignores casts from a domain): inlinable SQL over a public.eql_v3_json_search / eql_v3.query_json arg, structural domain-arg skip. Builds the ste_vec query value the @>/<@ wrappers compare against; must inline to fold into the calling query and to match the functional GIN index on eql_v3.to_ste_vec_query(col)::jsonb. function_search_path_mutable eql_v3 jsonb_document_contains function Typed encrypted-JSONB document containment engine backing the public.eql_v3_json_search @>/<@ operators: the inlinable SQL (public.eql_v3_json_search) overload folds to native jsonb containment over eql_v3.to_ste_vec_query(a/b)::jsonb, so the planner can match the functional GIN index on eql_v3.to_ste_vec_query(col)::jsonb. Structural domain-arg skip leaves this overload unpinned; the raw jsonb[] plpgsql overload has a fixed search_path and does not surface. function_search_path_mutable eql_v3 ste_vec_contains function Deprecated compatibility alias for the typed eql_v3.jsonb_document_contains overload. It must remain inlinable so existing function-form queries retain the same functional-GIN-index matching as before the rename. The public.eql_v3_json_search domain arguments leave this overload intentionally unpinned; the raw jsonb[] alias is pinned by tasks/pin_search_path_v3.sql and does not surface. function_search_path_mutable eql_v3 jsonb_array function ste_vec deterministic-field array extractor on the eql_v3 encrypted-JSONB surface: public inlinable SQL (raw jsonb arg) behind the documented functional GIN index expression eql_v3.jsonb_array(col). Takes bare jsonb, so it carries the documented `eql-inline-critical` COMMENT marker that pin_search_path_v3.sql honours rather than the structural skip. diff --git a/packages/eql/tests/docker-compose.yml b/packages/eql/tests/docker-compose.yml index 239328becf..7089551a29 100644 --- a/packages/eql/tests/docker-compose.yml +++ b/packages/eql/tests/docker-compose.yml @@ -5,16 +5,16 @@ services: # max_locks_per_transaction is NOT a per-transaction cap — it sizes the # CLUSTER-WIDE shared lock table as max_locks_per_transaction * # max_connections. The shipped uninstaller drops both eql_v3 schemas with - # DROP ... CASCADE, which takes a lock on every one of the ~5,700 objects it + # DROP ... CASCADE, which takes a lock on every one of the ~8,550 objects it # removes and holds them all until commit (sqlx sends the script as a single # implicit transaction). At the stock 64 * 100 = 6,400 slots, ONE uninstall - # already consumes ~89% of the table, so two concurrent ones exhaust it and + # already exceeds the whole table, so two concurrent ones exhaust it and # every backend — including unrelated tests merely installing EQL — fails # with `53200 out of shared memory`. nextest runs one test per core (16 in - # CI), so size for the worst case: 16 * 5,700 ~= 91k slots. 1024 * 100 = - # 102,400 covers it, and costs ~42MB of shared memory (well inside the 2GB + # CI), so size for the worst case: 16 * 8,600 ~= 138k slots. 1536 * 100 = + # 153,600 covers it, and costs ~63MB of shared memory (well inside the 2GB # limit below). Keep tests/sqlx/tests/lock_capacity_tests.rs in sync. - command: postgres -c track_functions=all -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c max_locks_per_transaction=1024 + command: postgres -c track_functions=all -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c max_locks_per_transaction=1536 ports: - 7432:7432 environment: diff --git a/packages/eql/tests/sqlx/snapshots/eql_v3_public_surface.txt b/packages/eql/tests/sqlx/snapshots/eql_v3_public_surface.txt index 85c9bfaf6d..f7e7ac8ec1 100644 --- a/packages/eql/tests/sqlx/snapshots/eql_v3_public_surface.txt +++ b/packages/eql/tests/sqlx/snapshots/eql_v3_public_surface.txt @@ -59,7 +59,6 @@ aggregate eql_v3.min(public.eql_v3_text_search_ore) aggregate eql_v3.min(public.eql_v3_timestamp_ord) aggregate eql_v3.min(public.eql_v3_timestamp_ord_ope) aggregate eql_v3.min(public.eql_v3_timestamp_ord_ore) -cast public.eql_v3_json_search -> eql_v3.query_json function eql_v3.->(e public.eql_v3_json_search, selector integer) function eql_v3.->(e public.eql_v3_json_search, selector text) function eql_v3.->>(e public.eql_v3_json_search, selector integer) diff --git a/packages/eql/tests/sqlx/snapshots/v3_jsonb_tests.txt b/packages/eql/tests/sqlx/snapshots/v3_jsonb_tests.txt index 729859b65b..9ade5b5452 100644 --- a/packages/eql/tests/sqlx/snapshots/v3_jsonb_tests.txt +++ b/packages/eql/tests/sqlx/snapshots/v3_jsonb_tests.txt @@ -20,6 +20,7 @@ v3_jsonb_doc_contains_doc_rhs_supported_null v3_jsonb_doc_contains_query_lhs_supported_null v3_jsonb_doc_contains_query_rhs_supported_null v3_jsonb_document_containment_uses_the_query_gin_index +v3_jsonb_empty_array_accessors v3_jsonb_entry_entry_shape_resolves v3_jsonb_entry_equality_blockers_are_non_strict_plpgsql v3_jsonb_entry_equality_is_blocked @@ -56,6 +57,7 @@ v3_jsonb_question_amp_blocker v3_jsonb_question_blocker v3_jsonb_question_pipe_blocker v3_jsonb_raw_helpers_contains_and_contained_by +v3_jsonb_root_array_flag_must_be_boolean v3_jsonb_root_doc_doc_comparison_blockers v3_jsonb_root_eq_blocker v3_jsonb_root_gt_blocker diff --git a/packages/eql/tests/sqlx/src/matrix.rs b/packages/eql/tests/sqlx/src/matrix.rs index 299dc38b98..6d0147a46b 100644 --- a/packages/eql/tests/sqlx/src/matrix.rs +++ b/packages/eql/tests/sqlx/src/matrix.rs @@ -1514,6 +1514,13 @@ macro_rules! __scalar_matrix_planner_metadata_case { JOIN pg_catalog.pg_type rt ON rt.oid = o.oprright WHERE o.oprname IN ({op_list}) AND ('{d}'::regtype = o.oprleft OR '{d}'::regtype = o.oprright) + -- Cross-pair blockers (this domain against ANOTHER domain's + -- query twin) are deliberately metadata-free: they only + -- exist to raise, so keep them out of this accounting. + AND NOT (rt.typname LIKE 'query\_%' AND lt.oid = '{d}'::regtype + AND rt.typname <> 'query_' || substr(lt.typname, 8)) + AND NOT (lt.typname LIKE 'query\_%' AND rt.oid = '{d}'::regtype + AND lt.typname <> 'query_' || substr(rt.typname, 8)) "# ); let rows: Vec<(String, String, String, bool, bool, bool, bool)> = diff --git a/packages/eql/tests/sqlx/tests/lock_capacity_tests.rs b/packages/eql/tests/sqlx/tests/lock_capacity_tests.rs index 080d248f7d..9169fd383f 100644 --- a/packages/eql/tests/sqlx/tests/lock_capacity_tests.rs +++ b/packages/eql/tests/sqlx/tests/lock_capacity_tests.rs @@ -2,12 +2,12 @@ //! suite's concurrent `DROP ... CASCADE` load. //! //! Why this exists: the shipped uninstaller drops both `eql_v3` schemas with -//! `DROP ... CASCADE`. That takes a lock on every one of the ~5,700 objects it +//! `DROP ... CASCADE`. That takes a lock on every one of the ~8,550 objects it //! removes and holds them until the transaction commits — `sqlx::raw_sql` sends //! the whole script as ONE implicit transaction. `max_locks_per_transaction` is //! not a per-transaction cap; it sizes the *cluster-wide* shared lock table as //! `max_locks_per_transaction * max_connections`. At the stock 64 * 100 = 6,400 -//! slots a single uninstall already holds ~89% of the table, so two overlapping +//! slots a single uninstall already exceeds the whole table, so two overlapping //! ones exhaust it — and the backends that then fail with `53200 out of shared //! memory` are mostly INNOCENT tests that were merely installing EQL. //! @@ -18,24 +18,24 @@ //! cause and the fix. //! //! `tests/docker-compose.yml` provisions the capacity (`-c -//! max_locks_per_transaction=1024`); this asserts the database under test +//! max_locks_per_transaction=1536`); this asserts the database under test //! actually has it. use anyhow::Result; use eql_tests::property::connect_pool; /// Locks held by one full run of the shipped uninstaller, measured against the -/// v3 surface (`DROP ... CASCADE` over ~5,682 objects, plus catalog locks). +/// v3 surface (`DROP ... CASCADE` over ~8,550 objects, plus catalog locks). /// This grows as the catalog grows — it is a measured floor, not a constant of /// nature. -const LOCKS_PER_UNINSTALL: i64 = 5_700; +const LOCKS_PER_UNINSTALL: i64 = 8_600; /// Worst-case simultaneous uninstalls: nextest runs one test per core, and CI /// runners have 16. Every one of those slots could be an uninstall-heavy test. const WORST_CASE_CONCURRENT_UNINSTALLS: i64 = 16; -/// The capacity the suite needs: ~91k slots. The compose setting (1024 * 100 = -/// 102,400) clears this; the stock default (6,400) misses it by ~14x. +/// The capacity the suite needs: ~138k slots. The compose setting (1536 * 100 = +/// 153,600) clears this; the stock default (6,400) misses it by ~24x. const MIN_LOCK_TABLE_CAPACITY: i64 = LOCKS_PER_UNINSTALL * WORST_CASE_CONCURRENT_UNINSTALLS; /// Read an integer GUC. Both settings are plain integers with no unit, so @@ -72,7 +72,7 @@ async fn lock_table_fits_concurrent_uninstalls() -> Result<()> { `53200 out of shared memory` in whichever unrelated tests happen to run \ alongside an uninstall.\n\ \n\ - Fix: tests/docker-compose.yml sets `-c max_locks_per_transaction=1024`. \ + Fix: tests/docker-compose.yml sets `-c max_locks_per_transaction=1536`. \ A container created before that change keeps the old setting, so recreate it:\n\ \n mise run postgres:down && mise run postgres:up postgres-17\n" ); diff --git a/packages/eql/tests/sqlx/tests/v3_jsonb_tests.rs b/packages/eql/tests/sqlx/tests/v3_jsonb_tests.rs index fc1e20a25f..56cef004f6 100644 --- a/packages/eql/tests/sqlx/tests/v3_jsonb_tests.rs +++ b/packages/eql/tests/sqlx/tests/v3_jsonb_tests.rs @@ -1395,6 +1395,69 @@ async fn v3_jsonb_path_exists_and_first(pool: PgPool) -> anyhow::Result<()> { Ok(()) } +#[sqlx::test] +async fn v3_jsonb_root_array_flag_must_be_boolean(pool: PgPool) -> anyhow::Result<()> { + // The root validator type-checks `a` like the entry validator: a boolean + // (true or false) is accepted, anything else is rejected at the domain. + for (a, ok) in [ + ("true", true), + ("false", true), + ("null", false), + ("\"true\"", false), + ("1", false), + ] { + let doc = format!(r#"{{"v":3,"k":"sv","i":{{"t":"t","c":"c"}},"h":"kh","a":{a},"sv":[]}}"#); + let accepted: bool = sqlx::query_scalar(&format!( + "SELECT public.eql_v3_is_valid_ste_vec_document_payload('{doc}'::jsonb)" + )) + .fetch_one(&pool) + .await?; + assert_eq!(accepted, ok, "root a = {a}"); + } + + // The raw-jsonb accessor reports "not an array" for a non-boolean `a` + // instead of raising a cast error. + let err = sqlx::query_scalar::<_, Option>( + r#"SELECT eql_v3.jsonb_array_length('{"v":3,"a":"maybe","sv":[]}'::jsonb)"#, + ) + .fetch_one(&pool) + .await + .unwrap_err() + .to_string(); + assert!(err.contains("non-array"), "got: {err}"); + Ok(()) +} + +#[sqlx::test] +async fn v3_jsonb_empty_array_accessors(pool: PgPool) -> anyhow::Result<()> { + // An empty encrypted array (`a: true, sv: []`) has length 0 and yields no + // elements. `array_agg` over zero rows is NULL, which used to make + // `jsonb_array_length` return NULL and `jsonb_array_elements` raise + // "upper bound of FOR loop cannot be null". + let d = r#"{"v":3,"k":"sv","i":{"t":"t","c":"c"},"h":"kh","a":true,"sv":[]}"#; + let len: Option = sqlx::query_scalar(&format!( + "SELECT eql_v3.jsonb_array_length('{d}'::public.eql_v3_json_search::jsonb)" + )) + .fetch_one(&pool) + .await?; + assert_eq!(len, Some(0), "an empty array has length 0, not NULL"); + + let n: i64 = sqlx::query_scalar(&format!( + "SELECT count(*) FROM eql_v3.jsonb_array_elements('{d}'::public.eql_v3_json_search::jsonb)" + )) + .fetch_one(&pool) + .await?; + assert_eq!(n, 0, "an empty array yields no elements"); + + let contained: bool = sqlx::query_scalar( + "SELECT eql_v3.jsonb_document_contains('{}'::jsonb[], '{\"s\":\"aa\",\"c\":\"x\"}'::jsonb)", + ) + .fetch_one(&pool) + .await?; + assert!(!contained, "nothing is contained in an empty sv array"); + Ok(()) +} + #[sqlx::test] async fn v3_jsonb_array_length_and_elements(pool: PgPool) -> anyhow::Result<()> { let d = array_doc(); diff --git a/packages/eql/tests/sqlx/tests/v3_query_domain_cross_pair_tests.rs b/packages/eql/tests/sqlx/tests/v3_query_domain_cross_pair_tests.rs new file mode 100644 index 0000000000..0c07bbfc49 --- /dev/null +++ b/packages/eql/tests/sqlx/tests/v3_query_domain_cross_pair_tests.rs @@ -0,0 +1,177 @@ +//! A storage domain compared with ANOTHER domain's query twin must +//! raise, never fall through to native `jsonb jsonb`. +//! +//! Every `public.eql_v3__` and `eql_v3.query__` is a domain over +//! `jsonb`, and PostgreSQL resolves an operator against the base type unless an +//! operator with the exact argument types exists. Before the cross-pair +//! blockers, `eql_v3_text_ord = $1::eql_v3.query_text_eq` therefore compared the +//! two envelopes as plain JSON and answered false for equal values, with no +//! error. This suite enumerates the pairs from the installed catalog (so a new +//! domain is covered the day it lands) and asserts each one is claimed by an +//! exact-signature blocker. Creds-free. + +use anyhow::Result; +use sqlx::PgPool; + +/// `(storage, query_twin)` for every term-bearing domain: the pairs that are +/// MEANT to compare. Derived from the catalog: a query twin is +/// `eql_v3.query_` for storage domain `public.eql_v3_`. +async fn twins(pool: &PgPool) -> Result> { + Ok(sqlx::query_as( + r#"SELECT 'public.eql_v3_' || substr(q.typname, 7), 'eql_v3.' || q.typname + FROM pg_type q + JOIN pg_namespace qn ON qn.oid = q.typnamespace AND qn.nspname = 'eql_v3' + JOIN pg_type s ON s.typname = 'eql_v3_' || substr(q.typname, 7) + JOIN pg_namespace sn ON sn.oid = s.typnamespace AND sn.nspname = 'public' + WHERE q.typtype = 'd' AND q.typname LIKE 'query\_%' + -- the SteVec query operand has no scalar storage twin of this shape + AND q.typname <> 'query_json' + ORDER BY 1"#, + ) + .fetch_all(pool) + .await?) +} + +/// The family of a domain name: everything before the index suffix +/// (`text_ord_ope` → `text`). +fn family(storage: &str) -> &str { + let name = storage.trim_start_matches("public.eql_v3_"); + name.split('_').next().expect("a domain name has a family") +} + +/// Operators a storage domain SUPPORTS (a public `eql_v3` wrapper backs its +/// `(domain, domain)` overload, as opposed to an `eql_v3_internal` blocker). +async fn supported_ops(pool: &PgPool, storage: &str) -> Result> { + Ok(sqlx::query_scalar( + r#"SELECT o.oprname + FROM pg_operator o + JOIN pg_proc p ON p.oid = o.oprcode + JOIN pg_namespace pn ON pn.oid = p.pronamespace + WHERE o.oprleft = $1::regtype AND o.oprright = $1::regtype + AND pn.nspname = 'eql_v3' + AND o.oprname IN ('=', '<>', '<', '<=', '>', '>=', '@@') + ORDER BY 1"#, + ) + .bind(storage) + .fetch_all(pool) + .await?) +} + +/// Run `NULL:: NULL::` and return the error text, if any. +/// NULL operands are enough: a blocker raises unconditionally, while native +/// `jsonb jsonb` (the silent fallback) returns NULL. +async fn probe(pool: &PgPool, left: &str, op: &str, right: &str) -> Option { + sqlx::query(&format!("SELECT NULL::{left} {op} NULL::{right}")) + .fetch_all(pool) + .await + .err() + .map(|e| e.to_string()) +} + +#[sqlx::test] +async fn every_same_family_cross_domain_pair_raises_in_both_directions(pool: PgPool) -> Result<()> { + let twins = twins(&pool).await?; + assert!(twins.len() > 20, "catalog enumeration found {twins:?}"); + + let mut checked = 0; + let mut leaks = Vec::new(); + for (storage, _) in &twins { + let storage_ops = supported_ops(&pool, storage).await?; + for (other, query) in &twins { + if other == storage || family(other) != family(storage) { + continue; + } + // `query` is the twin of `other`; pair it with `storage`. + for op in supported_ops(&pool, other).await? { + if !storage_ops.contains(&op) { + continue; + } + for (l, r) in [(storage, query), (query, storage)] { + checked += 1; + match probe(&pool, l, &op, r).await { + Some(e) if e.contains("use the query domain that matches the column") => {} + other => leaks.push(format!("{l} {op} {r}: {other:?}")), + } + } + } + } + } + + assert!(checked > 500, "only {checked} pairs checked"); + assert!( + leaks.is_empty(), + "{} of {checked} same-family cross-domain pairs did not raise:\n{}", + leaks.len(), + leaks.join("\n") + ); + Ok(()) +} + +/// The reported cases (`@@` across families already errored: "operator is not +/// unique"), spelled out so a regression names the exact predicate. +#[sqlx::test] +async fn reported_mismatches_raise(pool: PgPool) -> Result<()> { + for (l, op, r) in [ + ("public.eql_v3_text_ord", "=", "eql_v3.query_text_eq"), + ("public.eql_v3_text_search", "=", "eql_v3.query_text_eq"), + ("public.eql_v3_text_ord", "<", "eql_v3.query_text_ord_ope"), + ("eql_v3.query_text_ord_ope", "<", "public.eql_v3_text_ord"), + ] { + let err = probe(&pool, l, op, r) + .await + .unwrap_or_else(|| panic!("{l} {op} {r} fell through to native jsonb")); + assert!(err.contains("is not supported for"), "{l} {op} {r}: {err}"); + } + Ok(()) +} + +/// Control: the matching twin is untouched — it still resolves to the wrapper. +#[sqlx::test] +async fn matching_twin_still_compares(pool: PgPool) -> Result<()> { + for (l, op, r) in [ + ("public.eql_v3_text_eq", "=", "eql_v3.query_text_eq"), + ("public.eql_v3_text_ord", "<", "eql_v3.query_text_ord"), + ("public.eql_v3_text_match", "@@", "eql_v3.query_text_match"), + ( + "public.eql_v3_integer_ord", + ">=", + "eql_v3.query_integer_ord", + ), + ] { + assert_eq!(probe(&pool, l, op, r).await, None, "{l} {op} {r}"); + } + Ok(()) +} + +/// The blockers are recognised as blockers by `eql_v3.lints()` (it matches their +/// message text), so none is reported as an inlinability or blocker-shape error. +/// Without the shared `is not supported for` marker every one of them is +/// misclassified as an ordinary operator wrapper that fails to inline. +#[sqlx::test] +async fn cross_pair_blockers_are_recognised_by_the_lints(pool: PgPool) -> Result<()> { + let flagged: Vec<(String, String, String)> = sqlx::query_as( + r#"SELECT severity, category, object_name FROM eql_v3.lints() + WHERE severity = 'error' + AND object_name LIKE 'operator %' + AND object_name LIKE '%query\_%'"#, + ) + .fetch_all(&pool) + .await?; + assert!( + flagged.is_empty(), + "lint errors on query-twin operators: {flagged:?}" + ); + + let blockers: i64 = sqlx::query_scalar( + r#"SELECT count(*) FROM pg_proc p + JOIN pg_namespace n ON n.oid = p.pronamespace AND n.nspname = 'eql_v3_internal' + WHERE p.prosrc LIKE '%use the query domain that matches the column%'"#, + ) + .fetch_one(&pool) + .await?; + assert!( + blockers > 500, + "only {blockers} cross-pair blockers installed" + ); + Ok(()) +} diff --git a/packages/eql/tests/sqlx/tests/v3_search_path_independence_tests.rs b/packages/eql/tests/sqlx/tests/v3_search_path_independence_tests.rs new file mode 100644 index 0000000000..6eb5e8672d --- /dev/null +++ b/packages/eql/tests/sqlx/tests/v3_search_path_independence_tests.rs @@ -0,0 +1,273 @@ +//! The `eql_v3` comparison wrappers give the same answer whatever the caller's +//! `search_path` is. +//! +//! The wrappers (`eql_v3.lt`, `eql_v3.eq`, …) are unpinned `LANGUAGE sql` +//! functions — pinning a `search_path` would stop them inlining, and with it +//! functional-index matching — so PostgreSQL parses their bodies under the +//! CALLER's `search_path`. The `_ord_ore` wrappers compare +//! `eql_v3_internal.ore_block_256` values, a composite type whose comparison +//! operators are created in `public`. With `public` off the path (a +//! `SECURITY DEFINER` helper with `SET search_path = ''`, as Supabase +//! recommends, or a hardened role path) a bare `<` in the body resolved to +//! pg_catalog's built-in RECORD comparison instead: the ciphertext bytes were +//! ordered lexicographically, with no error. The generator now emits every +//! wrapper operator schema-qualified (`OPERATOR(public.<)` for ORE, +//! `OPERATOR(pg_catalog.<)` for the built-in-typed terms). +//! +//! Creds-free: the ORE terms are hand-built from deterministic hex. They are +//! not real ciphertexts, but `eql_v3_internal.compare_ore_block_256_terms` is a +//! deterministic function of the bytes, so it is the oracle; the pairs are +//! chosen from a generator where that oracle and byte order disagree, so a +//! wrapper falling back to byte comparison fails here. +//! +//! The ORE-carrying domains come from the catalog (`eql_domains`), so a new one +//! is covered by construction. + +use anyhow::{ensure, Result}; +use eql_domains::{scalar_families, Term}; +use sqlx::{PgConnection, PgPool}; + +/// Comparison wrappers and the operator symbol each one backs. +const ORDERING: [(&str, &str); 4] = [("lt", "<"), ("lte", "<="), ("gt", ">"), ("gte", ">=")]; +const EQUALITY: [(&str, &str); 2] = [("eq", "="), ("neq", "<>")]; + +/// An ORE-carrying domain: its storage domain and its query twin, both +/// schema-qualified, plus the wrappers the ORE term serves on it. +struct OreDomain { + storage: String, + query: String, + wrappers: Vec<(&'static str, &'static str)>, +} + +/// Every scalar domain whose ordering is served by the ORE term. Equality is +/// included only where ORE serves it too: a domain that also carries `hm` +/// routes `=` through the HMAC term (first supporting term wins). +fn ore_domains() -> Vec { + let mut out = Vec::new(); + for family in scalar_families() { + for d in family.domains { + if Term::term_for_operator(d.terms, "<") != Some(Term::Ore) { + continue; + } + let mut wrappers = ORDERING.to_vec(); + if Term::term_for_operator(d.terms, "=") == Some(Term::Ore) { + wrappers.extend(EQUALITY); + } + out.push(OreDomain { + storage: format!("public.{}", family.domain_name(d)), + query: format!("eql_v3.{}", d.query_name(family.name)), + wrappers, + }); + } + } + out +} + +/// A storage payload carrying one ORE block term of `hex`. Every key any +/// ORE-carrying domain CHECK requires is present (`hm`/`bf` for the +/// multi-term text domains); only `ob` is ever compared. +fn storage_payload(hex: &str) -> String { + format!(r#"{{"v":3,"i":{{}},"c":"x","hm":"00","bf":[1],"ob":["{hex}"]}}"#) +} + +/// The query-twin payload: the same terms, without the ciphertext `c`. +fn query_payload(hex: &str) -> String { + format!(r#"{{"v":3,"i":{{}},"hm":"00","bf":[1],"ob":["{hex}"]}}"#) +} + +/// The ORE comparator's verdict on `(a, b)`, called fully qualified so the +/// answer does not depend on the connection's `search_path`. +async fn ore_compare(conn: &mut PgConnection, domain: &str, a: &str, b: &str) -> Result { + let sql = format!( + "SELECT eql_v3_internal.compare_ore_block_256_terms( \ + eql_v3.ord_term_ore($1::pg_catalog.jsonb::{domain}), \ + eql_v3.ord_term_ore($2::pg_catalog.jsonb::{domain}))" + ); + Ok(sqlx::query_scalar(&sql) + .bind(a) + .bind(b) + .fetch_one(&mut *conn) + .await?) +} + +/// What a correct wrapper returns for a comparator verdict `cmp`. +fn expected(symbol: &str, cmp: i32) -> bool { + match symbol { + "<" => cmp < 0, + "<=" => cmp <= 0, + ">" => cmp > 0, + ">=" => cmp >= 0, + "=" => cmp == 0, + "<>" => cmp != 0, + other => unreachable!("no expectation for {other}"), + } +} + +/// Pairs of single-block ORE terms on which the comparator and plain byte order +/// disagree in BOTH directions, so a byte-comparison fallback is wrong on at +/// least one of them for every ordering operator. The candidates are +/// well-formed single-block terms (49 * 1 + 16 = 65 bytes, 130 hex digits) +/// derived from md5, generated and judged in one round trip; `probe` is any +/// ORE-carrying storage domain (the comparator does not depend on which). +async fn discriminating_pairs( + conn: &mut PgConnection, + probe: &str, +) -> Result> { + let sql = format!( + r#"WITH c AS ( + SELECT i, + substr(repeat(md5('a' || i), 5), 1, 130) AS a, + substr(repeat(md5('b' || i), 5), 1, 130) AS b + FROM generate_series(0, 63) AS i + ), v AS ( + SELECT i, a, b, + eql_v3_internal.compare_ore_block_256_terms( + eql_v3.ord_term_ore(jsonb_build_object('v', 3, 'i', '{{}}'::jsonb, 'c', 'x', + 'hm', '00', 'bf', '[1]'::jsonb, 'ob', jsonb_build_array(a))::{probe}), + eql_v3.ord_term_ore(jsonb_build_object('v', 3, 'i', '{{}}'::jsonb, 'c', 'x', + 'hm', '00', 'bf', '[1]'::jsonb, 'ob', jsonb_build_array(b))::{probe}) + ) AS cmp + FROM c + ) + -- lowercase hex: text order under the C collation is byte order + (SELECT a, b FROM v WHERE cmp = -1 AND a COLLATE "C" > b ORDER BY i LIMIT 1) + UNION ALL + (SELECT a, b FROM v WHERE cmp = 1 AND a COLLATE "C" < b ORDER BY i LIMIT 1)"# + ); + let mut pairs: Vec<(String, String)> = sqlx::query_as(&sql).fetch_all(&mut *conn).await?; + ensure!( + pairs.len() == 2, + "the generated pairs lack an ORE/byte-order disagreement in both directions" + ); + // An identical pair pins `=` / `<=` / `>=` on equal terms too. + let same = pairs[0].0.clone(); + pairs.push((same.clone(), same)); + Ok(pairs) +} + +/// Every `_ord_ore` wrapper, called by name and through its operator, agrees +/// with the ORE comparator with `search_path = ''` — on the storage domain, +/// the query twin in both directions, and with a bare `jsonb` operand. +#[sqlx::test] +async fn ore_wrappers_use_the_ore_comparator_without_public_on_search_path( + pool: PgPool, +) -> Result<()> { + let domains = ore_domains(); + ensure!(!domains.is_empty(), "catalog has no ORE-carrying domain"); + let mut conn = pool.acquire().await?; + let pairs = discriminating_pairs(&mut conn, &domains[0].storage).await?; + + // Oracle verdicts first, under the default path. + let mut verdicts = Vec::new(); + for d in &domains { + for (a, b) in &pairs { + let cmp = ore_compare( + &mut conn, + &d.storage, + &storage_payload(a), + &storage_payload(b), + ) + .await?; + verdicts.push(cmp); + } + } + + sqlx::query("SET search_path = ''") + .execute(&mut *conn) + .await?; + + let mut checked = 0; + let mut verdict = verdicts.into_iter(); + for d in &domains { + let (s, q) = (&d.storage, &d.query); + for (a, b) in &pairs { + let cmp = verdict.next().expect("one verdict per domain and pair"); + let (sa, sb, qb) = (storage_payload(a), storage_payload(b), query_payload(b)); + let qa = query_payload(a); + for (func, symbol) in &d.wrappers { + let want = expected(symbol, cmp); + // (storage, storage), (storage, jsonb), (storage, query) and + // (query, storage), by wrapper name and by operator. + let forms = [ + (format!("eql_v3.{func}($1::pg_catalog.jsonb::{s}, $2::pg_catalog.jsonb::{s})"), &sa, &sb), + (format!("eql_v3.{func}($1::pg_catalog.jsonb::{s}, $2::pg_catalog.jsonb)"), &sa, &sb), + (format!("eql_v3.{func}($1::pg_catalog.jsonb::{s}, $2::pg_catalog.jsonb::{q})"), &sa, &qb), + (format!("eql_v3.{func}($1::pg_catalog.jsonb::{q}, $2::pg_catalog.jsonb::{s})"), &qa, &sb), + (format!("$1::pg_catalog.jsonb::{s} OPERATOR(public.{symbol}) $2::pg_catalog.jsonb::{s}"), &sa, &sb), + (format!("$1::pg_catalog.jsonb::{s} OPERATOR(public.{symbol}) $2::pg_catalog.jsonb::{q}"), &sa, &qb), + ]; + for (expr, x, y) in forms { + let got: bool = sqlx::query_scalar(&format!("SELECT {expr}")) + .bind(x) + .bind(y) + .fetch_one(&mut *conn) + .await?; + ensure!( + got == want, + "{expr} returned {got}, ORE comparator says {want} (cmp = {cmp}) \ + with search_path = '' — a byte-comparison fallback" + ); + checked += 1; + } + } + } + } + ensure!(checked > 0, "no comparisons were checked"); + Ok(()) +} + +/// The issue's trigger shape: a helper pinned to `SET search_path = ''` (the +/// Supabase-recommended hardening) calling an `_ord_ore` wrapper. A malformed +/// pair must reach the ORE comparator and raise, not be compared as records. +#[sqlx::test] +async fn ore_wrapper_raises_on_malformed_terms_inside_an_empty_search_path_function( + pool: PgPool, +) -> Result<()> { + sqlx::query( + "CREATE FUNCTION public.probe_lt(a jsonb, b jsonb) RETURNS boolean \ + LANGUAGE plpgsql SECURITY DEFINER SET search_path = '' AS $$ \ + BEGIN \ + RETURN eql_v3.lt(a::public.eql_v3_integer_ord_ore, b::public.eql_v3_integer_ord_ore); \ + END $$", + ) + .execute(&pool) + .await?; + + // Different-length terms: the ORE comparator rejects them; a record + // comparison would silently answer. + let err = sqlx::query_scalar::<_, bool>("SELECT public.probe_lt($1::jsonb, $2::jsonb)") + .bind(storage_payload("aaaa")) + .bind(storage_payload("bbbbbb")) + .fetch_one(&pool) + .await + .expect_err("a malformed ORE pair must raise, not compare as records"); + ensure!( + err.to_string() + .contains("Ciphertexts are different lengths"), + "unexpected error: {err}" + ); + Ok(()) +} + +/// HMAC equality is unaffected by the path today (its operators are +/// pg_catalog's), and must stay so now that the wrapper names them qualified. +#[sqlx::test] +async fn hmac_wrappers_work_without_public_on_search_path(pool: PgPool) -> Result<()> { + let mut conn = pool.acquire().await?; + sqlx::query("SET search_path = ''") + .execute(&mut *conn) + .await?; + let eq = |hm: &str| format!(r#"{{"v":3,"i":{{}},"c":"x","hm":"{hm}"}}"#); + for (a, b, want) in [("aa", "aa", true), ("aa", "bb", false)] { + let got: bool = sqlx::query_scalar( + "SELECT eql_v3.eq($1::pg_catalog.jsonb::public.eql_v3_integer_eq, \ + $2::pg_catalog.jsonb::public.eql_v3_integer_eq)", + ) + .bind(eq(a)) + .bind(eq(b)) + .fetch_one(&mut *conn) + .await?; + ensure!(got == want, "eql_v3.eq({a}, {b}) = {got}, want {want}"); + } + Ok(()) +} diff --git a/packages/stack-auth/fuzz/Cargo.lock b/packages/stack-auth/fuzz/Cargo.lock index 7fbe492aac..7e3c48d2ee 100644 --- a/packages/stack-auth/fuzz/Cargo.lock +++ b/packages/stack-auth/fuzz/Cargo.lock @@ -2284,9 +2284,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.45" +version = "0.23.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" dependencies = [ "aws-lc-rs", "once_cell", @@ -2652,6 +2652,7 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "uuid", + "zeroize", ] [[package]] diff --git a/packages/stack-auth/src/auto_strategy.rs b/packages/stack-auth/src/auto_strategy.rs index 8a28f618f7..5f7be7735c 100644 --- a/packages/stack-auth/src/auto_strategy.rs +++ b/packages/stack-auth/src/auto_strategy.rs @@ -9,7 +9,7 @@ use crate::transport::{self, SharedTransport}; use crate::HttpTransport; #[cfg(not(target_arch = "wasm32"))] use crate::Token; -use crate::{AuthError, AuthStrategy, ServiceToken}; +use crate::{AuthError, AuthStrategy, SecretToken, ServiceToken}; /// An [`AuthStrategy`] that automatically detects available credentials /// and delegates to the appropriate inner strategy. @@ -24,6 +24,8 @@ use crate::{AuthError, AuthStrategy, ServiceToken}; /// to verify every issued token. /// 2. If a token store file exists at the default location /// (`~/.cipherstash/auth.json`), a [`DeviceSessionStrategy`] is created from it. +/// If a workspace CRN is supplied, the session of that workspace is used +/// (not the CLI's current one) and every token is verified against it. /// 3. Otherwise, [`AuthError::NotAuthenticated`] is returned. /// /// # Examples @@ -93,7 +95,8 @@ impl AutoStrategy { /// /// Resolution order: /// 1. `CS_CLIENT_ACCESS_KEY` env var → [`AccessKeyStrategy`] - /// 2. `~/.cipherstash/auth.json` → [`DeviceSessionStrategy`] + /// 2. `~/.cipherstash/auth.json` → [`DeviceSessionStrategy`] (the workspace + /// named by `CS_WORKSPACE_CRN` if set, otherwise the current one) /// 3. [`AuthError::NotAuthenticated`] pub fn detect() -> Result { Self::builder().detect() @@ -106,7 +109,7 @@ impl AutoStrategy { /// unreachable (no filesystem) — callers must supply an access key. #[cfg(not(target_arch = "wasm32"))] fn detect_inner( - access_key: Option, + access_key: Option<&str>, crn: Option, store: Option, transport: Option, @@ -123,16 +126,22 @@ impl AutoStrategy { return Ok(Self::AccessKey(strategy)); } - // 2. OAuth token from disk (in the current workspace directory) + // 2. OAuth token from disk. A supplied CRN pins the workspace, so the + // CLI's current workspace is irrelevant; without one, use it. if let Some(store) = store { - let has_token = store - .current_workspace_store() + let ws_store = match &crn { + Some(crn) => store.workspace_store(crn.workspace_id.as_str()), + None => store.current_workspace_store(), + }; + let has_token = ws_store .map(|ws| ws.exists_profile::()) .unwrap_or(false); if has_token { - let strategy = DeviceSessionStrategy::with_profile(store) - .maybe_transport(transport) - .build()?; + let mut builder = DeviceSessionStrategy::with_profile(store); + if let Some(crn) = &crn { + builder = builder.workspace_crn(crn); + } + let strategy = builder.maybe_transport(transport).build()?; return Ok(Self::DeviceSession(strategy)); } } @@ -143,7 +152,7 @@ impl AutoStrategy { #[cfg(target_arch = "wasm32")] fn detect_inner( - access_key: Option, + access_key: Option<&str>, crn: Option, transport: Option, ) -> Result { @@ -180,7 +189,8 @@ impl AutoStrategy { /// # } /// ``` pub struct AutoStrategyBuilder { - access_key: Option, + /// A [`SecretToken`] so the key is wiped on drop and masked in `Debug`. + access_key: Option, crn: Option, transport: Option, } @@ -195,7 +205,7 @@ impl AutoStrategyBuilder { /// Provide an explicit access key. Takes precedence over env vars. pub fn with_access_key(mut self, access_key: impl Into) -> Self { - self.access_key = Some(access_key.into()); + self.access_key = Some(SecretToken::new(access_key)); self } @@ -214,9 +224,11 @@ impl AutoStrategyBuilder { /// 4. [`AuthError::NotAuthenticated`] pub fn detect(self) -> Result { // Merge explicit values with env vars (explicit wins) + // Wrapped as soon as it is read, so this copy is wiped on drop. The + // process environment keeps its own copy, which is beyond our reach. let access_key = self .access_key - .or_else(|| std::env::var("CS_CLIENT_ACCESS_KEY").ok()); + .or_else(|| access_key_from_env(std::env::var("CS_CLIENT_ACCESS_KEY"))); let crn = match self.crn { Some(crn) => Some(crn), @@ -238,11 +250,20 @@ impl AutoStrategyBuilder { None } }; - AutoStrategy::detect_inner(access_key, crn, store, self.transport) + AutoStrategy::detect_inner( + access_key.as_ref().map(SecretToken::as_str), + crn, + store, + self.transport, + ) } #[cfg(target_arch = "wasm32")] { - AutoStrategy::detect_inner(access_key, crn, self.transport) + AutoStrategy::detect_inner( + access_key.as_ref().map(SecretToken::as_str), + crn, + self.transport, + ) } } } @@ -256,6 +277,25 @@ impl AuthStrategy for &AutoStrategy { } } +/// Wrap an access key read from the environment, wiping it if it is unusable. +/// +/// A value that is not valid UTF-8 comes back as [`VarError::NotUnicode`], +/// which owns the whole key. It cannot be a valid access key, so it is +/// treated as unset, as before; but it is wiped first rather than dropped, +/// since it is still a credential. +/// +/// [`VarError::NotUnicode`]: std::env::VarError::NotUnicode +fn access_key_from_env(value: Result) -> Option { + match value { + Ok(key) => Some(SecretToken::new(key)), + Err(std::env::VarError::NotUnicode(key)) => { + drop(zeroize::Zeroizing::new(key.into_encoded_bytes())); + None + } + Err(std::env::VarError::NotPresent) => None, + } +} + #[cfg(test)] mod tests { use super::*; @@ -319,7 +359,7 @@ mod tests { #[cfg(feature = "http")] // builds a strategy with no transport of its own fn access_key_with_valid_crn() { let result = AutoStrategy::detect_inner( - Some("CSAKtestKeyId.testKeySecret".into()), + Some("CSAKtestKeyId.testKeySecret"), Some(valid_crn()), None, None, @@ -331,24 +371,16 @@ mod tests { #[test] fn access_key_without_crn_returns_missing_workspace_crn() { - let result = AutoStrategy::detect_inner( - Some("CSAKtestKeyId.testKeySecret".into()), - None, - None, - None, - ); + let result = + AutoStrategy::detect_inner(Some("CSAKtestKeyId.testKeySecret"), None, None, None); assert!(matches!(result, Err(AuthError::MissingWorkspaceCrn(_)))); } #[test] fn invalid_access_key_format_returns_invalid_access_key() { - let result = AutoStrategy::detect_inner( - Some("not-a-valid-key".into()), - Some(valid_crn()), - None, - None, - ); + let result = + AutoStrategy::detect_inner(Some("not-a-valid-key"), Some(valid_crn()), None, None); assert!(matches!(result, Err(AuthError::InvalidAccessKey(_)))); } @@ -365,6 +397,43 @@ mod tests { assert!(matches!(result.unwrap(), AutoStrategy::DeviceSession(_))); } + #[test] + #[cfg(feature = "http")] // builds a strategy with no transport of its own + fn crn_selects_that_workspaces_session_over_the_current_one() { + let dir = tempfile::tempdir().unwrap(); + let store = write_token_store(dir.path()); + // The CLI user switches to another workspace with no session. + store.init_workspace("AAAAAAAAAAAAAAAA").unwrap(); + + let result = AutoStrategy::detect_inner(None, Some(valid_crn()), Some(store), None); + + assert!(matches!(result, Ok(AutoStrategy::DeviceSession(_)))); + } + + #[test] + #[cfg(feature = "http")] // builds a strategy with no transport of its own + fn crn_matching_the_current_workspace_builds_a_device_session() { + let dir = tempfile::tempdir().unwrap(); + let store = write_token_store(dir.path()); + + let result = AutoStrategy::detect_inner(None, Some(valid_crn()), Some(store), None); + + assert!(matches!(result, Ok(AutoStrategy::DeviceSession(_)))); + } + + #[test] + #[cfg(feature = "http")] // saves a token, so the fallback would build a strategy + fn crn_without_a_session_for_that_workspace_is_not_authenticated() { + let dir = tempfile::tempdir().unwrap(); + // The current workspace has a token; the CRN names another. + let store = write_token_store(dir.path()); + let crn: Crn = "crn:ap-southeast-2.aws:AAAAAAAAAAAAAAAA".parse().unwrap(); + + let result = AutoStrategy::detect_inner(None, Some(crn), Some(store), None); + + assert!(matches!(result, Err(AuthError::NotAuthenticated(_)))); + } + #[test] fn oauth_store_without_token_file_returns_not_authenticated() { let dir = tempfile::tempdir().unwrap(); @@ -389,7 +458,7 @@ mod tests { let store = write_token_store(dir.path()); let result = AutoStrategy::detect_inner( - Some("CSAKtestKeyId.testKeySecret".into()), + Some("CSAKtestKeyId.testKeySecret"), Some(valid_crn()), Some(store), None, @@ -450,4 +519,26 @@ mod tests { assert!(matches!(result, Err(AuthError::InvalidAccessKey(_)))); } } + + mod access_key_from_env { + use super::super::access_key_from_env; + use std::env::VarError; + + #[test] + fn wraps_a_set_value() { + let key = access_key_from_env(Ok("CSAKid.secret".to_string())).unwrap(); + assert_eq!(key.as_str(), "CSAKid.secret"); + } + + #[test] + fn treats_an_unset_value_as_absent() { + assert!(access_key_from_env(Err(VarError::NotPresent)).is_none()); + } + + #[test] + fn treats_a_non_utf8_value_as_absent() { + let value = std::ffi::OsString::from("CSAKid.secret"); + assert!(access_key_from_env(Err(VarError::NotUnicode(value))).is_none()); + } + } } diff --git a/packages/stack-auth/src/device_code/mod.rs b/packages/stack-auth/src/device_code/mod.rs index eb8f659d41..d343cb1022 100644 --- a/packages/stack-auth/src/device_code/mod.rs +++ b/packages/stack-auth/src/device_code/mod.rs @@ -18,6 +18,16 @@ use protocol::{ #[cfg(test)] mod tests; +/// The longest device-code lifetime this crate polls for, in seconds (one +/// hour). +/// +/// `expires_in` is server-supplied, and [`PendingDeviceCode::poll_for_token`] +/// adds it to an [`Instant`](tokio::time::Instant), which panics on overflow +/// in every build profile. RFC 8628 device codes live for minutes, so a +/// larger value is clamped rather than trusted: at worst the user restarts +/// sign-in after an hour. +const MAX_DEVICE_CODE_LIFETIME_SECS: u64 = 60 * 60; + // Keep the browser boundary visible to callers of `open_in_browser`. fn launch_browser(uri: &str) -> std::io::Result<()> { #[cfg(test)] @@ -142,9 +152,11 @@ impl DeviceCodeStrategy { let token_url = self.base_url.join("oauth/device/token")?; + let expires_in = code.expires_in.min(MAX_DEVICE_CODE_LIFETIME_SECS); tracing::debug!( user_code = %code.user_code, - expires_in = code.expires_in, + expires_in, + server_expires_in = code.expires_in, "device code received" ); @@ -156,7 +168,11 @@ impl DeviceCodeStrategy { user_code: code.user_code, verification_uri: code.verification_uri, verification_uri_complete: code.verification_uri_complete, - expires_in: code.expires_in, + expires_in, + // Fixed now, when the code is issued, so a caller that waits + // before polling does not get a fresh window. `expires_in` is + // clamped above, so this cannot overflow. + deadline: tokio::time::Instant::now() + tokio::time::Duration::from_secs(expires_in), profile_dir: self.profile_dir.clone(), device_identity: self.device_identity.clone(), }) @@ -265,8 +281,12 @@ pub struct PendingDeviceCode { verification_uri: String, /// The full verification URI with the user code pre-filled. verification_uri_complete: String, - /// How many seconds the device code remains valid. + /// How many seconds the device code remains valid, clamped to + /// [`MAX_DEVICE_CODE_LIFETIME_SECS`]. expires_in: u64, + /// When the device code expires: when it was received plus `expires_in`. + /// Polling stops here, including mid-request and mid-sleep. + deadline: tokio::time::Instant, /// Profile directory override. Falls back to `~/.cipherstash`. profile_dir: Option, /// Device identity to associate with the token. @@ -289,7 +309,12 @@ impl PendingDeviceCode { &self.verification_uri_complete } - /// How many seconds the device code remains valid. + /// How many seconds the device code was valid for when it was issued. + /// + /// This is the server's `expires_in`, capped at one hour. The lifetime + /// runs from when [`begin`](DeviceCodeStrategy::begin) received the + /// code, not from when polling starts: polling stops at that point even + /// if the server claimed a longer lifetime. pub fn expires_in(&self) -> u64 { self.expires_in } @@ -316,8 +341,7 @@ impl PendingDeviceCode { pub async fn poll_for_token(self) -> Result { let transport = bundled_transport(); let mut interval = tokio::time::Duration::from_secs(5); - let deadline = - tokio::time::Instant::now() + tokio::time::Duration::from_secs(self.expires_in); + let deadline = self.deadline; tracing::debug!( url = %self.token_url, @@ -331,16 +355,22 @@ impl PendingDeviceCode { return Err(AuthError::TokenExpired(crate::error::TokenExpired)); } - let resp = transport::post_form( - &transport, - self.token_url.clone(), - &TokenRequest { - client_id: &self.client_id, - device_code: &self.device_code, - grant_type: "urn:ietf:params:oauth:grant-type:device_code", - }, + // A response that arrives after the deadline is dropped rather + // than saved: the code has expired, whatever the server says. + let resp = tokio::time::timeout_at( + deadline, + transport::post_form( + &transport, + self.token_url.clone(), + &TokenRequest { + client_id: &self.client_id, + device_code: &self.device_code, + grant_type: "urn:ietf:params:oauth:grant-type:device_code", + }, + ), ) - .await?; + .await + .map_err(|_| AuthError::TokenExpired(crate::error::TokenExpired))??; if resp.is_success() { tracing::debug!("token received"); @@ -352,7 +382,7 @@ impl PendingDeviceCode { let mut token = Token { access_token: token_resp.access_token, token_type: token_resp.token_type, - expires_at: now + token_resp.expires_in, + expires_at: crate::token::expires_at_after(now, token_resp.expires_in), refresh_token: token_resp.refresh_token, region: None, client_id: None, @@ -417,7 +447,9 @@ impl PendingDeviceCode { } } - tokio::time::sleep(interval).await; + // Wake at the deadline rather than sleeping past it; the check at + // the top of the loop then reports the expiry. + tokio::time::sleep_until(deadline.min(tokio::time::Instant::now() + interval)).await; } } } diff --git a/packages/stack-auth/src/device_code/tests.rs b/packages/stack-auth/src/device_code/tests.rs index c277b0bacd..d77a7f6227 100644 --- a/packages/stack-auth/src/device_code/tests.rs +++ b/packages/stack-auth/src/device_code/tests.rs @@ -423,16 +423,13 @@ async fn test_poll_for_token_authorization_pending_then_success() { let dir = TempDir::new().unwrap(); let mut mocks = MockSet::new(); mock_code_endpoint(&mut mocks); - mocks.mock(|when, then| { - when.post().path("/oauth/device/token"); - then.bad_request().json(error_json("authorization_pending")); - }); + mock_token_errors(&mut mocks, "authorization_pending", 2); let server = start_server(mocks).await; let pending = begin_pending(&server, &dir).await; // Use tokio::join! so the swap future can borrow server.mocks() directly // (the shared RwLock) rather than cloning the MockSet. - // First poll at T=5s returns "authorization_pending". + // Polls at T=0s and T=5s return "authorization_pending". // At T=6s the mock is swapped. Second poll at T=10s returns success. let (result, _) = tokio::join!(pending.poll_for_token(), async { tokio::time::sleep(tokio::time::Duration::from_secs(6)).await; @@ -456,10 +453,7 @@ async fn test_poll_for_token_slow_down_then_success() { let dir = TempDir::new().unwrap(); let mut mocks = MockSet::new(); mock_code_endpoint(&mut mocks); - mocks.mock(|when, then| { - when.post().path("/oauth/device/token"); - then.bad_request().json(error_json("slow_down")); - }); + mock_token_errors(&mut mocks, "slow_down", 2); let server = start_server(mocks).await; let pending = begin_pending(&server, &dir).await; @@ -502,16 +496,199 @@ async fn test_poll_for_token_slow_down_increases_interval() { "expires_in": 12 })); }); + mock_token_errors(&mut mocks, "slow_down", 2); + let server = start_server(mocks).await; + let pending = begin_pending(&server, &dir).await; + + let err = pending.poll_for_token().await.unwrap_err(); + + assert!(matches!(err, AuthError::TokenExpired(_))); +} + +/// Answer the token endpoint with `error` for at most `polls` requests, +/// then with `access_denied`. A test whose server never stops answering +/// `authorization_pending` or `slow_down` would spin forever if polling +/// stopped waiting between requests (paused time only advances when the +/// runtime is idle); the cap turns that into a fast failure instead. +fn mock_token_errors(mocks: &mut MockSet, error: &'static str, polls: usize) { + mocks.mock_with_options(1, Some(polls), move |when, then| { + when.post().path("/oauth/device/token"); + then.bad_request().json(error_json(error)); + }); + mocks.mock_with_options(2, None, |when, then| { + when.post().path("/oauth/device/token"); + then.bad_request().json(error_json("access_denied")); + }); +} + +fn device_code_json_expiring_in(expires_in: u64) -> serde_json::Value { + let mut json = device_code_json(); + json["expires_in"] = expires_in.into(); + json +} + +/// A server-supplied device-code lifetime past the cap is clamped, so the +/// poll deadline (`Instant::now() + expires_in`) cannot overflow and panic. +#[tokio::test(start_paused = true)] +async fn test_poll_for_token_clamps_an_oversized_device_code_lifetime() { + let dir = TempDir::new().unwrap(); + let mut mocks = MockSet::new(); + mocks.mock(|when, then| { + when.post().path("/oauth/device/code"); + then.json(device_code_json_expiring_in(u64::MAX)); + }); mocks.mock(|when, then| { when.post().path("/oauth/device/token"); - then.bad_request().json(error_json("slow_down")); + then.json(token_json()); + }); + let server = start_server(mocks).await; + + let pending = begin_pending(&server, &dir).await; + assert_eq!( + pending.expires_in(), + 3_600, + "an oversized device-code lifetime must be clamped to one hour" + ); + + let token = pending + .poll_for_token() + .await + .expect("polling must not panic on an oversized device-code lifetime"); + assert!(!token.is_expired()); +} + +/// The clamped deadline is still enforced: once it passes, polling stops +/// with `TokenExpired` rather than running for as long as the server said. +#[tokio::test(start_paused = true)] +async fn test_poll_for_token_expires_at_the_clamped_deadline() { + let dir = TempDir::new().unwrap(); + let mut mocks = MockSet::new(); + mocks.mock(|when, then| { + when.post().path("/oauth/device/code"); + then.json(device_code_json_expiring_in(u64::MAX)); + }); + mock_token_errors(&mut mocks, "authorization_pending", 721); + let server = start_server(mocks).await; + let pending = begin_pending(&server, &dir).await; + let started = tokio::time::Instant::now(); + + let err = pending.poll_for_token().await.unwrap_err(); + + assert!(matches!(err, AuthError::TokenExpired(_))); + let elapsed = started.elapsed().as_secs(); + assert!( + (MAX_DEVICE_CODE_LIFETIME_SECS..MAX_DEVICE_CODE_LIFETIME_SECS + 10).contains(&elapsed), + "polling should stop at the one-hour cap; stopped after {elapsed}s" + ); +} + +fn mock_pending_for(mocks: &mut MockSet, expires_in: u64, polls: usize) { + mocks.mock(|when, then| { + when.post().path("/oauth/device/code"); + then.json(device_code_json_expiring_in(expires_in)); }); + mock_token_errors(mocks, "authorization_pending", polls); +} + +/// The lifetime runs from when the code was received, not from when +/// polling starts: a caller that waits past it gets no fresh window. +#[tokio::test(start_paused = true)] +async fn test_poll_for_token_counts_the_lifetime_from_begin() { + let dir = TempDir::new().unwrap(); + let mut mocks = MockSet::new(); + mock_pending_for(&mut mocks, 900, 1); let server = start_server(mocks).await; let pending = begin_pending(&server, &dir).await; + tokio::time::advance(tokio::time::Duration::from_secs(901)).await; + let started = tokio::time::Instant::now(); let err = pending.poll_for_token().await.unwrap_err(); assert!(matches!(err, AuthError::TokenExpired(_))); + assert_eq!( + started.elapsed().as_secs(), + 0, + "an already-expired code must not be polled for another window" + ); +} + +/// Polling stops at the deadline itself, not at the first poll after it. +#[tokio::test(start_paused = true)] +async fn test_poll_for_token_does_not_sleep_past_the_deadline() { + let dir = TempDir::new().unwrap(); + let mut mocks = MockSet::new(); + // Polls at T=0 and T=5; the next would be T=10, past the 7s deadline. + mock_pending_for(&mut mocks, 7, 2); + let server = start_server(mocks).await; + let pending = begin_pending(&server, &dir).await; + let started = tokio::time::Instant::now(); + + let err = pending.poll_for_token().await.unwrap_err(); + + assert!(matches!(err, AuthError::TokenExpired(_))); + assert_eq!( + started.elapsed().as_secs(), + 7, + "polling should stop at the deadline, not sleep past it" + ); +} + +/// Polling waits the interval between requests: the server allows exactly +/// the polls that fit before the deadline, so one more fails the test. +#[tokio::test(start_paused = true)] +async fn test_poll_for_token_waits_the_interval_between_polls() { + let dir = TempDir::new().unwrap(); + let mut mocks = MockSet::new(); + mocks.mock(|when, then| { + when.post().path("/oauth/device/code"); + then.json(device_code_json_expiring_in(12)); + }); + // Polls at T=0, 5 and 10; the next would be T=15, past the deadline. + mock_token_errors(&mut mocks, "authorization_pending", 3); + let server = start_server(mocks).await; + let pending = begin_pending(&server, &dir).await; + let started = tokio::time::Instant::now(); + + let err = pending.poll_for_token().await.unwrap_err(); + + assert!( + matches!(err, AuthError::TokenExpired(_)), + "expected the deadline to end polling after three polls, got {err:?}" + ); + assert_eq!(started.elapsed().as_secs(), 12); +} + +/// A server-supplied token lifetime past the cap is clamped on the +/// device-code path too, rather than wrapping `now + expires_in` to a +/// timestamp in the past. +#[tokio::test(start_paused = true)] +async fn test_poll_for_token_clamps_an_oversized_token_lifetime() { + let dir = TempDir::new().unwrap(); + let mut mocks = MockSet::new(); + mock_code_endpoint(&mut mocks); + mocks.mock(|when, then| { + when.post().path("/oauth/device/token"); + then.json(serde_json::json!({ + "access_token": test_access_token(), + "token_type": "Bearer", + "expires_in": u64::MAX + })); + }); + let server = start_server(mocks).await; + + let token = begin_pending(&server, &dir) + .await + .poll_for_token() + .await + .unwrap(); + + let max = crate::token::MAX_TOKEN_LIFETIME_SECS; + assert!(!token.is_expired(), "the token must not wrap to expired"); + assert!( + (max - 2..=max).contains(&token.expires_in()), + "token lifetime should be clamped; got {}", + token.expires_in() + ); } // ---- ensure_trailing_slash / URL join tests ---- diff --git a/packages/stack-auth/src/device_session_refresher.rs b/packages/stack-auth/src/device_session_refresher.rs index 225de57359..b699bcc5e0 100644 --- a/packages/stack-auth/src/device_session_refresher.rs +++ b/packages/stack-auth/src/device_session_refresher.rs @@ -1,3 +1,4 @@ +use cts_common::WorkspaceId; use url::Url; use stack_profile::ProfileStore; @@ -20,6 +21,14 @@ pub(crate) struct DeviceSessionRefresher { region: String, device_instance_id: Option, transport: SharedTransport, + /// When set, a refreshed token for any other workspace is refused before + /// it is cached or written to the store. + expected_workspace: Option, + /// Set once an exchange consumed this session's refresh credential and + /// returned a token we refused. The credential cannot be replayed (the + /// issuer would revoke the chain), so every later refresh through this + /// refresher asks for a new sign-in instead. + credential_consumed: std::sync::atomic::AtomicBool, } impl DeviceSessionRefresher { @@ -38,8 +47,45 @@ impl DeviceSessionRefresher { region: region.into(), device_instance_id, transport, + expected_workspace: None, + credential_consumed: std::sync::atomic::AtomicBool::new(false), } } + + /// Refuse, before it is cached or saved, any refreshed token that is not + /// for `workspace`. Otherwise a session for another workspace would be + /// written over this profile's, where a sibling process would pick it up. + pub(crate) fn pinned_to(mut self, workspace: Option) -> Self { + self.expected_workspace = workspace; + self + } + + fn check_workspace(&self, token: &Token) -> Result<(), AuthError> { + ensure_workspace(token, self.expected_workspace) + } +} + +/// Refuse `token` unless it is for `expected` (no pin: accept it). Used on +/// the session a strategy starts from as well as on refreshed tokens, so a +/// session for another workspace never reaches `AutoRefresh`, whose refresh +/// would consume that session's credential. +pub(crate) fn ensure_workspace( + token: &Token, + expected: Option, +) -> Result<(), AuthError> { + let Some(expected) = expected else { + return Ok(()); + }; + let token_workspace = token.workspace_id()?; + if token_workspace != expected { + return Err(AuthError::WorkspaceMismatch( + crate::error::WorkspaceMismatch { + expected_workspace: expected, + token_workspace, + }, + )); + } + Ok(()) } impl Refresher for DeviceSessionRefresher { @@ -63,6 +109,10 @@ impl Refresher for DeviceSessionRefresher { } async fn refresh(&self, credential: &Self::Credential) -> Result { + use std::sync::atomic::Ordering; + if self.credential_consumed.load(Ordering::SeqCst) { + return Err(AuthError::NotAuthenticated(crate::error::NotAuthenticated)); + } // Cross-process refresh lock: only one process should be exchanging // a refresh token with the upstream IdP at a time. Without this, // two CLI invocations sharing `~/.cipherstash` both load the same @@ -88,6 +138,7 @@ impl Refresher for DeviceSessionRefresher { tracing::debug!( "refresh skipped: another process rotated the token while we waited on the lock" ); + self.check_workspace(&disk_token)?; return Ok(disk_token); } @@ -105,6 +156,32 @@ impl Refresher for DeviceSessionRefresher { token.set_device_instance_id(id); } + // Before anything is saved or cached: a rejected token must leave + // this profile's saved session alone. + if let Err(err) = self.check_workspace(&token) { + // The saved session is left alone, unless the issuer rotated the + // credential: then the saved copy is spent, and a retry (here or + // in another process) would replay it and get the whole chain + // revoked. Drop it so the next attempt asks for a sign-in. + let rotated = token + .refresh_token() + .is_some_and(|new| new.as_str() != credential.as_str()); + if rotated { + self.credential_consumed + .store(true, std::sync::atomic::Ordering::SeqCst); + if let Some(store) = &self.store { + // A spent credential left on disk can be replayed by the + // next process, so a failure to clear it is the error the + // caller sees, not the mismatch. + store.clear_profile::().map_err(|clear_err| { + tracing::error!(%clear_err, "failed to clear a consumed session"); + AuthError::from(clear_err) + })?; + } + } + return Err(err); + } + // Persist while holding the lock — any sibling process waiting on // the lock will read the rotated token on their next attempt and // skip burning their stale credential. @@ -346,6 +423,177 @@ mod tests { ); } + /// A refresh that returns another workspace's token must be refused before + /// anything is saved: the profile's own session has to survive intact. The + /// issuer did not rotate the credential here, so the saved one is still good. + #[tokio::test] + async fn a_refreshed_token_for_another_workspace_is_refused_and_not_saved() { + let mut mocks = MockSet::new(); + mocks.mock(|when, then| { + when.post().path("/oauth/token"); + then.json(serde_json::json!({ + "access_token": crate::test_support::jwt_with_workspace("AAAAAAAAAAAAAAAA"), + "token_type": "Bearer", + "expires_in": 3600, + "refresh_token": "matching-refresh" + })); + }); + let server = start_server(mocks).await; + let dir = tempfile::tempdir().unwrap(); + + let disk = token_on_disk("own-access", "matching-refresh"); + let refresher = refresher_with_disk_token(&dir, server.url(""), disk) + .pinned_to(Some(WorkspaceId::try_from(WORKSPACE_ID).unwrap())); + + let err = refresher + .refresh(&SecretToken::new("matching-refresh")) + .await + .unwrap_err(); + assert!( + matches!(err, AuthError::WorkspaceMismatch(_)), + "a token for another workspace must be refused, got {err:?}" + ); + + let on_disk: Token = ProfileStore::new(dir.path()) + .workspace_store(WORKSPACE_ID) + .unwrap() + .load_profile() + .unwrap(); + assert_eq!( + on_disk.access_token().as_str(), + "own-access", + "the saved session must not be overwritten by the rejected token" + ); + assert_eq!( + on_disk.refresh_token().unwrap().as_str(), + "matching-refresh", + "the saved refresh token must be untouched" + ); + } + + /// The issuer rotated the credential and returned another workspace's + /// token. The saved credential is spent, so neither a retry on this + /// refresher nor a reopened profile may replay it: the issuer must see + /// exactly one exchange and every retry must ask for a new sign-in. + #[tokio::test] + async fn a_rotated_credential_with_a_wrong_workspace_token_is_not_replayed() { + use std::sync::atomic::{AtomicUsize, Ordering}; + use std::sync::Arc; + + let counter = Arc::new(AtomicUsize::new(0)); + let counter_clone = Arc::clone(&counter); + let wrong_token = crate::test_support::jwt_with_workspace("AAAAAAAAAAAAAAAA"); + let app = axum::Router::new().route( + "/oauth/token", + axum::routing::post(move || { + let counter = Arc::clone(&counter_clone); + let wrong_token = wrong_token.clone(); + async move { + counter.fetch_add(1, Ordering::SeqCst); + axum::Json(serde_json::json!({ + "access_token": wrong_token, + "token_type": "Bearer", + "expires_in": 3600, + "refresh_token": "rotated-refresh" + })) + } + }), + ); + let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + let addr = listener.local_addr().unwrap(); + tokio::spawn(async move { + axum::serve(listener, app).await.unwrap(); + }); + let base_url = Url::parse(&format!("http://{addr}")).unwrap(); + + let dir = tempfile::tempdir().unwrap(); + let refresher = + refresher_with_disk_token(&dir, base_url, token_on_disk("own-access", "spent-refresh")) + .pinned_to(Some(WorkspaceId::try_from(WORKSPACE_ID).unwrap())); + let credential = SecretToken::new("spent-refresh"); + + let first = refresher.refresh(&credential).await.unwrap_err(); + assert!( + matches!(first, AuthError::WorkspaceMismatch(_)), + "the rejected exchange reports the mismatch, got {first:?}" + ); + + // Retry on the same refresher: no second exchange. + let retry = refresher.refresh(&credential).await.unwrap_err(); + assert!( + matches!(retry, AuthError::NotAuthenticated(_)), + "a retry must ask for a new sign-in, got {retry:?}" + ); + + // Reopen the profile: the spent session is gone. + let reopened = ProfileStore::new(dir.path()) + .workspace_store(WORKSPACE_ID) + .unwrap() + .load_profile::(); + assert!( + reopened.is_err(), + "the spent session must not be loadable again" + ); + + assert_eq!( + counter.load(Ordering::SeqCst), + 1, + "the issuer must see exactly one exchange" + ); + } + + /// If the spent session cannot be removed, the caller must hear that, not + /// only the mismatch: the credential is still on disk to be replayed. + #[cfg(unix)] + #[tokio::test] + async fn a_spent_session_that_cannot_be_cleared_is_reported() { + let mut mocks = MockSet::new(); + mocks.mock(|when, then| { + when.post().path("/oauth/token"); + then.json(serde_json::json!({ + "access_token": crate::test_support::jwt_with_workspace("AAAAAAAAAAAAAAAA"), + "token_type": "Bearer", + "expires_in": 3600, + "refresh_token": "rotated-refresh" + })); + }); + let server = start_server(mocks).await; + let dir = tempfile::tempdir().unwrap(); + let refresher = refresher_with_disk_token( + &dir, + server.url(""), + token_on_disk("own-access", "spent-refresh"), + ) + .pinned_to(Some(WorkspaceId::try_from(WORKSPACE_ID).unwrap())); + + // A directory where the profile file should be: unlink fails. + fn find(dir: &std::path::Path) -> Option { + for entry in std::fs::read_dir(dir).ok()? { + let path = entry.ok()?.path(); + if path.is_dir() { + if let Some(found) = find(&path) { + return Some(found); + } + } else if path.file_name().is_some_and(|n| n == Token::FILENAME) { + return Some(path); + } + } + None + } + let profile = find(dir.path()).expect("the saved profile"); + std::fs::remove_file(&profile).unwrap(); + std::fs::create_dir(&profile).unwrap(); + + let err = refresher + .refresh(&SecretToken::new("spent-refresh")) + .await + .unwrap_err(); + assert!( + !matches!(err, AuthError::WorkspaceMismatch(_)), + "the clear failure must surface, got {err:?}" + ); + } + /// The refresh response does not echo the device instance (CIP-2793), so /// a device-bound refresher re-attaches it: the next refresh has to /// present the same instance, and it reads it from this token. diff --git a/packages/stack-auth/src/device_session_strategy.rs b/packages/stack-auth/src/device_session_strategy.rs index 8596da179c..eee2704a7e 100644 --- a/packages/stack-auth/src/device_session_strategy.rs +++ b/packages/stack-auth/src/device_session_strategy.rs @@ -1,10 +1,10 @@ -use cts_common::{Crn, CtsServiceDiscovery, Region, ServiceDiscovery}; +use cts_common::{Crn, CtsServiceDiscovery, Region, ServiceDiscovery, WorkspaceId}; use tracing::warn; use stack_profile::ProfileStore; use crate::auto_refresh::AutoRefresh; -use crate::device_session_refresher::DeviceSessionRefresher; +use crate::device_session_refresher::{ensure_workspace, DeviceSessionRefresher}; use crate::transport::{self, SharedTransport}; use crate::{ensure_trailing_slash, AuthError, AuthStrategy, HttpTransport, ServiceToken, Token}; @@ -35,6 +35,8 @@ use crate::{ensure_trailing_slash, AuthError, AuthStrategy, HttpTransport, Servi /// ``` pub struct DeviceSessionStrategy { crn: Option, + /// When set, every token is checked against this workspace. + expected_workspace: Option, inner: AutoRefresh, } @@ -56,6 +58,7 @@ impl DeviceSessionStrategy { }, base_url_override: None, transport: None, + expected_workspace: None, } } @@ -72,6 +75,7 @@ impl DeviceSessionStrategy { source: OAuthTokenSource::Store(store), base_url_override: None, transport: None, + expected_workspace: None, } } @@ -85,6 +89,7 @@ impl DeviceSessionStrategy { source: OAuthTokenSource::WorkspaceStore(store), base_url_override: None, transport: None, + expected_workspace: None, } } @@ -96,7 +101,11 @@ impl DeviceSessionStrategy { impl AuthStrategy for &DeviceSessionStrategy { async fn get_token(self) -> Result { - Ok(self.inner.get_token().await?) + let token = self.inner.get_token().await?; + match self.expected_workspace { + Some(expected) => token.verify_workspace(expected), + None => Ok(token), + } } } @@ -120,9 +129,27 @@ pub struct DeviceSessionStrategyBuilder { source: OAuthTokenSource, base_url_override: Option, transport: Option, + expected_workspace: Option, } impl DeviceSessionStrategyBuilder { + /// Pin the strategy to the workspace named by `crn`. + /// + /// Every token returned by `get_token` is checked against the CRN's + /// workspace, failing with [`AuthError::WorkspaceMismatch`] if it belongs + /// to another one — as [`AccessKeyStrategy`](crate::AccessKeyStrategy) + /// does. Only the workspace ID is compared, not the region. + /// + /// For a strategy built with [`with_profile`](DeviceSessionStrategy::with_profile), + /// the token is also loaded from that workspace's directory rather than + /// from the store's *current* workspace, so a CLI user who has switched + /// workspaces does not change which one this process uses. The other + /// sources are already a specific workspace's, so the pin only verifies. + pub fn workspace_crn(mut self, crn: &Crn) -> Self { + self.expected_workspace = Some(crn.workspace_id); + self + } + /// Send this strategy's requests through `transport` instead of the /// bundled `reqwest` client. /// @@ -168,6 +195,7 @@ impl DeviceSessionStrategyBuilder { source, base_url_override, transport, + expected_workspace, } = self; let transport = transport::resolve(transport)?; match source { @@ -175,14 +203,32 @@ impl DeviceSessionStrategyBuilder { region, client_id, token, - } => Self::build_from_token(region, client_id, token, base_url_override, transport), + } => Self::build_from_token( + region, + client_id, + token, + base_url_override, + transport, + expected_workspace, + ), OAuthTokenSource::Store(store) => { - let ws_store = store.current_workspace_store()?; - Self::build_from_workspace_store(ws_store, base_url_override, transport) - } - OAuthTokenSource::WorkspaceStore(store) => { - Self::build_from_workspace_store(store, base_url_override, transport) + let ws_store = match expected_workspace { + Some(ws) => store.workspace_store(ws.as_str())?, + None => store.current_workspace_store()?, + }; + Self::build_from_workspace_store( + ws_store, + base_url_override, + transport, + expected_workspace, + ) } + OAuthTokenSource::WorkspaceStore(store) => Self::build_from_workspace_store( + store, + base_url_override, + transport, + expected_workspace, + ), } } @@ -193,6 +239,7 @@ impl DeviceSessionStrategyBuilder { mut token: Token, base_url_override: Option, transport: SharedTransport, + expected_workspace: Option, ) -> Result { let base_url = match base_url_override { Some(url) => url, @@ -211,6 +258,7 @@ impl DeviceSessionStrategyBuilder { e }) .ok(); + ensure_workspace(&token, expected_workspace)?; let region_id = region.identifier(); let device_instance_id = token.device_instance_id().map(String::from); token.set_region(®ion_id); @@ -222,9 +270,11 @@ impl DeviceSessionStrategyBuilder { ®ion_id, device_instance_id, transport, - ); + ) + .pinned_to(expected_workspace); Ok(DeviceSessionStrategy { crn, + expected_workspace, inner: AutoRefresh::with_token(refresher, token), }) } @@ -234,8 +284,12 @@ impl DeviceSessionStrategyBuilder { ws_store: ProfileStore, base_url_override: Option, transport: SharedTransport, + expected_workspace: Option, ) -> Result { let token: Token = ws_store.load_profile()?; + // Before `AutoRefresh` can see it: refreshing another workspace's + // session would consume that session's refresh credential. + ensure_workspace(&token, expected_workspace)?; let region_str = token .region() @@ -266,9 +320,11 @@ impl DeviceSessionStrategyBuilder { ®ion_str, device_instance_id, transport, - ); + ) + .pinned_to(expected_workspace); Ok(DeviceSessionStrategy { crn, + expected_workspace, inner: AutoRefresh::with_token(refresher, token), }) } @@ -324,4 +380,49 @@ mod tests { "CRN should be None when the token has no decodable workspace claim" ); } + + /// A session for another workspace is refused when the strategy is built, + /// before `AutoRefresh` exists: a near-expiry one would otherwise be + /// refreshed on the first `get_token`, consuming a credential that + /// belongs to someone else. + #[test] + fn build_rejects_a_session_from_another_workspace() { + let region = Region::aws("ap-southeast-2").expect("valid region"); + let token = jwt_token(claims_with_workspace("7366ITCXSAPCH5TN")); + let other: Crn = "crn:ap-southeast-2.aws:ZVATKW3VHMFG27DY" + .parse() + .expect("valid crn"); + + // The base URL is unreachable: nothing may be sent. + let result = DeviceSessionStrategy::with_token(region, "my-client", token) + .base_url(base_url()) + .workspace_crn(&other) + .build(); + + assert!( + matches!(result, Err(AuthError::WorkspaceMismatch(_))), + "a session for another workspace must be refused at build, got {:?}", + result.err() + ); + } + + #[tokio::test] + async fn get_token_accepts_a_token_from_the_pinned_workspace() { + let region = Region::aws("ap-southeast-2").expect("valid region"); + let token = jwt_token(claims_with_workspace("7366ITCXSAPCH5TN")); + let same: Crn = "crn:ap-southeast-2.aws:7366ITCXSAPCH5TN" + .parse() + .expect("valid crn"); + + let strategy = DeviceSessionStrategy::with_token(region, "my-client", token) + .base_url(base_url()) + .workspace_crn(&same) + .build() + .expect("build should succeed"); + + (&strategy) + .get_token() + .await + .expect("matching workspace should pass"); + } } diff --git a/packages/stack-auth/src/token.rs b/packages/stack-auth/src/token.rs index a66d10499c..02f98b5f8a 100644 --- a/packages/stack-auth/src/token.rs +++ b/packages/stack-auth/src/token.rs @@ -17,6 +17,29 @@ impl stack_profile::ProfileData for Token { /// callers can still use the current token. const EXPIRY_LEEWAY_SECS: u64 = 90; +/// The longest token lifetime this crate accepts from a server, in seconds +/// (30 days). +/// +/// `expires_in` is server-supplied. A larger value is clamped to this rather +/// than trusted: a token that claims to outlive it is refreshed early, which +/// is safe, whereas an unbounded value would overflow `now + expires_in` +/// (see [`expires_at_after`]). +pub(crate) const MAX_TOKEN_LIFETIME_SECS: u64 = 30 * 24 * 60 * 60; + +/// The absolute expiry (seconds since the Unix epoch) of a token issued at +/// `now` with a server-supplied lifetime of `expires_in` seconds. +/// +/// Every place that turns an OAuth `expires_in` into a [`Token::expires_at`] +/// goes through here. The lifetime is clamped to [`MAX_TOKEN_LIFETIME_SECS`] +/// and the addition saturates, so a buggy or hostile server cannot make it +/// panic (debug builds) or wrap to an already-expired timestamp and send the +/// caller into a refresh loop (release builds, which carry no +/// `overflow-checks`). This is the same rule [`Token::is_expired_at`] +/// follows for its leeway. +pub(crate) fn expires_at_after(now: u64, expires_in: u64) -> u64 { + now.saturating_add(expires_in.min(MAX_TOKEN_LIFETIME_SECS)) +} + /// The current Unix time in whole seconds, from the system wall clock. /// /// Delegates to [`SystemClock`](crate::clock::SystemClock) so the crate has a @@ -329,7 +352,7 @@ impl Token { Ok(Token { access_token: token_resp.access_token, token_type: token_resp.token_type, - expires_at: now_unix_secs() + token_resp.expires_in, + expires_at: expires_at_after(now_unix_secs(), token_resp.expires_in), refresh_token: token_resp.refresh_token, region: None, client_id: None, @@ -477,6 +500,39 @@ mod tests { ); } + // ---- expires_at_after ---- + + #[test] + fn expires_at_after_passes_an_ordinary_lifetime_through() { + assert_eq!(expires_at_after(1_000, 3_600), 4_600); + } + + #[test] + fn the_token_lifetime_cap_is_thirty_days() { + assert_eq!(MAX_TOKEN_LIFETIME_SECS, 2_592_000); + } + + #[test] + fn expires_at_after_clamps_an_oversized_lifetime() { + assert_eq!( + expires_at_after(1_000, u64::MAX), + 1_000 + MAX_TOKEN_LIFETIME_SECS, + "a server-supplied lifetime past the cap must be clamped, not trusted" + ); + assert_eq!( + expires_at_after(1_000, MAX_TOKEN_LIFETIME_SECS), + 1_000 + MAX_TOKEN_LIFETIME_SECS, + "the cap itself is accepted as-is" + ); + } + + #[test] + fn expires_at_after_saturates_instead_of_wrapping() { + // A wrapped sum would be a timestamp in the past: an already-expired + // token, and so a refresh loop. + assert_eq!(expires_at_after(u64::MAX - 10, 3_600), u64::MAX); + } + // ---- refresh() tests ---- // // Grouped under one feature gate rather than one per item: every helper @@ -536,6 +592,37 @@ mod tests { assert!((3598..=3600).contains(&refreshed.expires_in())); } + #[tokio::test] + async fn test_refresh_clamps_an_oversized_expires_in() { + let mut mocks = MockSet::new(); + mocks.mock(|when, then| { + when.post().path("/oauth/token"); + then.json(serde_json::json!({ + "access_token": "new-access-token", + "token_type": "Bearer", + "expires_in": u64::MAX, + })); + }); + let server = start_server(mocks).await; + let base_url = server.url(""); + + let refresh_token = SecretToken::new("test-refresh-token"); + let refreshed = Token::refresh(&refresh_token, &base_url, "cli", None) + .await + .expect("an oversized expires_in must not fail or panic the refresh"); + + assert!( + !refreshed.is_expired(), + "the token must not wrap to an already-expired timestamp" + ); + assert!( + (MAX_TOKEN_LIFETIME_SECS - 2..=MAX_TOKEN_LIFETIME_SECS) + .contains(&refreshed.expires_in()), + "lifetime should be clamped to MAX_TOKEN_LIFETIME_SECS; got {}", + refreshed.expires_in() + ); + } + #[tokio::test] async fn test_refresh_invalid_grant() { let mut mocks = MockSet::new(); diff --git a/packages/stack-encrypt/fuzz/Cargo.lock b/packages/stack-encrypt/fuzz/Cargo.lock index 9254732a44..62738e9405 100644 --- a/packages/stack-encrypt/fuzz/Cargo.lock +++ b/packages/stack-encrypt/fuzz/Cargo.lock @@ -1465,9 +1465,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open" -version = "5.4.4" +version = "5.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa576c76302b7b808eecc68061e67336c47833ef9d22caa74dda10fa9675eebc" +checksum = "8d8c8b8e725ad26404d6896eb2f064294a0a7b4f1d9120210d85544684c4ca95" dependencies = [ "is-wsl", "libc", @@ -2165,6 +2165,7 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "uuid", + "zeroize", ] [[package]] @@ -2529,9 +2530,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" +checksum = "4a0e2d11620c50695fe12bbbfde96b3477fe606e7284c22d505c12ce51214514" dependencies = [ "atomic", "getrandom 0.4.2", diff --git a/packages/stack-encrypt/src/cipher.rs b/packages/stack-encrypt/src/cipher.rs index 197a451b63..10630396ed 100644 --- a/packages/stack-encrypt/src/cipher.rs +++ b/packages/stack-encrypt/src/cipher.rs @@ -820,15 +820,25 @@ async fn load_default_keyset(kms: &K) -> Result FallbackKeyProvider { + // An unparseable CRN is left for `AutoStrategy` to report; here it just + // means no workspace pin. + let workspace = std::env::var("CS_WORKSPACE_CRN") + .ok() + .and_then(|crn| crn.parse::().ok()) + .map(|crn| crn.workspace_id.to_string()); FallbackKeyProvider::new( EnvKeyProvider, - ProfileClientKey(ProfileStore::resolve(None).ok()), + ProfileClientKey { + store: ProfileStore::resolve(None).ok(), + workspace, + }, ) } @@ -842,14 +852,33 @@ fn client_key_provider() -> EnvKeyProvider { /// directory so the "not configured" message can say what to do about it /// rather than only that `CS_CLIENT_ID` is unset. #[cfg(all(feature = "http", not(target_arch = "wasm32")))] -struct ProfileClientKey(Option); +struct ProfileClientKey { + store: Option, + /// The workspace to read `secretkey.json` from, so the client key and the + /// access token come from the same one. `None` means the CLI's current. + workspace: Option, +} #[cfg(all(feature = "http", not(target_arch = "wasm32")))] impl KeyProvider for ProfileClientKey { async fn client_key(&self) -> Result { - match &self.0 { - Some(store) => store.client_key().await, - None => Err(KeyProviderError::NotConfigured( + match (&self.store, &self.workspace) { + (Some(store), Some(workspace)) => { + let ws_store = store + .workspace_store(workspace) + .map_err(|e| KeyProviderError::LoadError(e.to_string()))?; + if !ws_store.exists_profile::() { + return Err(KeyProviderError::NotConfigured(format!( + "no client key for workspace {workspace}: set CS_CLIENT_ID / CS_CLIENT_KEY, or run `npx stash auth login` for that workspace" + ))); + } + let secret_key: stack_kms::SecretKey = ws_store + .load_profile() + .map_err(|e| KeyProviderError::LoadError(e.to_string()))?; + secret_key.client_key().await + } + (Some(store), None) => store.client_key().await, + (None, _) => Err(KeyProviderError::NotConfigured( "no client key: set CS_CLIENT_ID / CS_CLIENT_KEY, or run `npx stash auth login`" .into(), )), @@ -959,9 +988,9 @@ impl StackCipherBuilder { /// /// 1. the environment (`CS_CLIENT_ACCESS_KEY` + `CS_WORKSPACE_CRN`; /// `CS_CLIENT_ID` + `CS_CLIENT_KEY`), then - /// 2. the current workspace in the CLI's profile directory - /// (`auth.json`; `secretkey.json`), which `npx stash auth login` - /// writes. + /// 2. the CLI's profile directory (`auth.json`; `secretkey.json`), which + /// `npx stash auth login` writes: the workspace `CS_WORKSPACE_CRN` + /// names if it is set (for both files), otherwise the current one. /// /// So on a developer machine, logging in with the CLI is sufficient; in /// CI, the four variables are. @@ -1775,6 +1804,84 @@ fn opened_error(error: DecryptError) -> Error { } } +#[cfg(all(test, feature = "http", not(target_arch = "wasm32")))] +mod profile_client_key_tests { + use super::*; + + const CURRENT: &str = "ZVATKW3VHMFG27DY"; + const PINNED: &str = "AAAAAAAAAAAAAAAA"; + + /// A temporary profile directory, removed when dropped. + struct TempDir(std::path::PathBuf); + + impl Drop for TempDir { + fn drop(&mut self) { + let _ = std::fs::remove_dir_all(&self.0); + } + } + + /// A profile directory whose *current* workspace has a (not usable as a + /// ZeroKMS key, but present) client key and whose pinned one has none. + fn store_with_key_in_current_workspace() -> (TempDir, ProfileStore) { + let dir = TempDir(std::env::temp_dir().join(format!("stack-encrypt-{}", Uuid::new_v4()))); + let store = ProfileStore::new(&dir.0); + store.init_workspace(PINNED).unwrap(); + store.init_workspace(CURRENT).unwrap(); // now current + let key = + stack_kms::SecretKey::from_hex(Uuid::new_v4().to_string(), "00".repeat(32)).unwrap(); + store + .current_workspace_store() + .unwrap() + .save_profile(&key) + .unwrap(); + (dir, store) + } + + #[test] + fn the_temp_profile_directory_is_removed_when_dropped() { + let (dir, _store) = store_with_key_in_current_workspace(); + let path = dir.0.clone(); + assert!(path.exists()); + + drop(dir); + + assert!(!path.exists(), "temp profile directory was left behind"); + } + + #[tokio::test] + async fn a_pinned_workspace_never_borrows_the_current_workspaces_client_key() { + let (_dir, store) = store_with_key_in_current_workspace(); + let provider = ProfileClientKey { + store: Some(store), + workspace: Some(PINNED.to_string()), + }; + + let err = provider.client_key().await.map(|_| ()).unwrap_err(); + + assert!( + matches!(err, KeyProviderError::NotConfigured(_)), + "expected NotConfigured for the pinned workspace, got {err:?}" + ); + } + + #[tokio::test] + async fn without_a_pin_the_current_workspaces_client_key_is_used() { + let (_dir, store) = store_with_key_in_current_workspace(); + let provider = ProfileClientKey { + store: Some(store), + workspace: None, + }; + + // The key is found (so not `NotConfigured`); it is just not a real one. + let err = provider.client_key().await.map(|_| ()).unwrap_err(); + + assert!( + !matches!(err, KeyProviderError::NotConfigured(_)), + "the current workspace's key should have been found, got {err:?}" + ); + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/packages/stack-kms/fuzz/Cargo.lock b/packages/stack-kms/fuzz/Cargo.lock index 3c94ab85ee..72a47d8baf 100644 --- a/packages/stack-kms/fuzz/Cargo.lock +++ b/packages/stack-kms/fuzz/Cargo.lock @@ -2018,6 +2018,7 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "uuid", + "zeroize", ] [[package]] diff --git a/packages/stack-profile/Cargo.toml b/packages/stack-profile/Cargo.toml index dcd9f73e59..8548f7c38f 100644 --- a/packages/stack-profile/Cargo.toml +++ b/packages/stack-profile/Cargo.toml @@ -17,6 +17,9 @@ serde = { workspace = true } serde_json = { workspace = true } thiserror = { workspace = true } uuid = { workspace = true } +# auth.json and secretkey.json hold bearer tokens and keys: the JSON buffers +# that carry them to and from disk are wiped (see `secret_buf`). +zeroize = { workspace = true } # The default device name is the hostname, which only the creating half of # `DeviceIdentity` needs — and that half is native-only: the crate builds for diff --git a/packages/stack-profile/src/lib.rs b/packages/stack-profile/src/lib.rs index 1455102f45..bbf6c98d5a 100644 --- a/packages/stack-profile/src/lib.rs +++ b/packages/stack-profile/src/lib.rs @@ -66,6 +66,7 @@ mod device_identity; pub mod diagnostic; mod error; mod profile_store; +mod secret_buf; pub use device_identity::DeviceIdentity; pub use diagnostic::ErrorPayload; diff --git a/packages/stack-profile/src/profile_store.rs b/packages/stack-profile/src/profile_store.rs index f32b47be9f..9ea23583df 100644 --- a/packages/stack-profile/src/profile_store.rs +++ b/packages/stack-profile/src/profile_store.rs @@ -3,6 +3,7 @@ use std::path::{Path, PathBuf}; use serde::de::DeserializeOwned; use serde::Serialize; +use crate::secret_buf::SecretBuf; use crate::{ProfileData, ProfileError}; const CS_CONFIG_PATH_ENV: &str = "CS_CONFIG_PATH"; @@ -291,8 +292,12 @@ impl ProfileStore { Self::validate_filename(filename)?; std::fs::create_dir_all(&self.dir)?; let path = self.dir.join(filename); - let json = serde_json::to_string_pretty(value)?; - Self::write_to_path(&path, &json, _mode) + // The serialised form of a profile can carry secrets (`auth.json`'s + // tokens, `secretkey.json`'s key), so it is built in a buffer that is + // wiped on drop and on every reallocation, never in a plain `String`. + let mut json = SecretBuf::new(); + serde_json::to_writer_pretty(&mut json, value)?; + Self::write_to_path(&path, json.as_bytes(), _mode) } /// Atomically write JSON content to an absolute path, optionally setting @@ -324,7 +329,7 @@ impl ProfileStore { /// processes won't trip this — but to defend against third-party /// readers we retry the rename a handful of times with brief backoff /// before giving up. - fn write_to_path(path: &Path, json: &str, _mode: Option) -> Result<(), ProfileError> { + fn write_to_path(path: &Path, json: &[u8], _mode: Option) -> Result<(), ProfileError> { use std::io::Write; let parent = path.parent().ok_or_else(|| { @@ -363,7 +368,7 @@ impl ProfileStore { } opts.open(&tmp_path)? }; - file.write_all(json.as_bytes())?; + file.write_all(json)?; file.sync_all()?; drop(file); @@ -451,9 +456,28 @@ impl ProfileStore { pub fn load(&self, filename: &str) -> Result { Self::validate_filename(filename)?; let path = self.dir.join(filename); - match std::fs::read_to_string(&path) { + // Read into a buffer wiped on drop and on growth: the file may hold + // secrets (see `write`). `fs::read` would not do: it reallocates, and + // frees an unwiped copy, whenever the file's metadata under-reports + // its length. + // + // serde_json still decodes a string containing escape sequences + // through a scratch buffer of its own, which it does not wipe. Tokens + // and keys are base64 or JWTs, which need no escaping, so that path + // is not taken for them. + match std::fs::File::open(&path).and_then(SecretBuf::read_from) { Ok(contents) => { - let value: T = serde_json::from_str(&contents)?; + // Validate the whole file as UTF-8 first, as `read_to_string` + // did: `from_slice` skips the bytes of fields it ignores, so + // it would accept invalid UTF-8 in an unknown field. This + // borrows the buffer, so it makes no copy. + let text = std::str::from_utf8(contents.as_bytes()).map_err(|_| { + ProfileError::Io(std::io::Error::new( + std::io::ErrorKind::InvalidData, + "profile file is not valid UTF-8", + )) + })?; + let value: T = serde_json::from_str(text)?; Ok(value) } Err(e) if e.kind() == std::io::ErrorKind::NotFound => { @@ -621,6 +645,32 @@ mod tests { assert!(matches!(err, ProfileError::NotFound { .. })); } + fn assert_invalid_utf8_is_an_io_error(contents: &[u8]) { + let dir = tempfile::tempdir().unwrap(); + let store = ProfileStore::new(dir.path()); + std::fs::write(dir.path().join("data.json"), contents).unwrap(); + + let err = store.load::("data.json").unwrap_err(); + assert!( + matches!(&err, ProfileError::Io(e) if e.kind() == std::io::ErrorKind::InvalidData), + "a non-UTF-8 file should be an InvalidData I/O error, as before; got {err:?}" + ); + } + + #[test] + fn load_rejects_invalid_utf8_in_a_known_field() { + assert_invalid_utf8_is_an_io_error(b"{\"name\": \"\xff\", \"value\": 1}"); + } + + #[test] + fn load_rejects_invalid_utf8_in_an_unknown_field() { + // serde_json skips an ignored field's bytes without validating them, + // so this file would load if UTF-8 were left to the parser. + assert_invalid_utf8_is_an_io_error( + b"{\"name\": \"ok\", \"value\": 1, \"extra\": \"\xff\"}", + ); + } + #[test] fn clear_removes_existing_file() { let dir = tempfile::tempdir().unwrap(); diff --git a/packages/stack-profile/src/secret_buf.rs b/packages/stack-profile/src/secret_buf.rs new file mode 100644 index 0000000000..cce52a53f5 --- /dev/null +++ b/packages/stack-profile/src/secret_buf.rs @@ -0,0 +1,272 @@ +//! A byte buffer for secrets that is wiped on drop and whenever it grows. + +use std::io::Read; + +use zeroize::Zeroizing; + +/// The capacity a [`SecretBuf`] starts with. Profile files are small (a token +/// file is well under 4 KiB), so most buffers never grow. +const INITIAL_CAPACITY: usize = 4096; + +/// How much room [`SecretBuf::read_from`] makes when it grows the buffer. +const READ_CHUNK: usize = 4096; + +/// The least spare room [`SecretBuf::read_from`] reads into before it grows +/// the buffer. A file that fits in the initial capacity with this much to +/// spare is read, end-of-file probe included, without growing. +const MIN_READ_SPARE: usize = 512; + +/// A byte buffer that is zeroized when dropped, including every allocation it +/// outgrows. +/// +/// Wrapping a `Vec` in [`Zeroizing`] alone is not enough for a buffer +/// that grows: when a `Vec` reallocates, it frees the old allocation without +/// wiping it, leaving a copy of the bytes so far on the heap. `SecretBuf` +/// never lets its `Vec` reallocate itself. When it needs more room it +/// allocates a larger buffer, copies the contents across, and drops the old +/// one, which [`Zeroizing`] wipes. Spare capacity is wiped too, since +/// `Vec`'s `Zeroize` covers the whole allocation. +/// +/// Writing to it ([`io::Write`](std::io::Write)) and reading into it +/// ([`read_from`](Self::read_from)) both write straight into the buffer, so +/// no intermediate copy of the bytes is left behind. +pub(crate) struct SecretBuf(Zeroizing>); + +impl SecretBuf { + pub(crate) fn new() -> Self { + Self::with_capacity(INITIAL_CAPACITY) + } + + fn with_capacity(capacity: usize) -> Self { + Self(Zeroizing::new(Vec::with_capacity(capacity))) + } + + /// Read `reader` to its end. + /// + /// Unlike [`Read::read_to_end`], this does not depend on a correct size + /// hint to avoid reallocating, and reads through no unwiped scratch + /// buffer: a file whose metadata under-reports its length (as some + /// network and FUSE filesystems do) still leaves no copy behind. + pub(crate) fn read_from(mut reader: impl Read) -> std::io::Result { + let mut buf = Self::new(); + loop { + if buf.0.capacity() - buf.0.len() < MIN_READ_SPARE { + buf.reserve(READ_CHUNK)?; + } + let filled = buf.0.len(); + // At most one chunk, so each read zero-fills a bounded window + // rather than the whole spare tail; and never past the + // capacity, so this does not reallocate. + let window_end = buf.0.capacity().min(filled + READ_CHUNK); + buf.0.resize(window_end, 0); + let result = reader.read(&mut buf.0[filled..]); + buf.0.truncate(filled + *result.as_ref().unwrap_or(&0)); + match result { + Ok(0) => return Ok(buf), + Ok(_) => {} + Err(e) if e.kind() == std::io::ErrorKind::Interrupted => {} + Err(e) => return Err(e), + } + } + } + + /// The bytes held so far. + pub(crate) fn as_bytes(&self) -> &[u8] { + &self.0 + } + + /// Make room for `additional` more bytes without letting the `Vec` + /// reallocate in place. + fn reserve(&mut self, additional: usize) -> std::io::Result<()> { + let needed = self + .0 + .len() + .checked_add(additional) + .ok_or(std::io::ErrorKind::OutOfMemory)?; + if needed <= self.0.capacity() { + return Ok(()); + } + let capacity = needed.max(self.0.capacity().saturating_mul(2)); + // `try_reserve_exact`, not `Vec::with_capacity`: an oversized input + // must come back as an error, not abort the process. + let mut grown = Zeroizing::new(Vec::new()); + grown + .try_reserve_exact(capacity) + .map_err(|_| std::io::ErrorKind::OutOfMemory)?; + grown.extend_from_slice(&self.0); + // The old buffer is dropped here, and `Zeroizing` wipes it. + self.0 = grown; + Ok(()) + } +} + +impl std::io::Write for SecretBuf { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + self.reserve(buf.len())?; + self.0.extend_from_slice(buf); + Ok(buf.len()) + } + + fn flush(&mut self) -> std::io::Result<()> { + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use std::io::Write; + + use super::*; + + /// Yields its bytes a few at a time, with an `Interrupted` in between, + /// the way a slow or signalled file read can. + struct Trickle { + bytes: Vec, + pos: usize, + interrupt_next: bool, + } + + impl Read for Trickle { + fn read(&mut self, out: &mut [u8]) -> std::io::Result { + self.interrupt_next = !self.interrupt_next; + if self.interrupt_next { + return Err(std::io::ErrorKind::Interrupted.into()); + } + let n = out.len().min(3).min(self.bytes.len() - self.pos); + out[..n].copy_from_slice(&self.bytes[self.pos..self.pos + n]); + self.pos += n; + Ok(n) + } + } + + struct Failing; + + impl Read for Failing { + fn read(&mut self, _: &mut [u8]) -> std::io::Result { + Err(std::io::ErrorKind::PermissionDenied.into()) + } + } + + fn payload(len: usize) -> Vec { + (0..=255).cycle().take(len).collect() + } + + #[test] + fn writes_hold_exactly_what_was_written() { + let mut buf = SecretBuf::new(); + buf.write_all(b"hello, ").unwrap(); + buf.write_all(b"world").unwrap(); + assert_eq!(buf.as_bytes(), b"hello, world"); + } + + #[test] + fn writes_grow_past_the_capacity_without_losing_bytes() { + let mut buf = SecretBuf::with_capacity(4); + let payload = payload(10_000); + for chunk in payload.chunks(7) { + buf.write_all(chunk).unwrap(); + } + assert_eq!(buf.as_bytes(), payload.as_slice()); + } + + #[test] + fn writes_match_serde_json_pretty_output() { + let value = serde_json::json!({ "access_token": "secret", "expires_at": 1 }); + let mut buf = SecretBuf::with_capacity(1); + serde_json::to_writer_pretty(&mut buf, &value).unwrap(); + assert_eq!( + buf.as_bytes(), + serde_json::to_string_pretty(&value).unwrap().as_bytes() + ); + } + + #[test] + fn read_from_reads_everything_across_many_growths() { + let payload = payload(3 * INITIAL_CAPACITY + 17); + let buf = SecretBuf::read_from(payload.as_slice()).unwrap(); + assert_eq!(buf.as_bytes(), payload.as_slice()); + } + + #[test] + fn read_from_does_not_grow_for_a_file_that_fits() { + let payload = payload(2_000); + let buf = SecretBuf::read_from(payload.as_slice()).unwrap(); + assert_eq!(buf.as_bytes(), payload.as_slice()); + assert_eq!( + buf.0.capacity(), + INITIAL_CAPACITY, + "a profile-sized file should be read without growing the buffer" + ); + } + + #[test] + fn reserve_returns_an_error_instead_of_aborting() { + let mut buf = SecretBuf::with_capacity(1); + buf.write_all(b"x").unwrap(); + let err = buf.reserve(isize::MAX as usize).unwrap_err(); + assert_eq!(err.kind(), std::io::ErrorKind::OutOfMemory); + assert_eq!(buf.as_bytes(), b"x", "a failed reserve keeps the contents"); + } + + /// Records the largest slice it is asked to fill, and fills at most + /// 1 KiB of it, the way a pipe or network filesystem can. + struct ShortReads { + bytes: Vec, + pos: usize, + largest_window: usize, + } + + impl Read for &mut ShortReads { + fn read(&mut self, out: &mut [u8]) -> std::io::Result { + self.largest_window = self.largest_window.max(out.len()); + let n = out.len().min(1024).min(self.bytes.len() - self.pos); + out[..n].copy_from_slice(&self.bytes[self.pos..self.pos + n]); + self.pos += n; + Ok(n) + } + } + + #[test] + fn read_from_zero_fills_at_most_one_chunk_per_read() { + // Each read zero-fills the window it reads into. If the window were + // all the spare capacity, short reads into a large buffer would + // re-zero its whole tail every time: quadratic in the file size. + let payload = payload(64 * 1024); + let mut reader = ShortReads { + bytes: payload.clone(), + pos: 0, + largest_window: 0, + }; + let buf = SecretBuf::read_from(&mut reader).unwrap(); + assert_eq!(buf.as_bytes(), payload.as_slice()); + assert!( + reader.largest_window <= READ_CHUNK, + "each read should fill at most {READ_CHUNK} bytes; one was offered {}", + reader.largest_window + ); + } + + #[test] + fn read_from_reads_an_empty_reader() { + let buf = SecretBuf::read_from(&[][..]).unwrap(); + assert!(buf.as_bytes().is_empty()); + } + + #[test] + fn read_from_retries_interrupted_and_short_reads() { + let payload = payload(50); + let reader = Trickle { + bytes: payload.clone(), + pos: 0, + interrupt_next: false, + }; + let buf = SecretBuf::read_from(reader).unwrap(); + assert_eq!(buf.as_bytes(), payload.as_slice()); + } + + #[test] + fn read_from_returns_a_read_error() { + let err = SecretBuf::read_from(Failing).err().unwrap(); + assert_eq!(err.kind(), std::io::ErrorKind::PermissionDenied); + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b351159084..1956e26fd5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,8 +10,8 @@ catalogs: specifier: 22.20.5 version: 22.20.5 '@vitest/coverage-v8': - specifier: 4.1.11 - version: 4.1.11 + specifier: 4.1.12 + version: 4.1.12 tsup: specifier: 8.5.1 version: 8.5.1 @@ -22,12 +22,12 @@ catalogs: specifier: 5.9.3 version: 5.9.3 vitest: - specifier: 4.1.11 - version: 4.1.11 + specifier: 4.1.12 + version: 4.1.12 security: '@clerk/nextjs': - specifier: 7.9.14 - version: 7.9.14 + specifier: 7.9.23 + version: 7.9.23 next: specifier: 15.5.28 version: 15.5.28 @@ -43,7 +43,7 @@ overrides: brace-expansion@<5.0.12: 5.0.12 js-yaml@<3.15.2: 3.15.2 js-yaml@>=4.0.0 <5: 4.3.2 - fast-uri@<3.1.8: 3.1.8 + fast-uri@<3.1.9: 3.1.9 sharp@<0.35.5: 0.35.5 importers: @@ -51,8 +51,8 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: ^2.5.15 - version: 2.5.15 + specifier: ^2.6.4 + version: 2.6.4 '@changesets/cli': specifier: ^2.31.1 version: 2.31.1(@types/node@22.20.5) @@ -66,14 +66,14 @@ importers: specifier: 4.3.2 version: 4.3.2 rimraf: - specifier: ^6.1.3 - version: 6.1.3 + specifier: ^6.1.4 + version: 6.1.4 turbo: specifier: 2.11.10 version: 2.11.10 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@22.20.5)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@22.20.5)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) e2e: dependencies: @@ -87,9 +87,27 @@ importers: specifier: workspace:* version: link:../languages/typescript/packages/cli devDependencies: + '@cipherstash/protect': + specifier: 10.2.1 + version: 10.2.1 + '@cipherstash/protect-dynamodb': + specifier: 6.0.1 + version: 6.0.1(@cipherstash/protect@10.2.1) + '@cipherstash/stack-0.19': + specifier: npm:@cipherstash/stack@0.19.0 + version: '@cipherstash/stack@0.19.0(@supabase/supabase-js@2.118.0(@opentelemetry/api@1.10.0))(drizzle-orm@0.45.4(@opentelemetry/api@1.10.0)(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9))(next@15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3)' + '@cipherstash/test-kit': + specifier: workspace:* + version: link:../languages/typescript/packages/test-kit '@types/semver': specifier: 7.8.0 version: 7.8.0 + dotenv: + specifier: 17.4.2 + version: 17.4.2 + postgres: + specifier: ^3.4.8 + version: 3.4.9 semver: specifier: ^7.8.0 version: 7.8.5 @@ -98,7 +116,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) yaml: specifier: ^2.9.1 version: 2.9.1 @@ -116,7 +134,7 @@ importers: version: 17.4.2 drizzle-orm: specifier: ^0.45.4 - version: 0.45.4(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) + version: 0.45.4(@opentelemetry/api@1.10.0)(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) pg: specifier: 8.23.1 version: 8.23.1 @@ -160,7 +178,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@22.20.5)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@22.20.5)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/examples/supabase-worker: {} @@ -196,7 +214,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/packages/auth/platforms/darwin-arm64: {} @@ -220,7 +238,7 @@ importers: version: link:../stack-drizzle drizzle-orm: specifier: 0.45.4 - version: 0.45.4(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) + version: 0.45.4(@opentelemetry/api@1.10.0)(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) pg: specifier: ^8.23.1 version: 8.23.1 @@ -242,7 +260,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@22.20.5)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@22.20.5)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/packages/cli: dependencies: @@ -271,8 +289,8 @@ importers: specifier: ^1.1.1 version: 1.1.1 posthog-node: - specifier: ^5.55.2 - version: 5.55.2 + specifier: ^5.61.1 + version: 5.61.1(@opentelemetry/api@1.10.0) zod: specifier: ^3.25.76 version: 3.25.76 @@ -297,7 +315,7 @@ importers: version: 7.2.0 tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) tsx: specifier: catalog:repo version: 4.23.15 @@ -306,7 +324,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) optionalDependencies: '@cipherstash/auth-darwin-arm64': specifier: workspace:* @@ -347,42 +365,42 @@ importers: version: 8.23.1 tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) typescript: specifier: catalog:repo version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/packages/nextjs: dependencies: jose: - specifier: ^6.2.12 - version: 6.2.12 + specifier: ^6.2.14 + version: 6.2.14 devDependencies: '@clerk/nextjs': specifier: catalog:security - version: 7.9.14(next@15.5.28(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 7.9.23(next@15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3) dotenv: specifier: ^17.4.2 version: 17.4.2 next: specifier: catalog:security - version: 15.5.28(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) typescript: specifier: catalog:repo version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) optionalDependencies: '@rollup/rollup-linux-x64-gnu': - specifier: 4.64.5 - version: 4.64.5 + specifier: 4.67.4 + version: 4.67.4 languages/typescript/packages/profile: devDependencies: @@ -394,7 +412,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) optionalDependencies: '@cipherstash/profile-darwin-arm64': specifier: workspace:* @@ -434,8 +452,8 @@ importers: version: 0.2.6 devDependencies: '@biomejs/biome': - specifier: ^2.5.15 - version: 2.5.15 + specifier: ^2.6.4 + version: 2.6.4 '@neon-rs/cli': specifier: ^0.2.6 version: 0.2.6 @@ -450,7 +468,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@22.20.5)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@22.20.5)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) optionalDependencies: '@cipherstash/protect-ffi-darwin-arm64': specifier: workspace:* @@ -491,7 +509,7 @@ importers: version: 8.23.1 '@vitest/coverage-v8': specifier: catalog:repo - version: 4.1.11(vitest@4.1.11) + version: 4.1.12(vitest@4.1.12) dotenv: specifier: 17.4.2 version: 17.4.2 @@ -500,7 +518,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/packages/protect-ffi/platforms/darwin-arm64: {} @@ -527,7 +545,7 @@ importers: version: link:../protect-ffi evlog: specifier: 1.11.0 - version: 1.11.0(next@15.5.28(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3) + version: 1.11.0(next@15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3) uuid: specifier: 14.0.3 version: 14.0.3 @@ -542,14 +560,14 @@ importers: specifier: ^1.8.1 version: 1.8.1 '@clerk/backend': - specifier: 3.26.0 - version: 3.26.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 3.26.5 + version: 3.26.5(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@supabase/postgrest-js': specifier: 2.118.0 version: 2.118.0 '@supabase/supabase-js': specifier: ^2.118.0 - version: 2.118.0 + version: 2.118.0(@opentelemetry/api@1.10.0) '@types/pg': specifier: ^8.23.1 version: 8.23.1 @@ -561,7 +579,7 @@ importers: version: 17.4.2 drizzle-orm: specifier: ^0.45.4 - version: 0.45.4(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) + version: 0.45.4(@opentelemetry/api@1.10.0)(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) execa: specifier: ^9.5.2 version: 9.6.1 @@ -582,7 +600,7 @@ importers: version: 3.4.9 tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) tsx: specifier: catalog:repo version: 4.23.15 @@ -591,7 +609,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) optionalDependencies: '@cipherstash/auth-darwin-arm64': specifier: workspace:* @@ -634,7 +652,7 @@ importers: version: 17.4.2 drizzle-orm: specifier: ^0.45.4 - version: 0.45.4(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) + version: 0.45.4(@opentelemetry/api@1.10.0)(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) fta-cli: specifier: 3.1.0 version: 3.1.0 @@ -643,13 +661,13 @@ importers: version: 3.4.9 tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) typescript: specifier: catalog:repo version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/packages/stack-prisma: dependencies: @@ -669,8 +687,8 @@ importers: specifier: 0.17.0 version: 0.17.0(magicast@0.5.4)(typanion@3.14.0)(typescript@5.9.3)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) arktype: - specifier: ^2.2.8 - version: 2.2.8 + specifier: ^2.2.9 + version: 2.2.9 devDependencies: '@cipherstash/test-kit': specifier: workspace:* @@ -692,13 +710,13 @@ importers: version: 3.4.9 tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) typescript: specifier: catalog:repo version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/packages/stack-supabase: dependencies: @@ -717,7 +735,7 @@ importers: version: 2.118.0 '@supabase/supabase-js': specifier: ^2.118.0 - version: 2.118.0 + version: 2.118.0(@opentelemetry/api@1.10.0) '@types/pg': specifier: ^8.23.1 version: 8.23.1 @@ -738,13 +756,13 @@ importers: version: 3.4.9 tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) typescript: specifier: catalog:repo version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/packages/test-kit: dependencies: @@ -753,23 +771,23 @@ importers: version: link:../stack devDependencies: '@clerk/backend': - specifier: 3.26.0 - version: 3.26.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: 3.26.5 + version: 3.26.5(react-dom@19.2.3(react@19.2.3))(react@19.2.3) typescript: specifier: catalog:repo version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) languages/typescript/packages/wizard: dependencies: '@anthropic-ai/claude-agent-sdk': - specifier: ^0.3.296 - version: 0.3.296(@anthropic-ai/sdk@0.133.0(zod@3.25.76))(@modelcontextprotocol/sdk@1.32.1(zod@3.25.76))(zod@3.25.76) + specifier: ^0.3.316 + version: 0.3.316(@anthropic-ai/sdk@0.137.0(zod@3.25.76))(@modelcontextprotocol/sdk@1.32.2(zod@3.25.76))(zod@3.25.76) '@anthropic-ai/sdk': - specifier: ^0.133.0 - version: 0.133.0(zod@3.25.76) + specifier: ^0.137.0 + version: 0.137.0(zod@3.25.76) '@cipherstash/auth': specifier: workspace:* version: link:../auth @@ -777,8 +795,8 @@ importers: specifier: 1.8.1 version: 1.8.1 '@modelcontextprotocol/sdk': - specifier: ^1.32.1 - version: 1.32.1(zod@3.25.76) + specifier: ^1.32.2 + version: 1.32.2(zod@3.25.76) dotenv: specifier: 17.4.2 version: 17.4.2 @@ -789,8 +807,8 @@ importers: specifier: ^1.1.1 version: 1.1.1 posthog-node: - specifier: ^5.55.2 - version: 5.55.2 + specifier: ^5.61.1 + version: 5.61.1(@opentelemetry/api@1.10.0) zod: specifier: ^3.25.76 version: 3.25.76 @@ -800,7 +818,7 @@ importers: version: 8.23.1 tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) tsx: specifier: catalog:repo version: 4.23.15 @@ -809,7 +827,7 @@ importers: version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) optionalDependencies: '@cipherstash/auth-darwin-arm64': specifier: workspace:* @@ -837,70 +855,70 @@ importers: version: 22.20.5 tsup: specifier: catalog:repo - version: 8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1) typescript: specifier: catalog:repo version: 5.9.3 vitest: specifier: catalog:repo - version: 4.1.11(@types/node@22.20.5)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@22.20.5)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) packages: - '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.296': - resolution: {integrity: sha512-Wrhy7rxQVUNowQRDpSZD+3MFSBAlN4TINZSpKD8PKpEValCG6x05N855MuITvwgkH0EeoyNLRCsowJaIHa8V9Q==} + '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.316': + resolution: {integrity: sha512-1I1oJ/YGqq4pFQvJqycD2e8pbsUQLLR+DwEzG9jQAGCoSKkxP1TBfHpjSik/0byCixyzpYObrYXPC0PKBIR91g==} cpu: [arm64] os: [darwin] - '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.296': - resolution: {integrity: sha512-klMOQ1TdA7u6sWZJYw9l5byWYxMiWzbuPhzCgVVY+LJOs4FlhsS3qLXn2RZmIFhQv1u65zwX+2CRSWEJddqfVQ==} + '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.316': + resolution: {integrity: sha512-gzNncKrID/6yJIKCAuF/pY1kfygQZ4dU0J+MNFl0bU+iQW65ERoIyoghYVfrAQ/gH2fuvnQtWxa8LQNScHgNMA==} cpu: [x64] os: [darwin] - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.296': - resolution: {integrity: sha512-8DEazoBU4I8HsPrXgSJ1Vq30nCBF7PaKjHz1o/igCz+HZu3qepHztWpoKJKQee5Mt4XsvZLwtKuxQo1F+SC6yQ==} + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.316': + resolution: {integrity: sha512-1qqaEdsAs6eipEQQ4bMAWiwDjIouyA/YN5KQWS0/+kuPb+GKS8rUVW2dty2elV703hsMovb4IhMP4cv5K7R9YA==} cpu: [arm64] os: [linux] libc: [musl] - '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.296': - resolution: {integrity: sha512-+tC1KlUlp/3BQS+EfG8RBrmru4xKwF6hNEm15gNct8k9tNVRLYOftbkNCGJPTKkoBoq0sQ+Omojzwr/W2Dg60A==} + '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.316': + resolution: {integrity: sha512-+lm9XSw/em14yMZ41fbo80kfblbylfBQc9nYS6GgLoZVvgT3wSeEbv88v+mEK/jFw9g3VCH4ZI01sjNM34o7uw==} cpu: [arm64] os: [linux] libc: [glibc] - '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.296': - resolution: {integrity: sha512-lMquemenM5CDNZv6g1+xBSfQpat2xiwOQUnY2mwSQKjT+IfE5/F8CgRd38ZBljwGnedPIuKs/DAZMt4YslLF5w==} + '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.316': + resolution: {integrity: sha512-pMG9MRkjxMMbIxpwg/cKz6JorNjZtJOA9l/fifRQ/A01zGTKrRIaSCWoGg+Asmc64QBOa3aA4vzE/od9B1R0Tw==} cpu: [x64] os: [linux] libc: [musl] - '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.296': - resolution: {integrity: sha512-TStCnbg2iBtWJBQeMdO7Xwpx5IYWICmdcf7J9eXhIi4JbahWD+VLRaH5sxB+LLZjdBXekp8piKv6Ne2+arag0w==} + '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.316': + resolution: {integrity: sha512-+csYyGkHziNp4It+ZykqTmXRZBuNrieTiBnji+zwAxNmLLCWz8xEWjNmwhaLPIMpUiaYREkDhZXt/AS6xXta5w==} cpu: [x64] os: [linux] libc: [glibc] - '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.296': - resolution: {integrity: sha512-/epluPyoLm1NQAcHV0LUierKog7c9yyU8BgpZOtGWiM54nqTZKKBuCwANraV3ROfXYFfJdMV4Vehk/8fqxoOqQ==} + '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.316': + resolution: {integrity: sha512-Xj4iTS8NsB6isGhnZEnaIXIpUcSspv/lyIVnfPZjVGwuttaVHjq4IxfDopsPaVsPuTKd+L7DLAaBram1k85U2g==} cpu: [arm64] os: [win32] - '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.296': - resolution: {integrity: sha512-T71Y/hp0v7VtRzTOoxAsIkPa68JpB1d/VvCKTTE9GzTkbjQZHjs3S1DM06LDxSpwjITF7OCVJq14+XjN8M9t/g==} + '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.316': + resolution: {integrity: sha512-FzQA1zHbYJTtLR9nn1McwkGYeiEmroTmYjIg7xZqo5eweJ8U/DESZKR/QdfF04MXe2DF23oLL8WHjEa+WxbGQw==} cpu: [x64] os: [win32] - '@anthropic-ai/claude-agent-sdk@0.3.296': - resolution: {integrity: sha512-Y+cZ2BT8X94mQ9GJOVyIqhjC/nWGvwozUVLjdkzX7aSt+zuo5tgk7Hdv9V7tEUQ9fKnEuiL6moYNWDeHqCD4Lw==} - engines: {node: '>=18.0.0'} + '@anthropic-ai/claude-agent-sdk@0.3.316': + resolution: {integrity: sha512-mCMr0que5kIy80JslJub6WFDB2+GYRGWNeVgSZaBpkBwXrr4wnRMnnGHitkA2BEJ5QP5xWyc6YH/6do/edxCWg==} + engines: {node: '>=18.14.0'} peerDependencies: '@anthropic-ai/sdk': '>=0.93.0' '@modelcontextprotocol/sdk': ^1.29.0 zod: ^4.0.0 - '@anthropic-ai/sdk@0.133.0': - resolution: {integrity: sha512-jlqUN8p8ESTJj+GJnA4KjzbEfF1waEoGzRT8jwytlYGFFgv+/DUQOxlYGvYw10UzhD1kwLqYzxvA3FrTB2YWuQ==} + '@anthropic-ai/sdk@0.137.0': + resolution: {integrity: sha512-YpEnbPz8kWF1BWthwUCnRhci7OvDLSUO8NFKoevoPkjNkK9CJeibZITgxr9vhqOP8Le61e5tNDHFTxw1dc6Png==} hasBin: true peerDependencies: zod: ^3.25.0 || ^4.0.0 @@ -912,11 +930,11 @@ packages: resolution: {integrity: sha512-60vepv88RwcJtSHrD6MjIL6Ta3SOYbgfnkHb+ppAVK+o9mXprRtulx7VlRl3lN3bbvysAfCS7WMVfhUYemB0IQ==} engines: {node: '>= 16'} - '@ark/schema@0.56.7': - resolution: {integrity: sha512-jmoOJlYIc4k1uv8oYBDNOFnAsKk2a2D9t/D6npF2JUfW4ecPB0v6ce6lruKg7lkBxIBA8Z7UtxfmvephYbhUGQ==} + '@ark/schema@0.56.8': + resolution: {integrity: sha512-R05TOe85oQBGFFw2zKMuZpqkXibLKuC/aJt6VwFn5Cjc4x3NkWfhvGRpRDycNkj3ddcHnOPtIsmjVowJO9Yxdw==} - '@ark/util@0.56.7': - resolution: {integrity: sha512-z8pVnrPk/x9GC18yOp5wCe8rR2+Z6us4CTSg7dvxdsDLuA2xXYq+QETD1fO6f3fMuXe+PCjpvtCnhTW9RHLgEw==} + '@ark/util@0.56.8': + resolution: {integrity: sha512-XLiQyGfpJcws1zCtp2Cva8s1oheCdFn1Rt6JSyC4NnkDrpwCJnlaiawuuOc1Z97vMH+jEzW5vyyf0xOju5wUQA==} '@babel/helper-string-parser@7.29.7': resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} @@ -947,59 +965,71 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} - '@biomejs/biome@2.5.15': - resolution: {integrity: sha512-WZTW4slm/pdkh92K6t/3aEN++44JD1PQ7squ7RCMLI1flHGl43DVOIGXvCjHiZgBMO1V4uYxoFNtqrIA4qGuIQ==} + '@biomejs/biome@2.6.4': + resolution: {integrity: sha512-8sKKwaNW4ot22awZ3lBjwWLHnUFXgXnrBPYS2gNlBAXRbDC++7kqjK2H7dR/FgCDtPvO1xfKpgEhJkGxAKYkxA==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.5.15': - resolution: {integrity: sha512-BZVzFhJ/mUvTLMYbc9x6el0o2Uv5zP7bACYyhFb6fSc1giroXm7PL0a5KqMJ9F+/BnkYRjagD/ROSDVOZ6eapg==} + '@biomejs/cli-android-arm64@2.6.4': + resolution: {integrity: sha512-jwrwigP4tBcHxzuV8izioX/BOUhJL/4e2rNSOE5nCjBkVC018LQAQUGiH+CNkFYvLtQ1dcZo5/xXERmaAGc7JQ==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [android] + + '@biomejs/cli-android-x64@2.6.4': + resolution: {integrity: sha512-HdGInPJ4nZFwHxzvEtcp2nmSBtUyJrurmtIK43upFckuS3+ZqVM05HtsxQWnqGsuy/pxckIAjyKWlEKRlBXUyA==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [android] + + '@biomejs/cli-darwin-arm64@2.6.4': + resolution: {integrity: sha512-0VvcUz46wbg59Q4TZ59KkIjDJrxEyu4Eoe79+F4SChxoWe+W7AEyIp6F5r72C9+p6MsB6dIovnZt1D30lGM3XA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.5.15': - resolution: {integrity: sha512-V5Kw63V+fVGNFhFrizDxMbGXAzZCh8kYzJpy3GI6gTapWDg7bZK9oYC9CbVgQSEdTnupz0U5Efz8Ev+5vdBBXw==} + '@biomejs/cli-darwin-x64@2.6.4': + resolution: {integrity: sha512-fxmvkF81srlS3DiMyfm+aG3J0eG+6/BjaxRyjy57KbLSafnq0PO+hHfVWmtH2ty0S7nm6yDXBRwySfFeaRJKRQ==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.5.15': - resolution: {integrity: sha512-tGzZUTcJCV7tj5Adh/Gn6nR4MycqA3iohq2LEcrarAgRBkU0h0OKd2UzCRkOsOYOuUGaUJb4YmqRqyy2feGGSw==} + '@biomejs/cli-linux-arm64-musl@2.6.4': + resolution: {integrity: sha512-31ZaH/MHqPX+O+evRwRrCHQ8W5/9adY+/eMytGGWZnRx1T41QsWIF09+/WujynLBhWZUxNGS5CtsWLwgOFTAyg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] libc: [musl] - '@biomejs/cli-linux-arm64@2.5.15': - resolution: {integrity: sha512-XaG7P7eeSLYETD3K9grfB0mQmpLQZjygdbsxekWBJAg4am79fGAtRpfRyNnTvXB2fZFNnJZG3nXm7HBat0+VUw==} + '@biomejs/cli-linux-arm64@2.6.4': + resolution: {integrity: sha512-6+bK1Y/evmIUiJr7auertuMbiaYVicJhqA1bZyL47lCMWugv8l0gFQCqvR/gN1vZMHYm+HwoTKgeMxdNFCoQTg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] libc: [glibc] - '@biomejs/cli-linux-x64-musl@2.5.15': - resolution: {integrity: sha512-IlxUcyxilVGPsE008x13pWdkTbU3nQpP2i9b5UrbOYj6goBkKsRX1XB7yJLcV+O1H9LBchIIm4adOaVLZBX0ZQ==} + '@biomejs/cli-linux-x64-musl@2.6.4': + resolution: {integrity: sha512-bomSa2XdQAGGj6Cwdm4M13qE+lN9+AOlW8KtI4hdyVyRRF/Z71qPAi95T4wtdZK0QpBbkTW8hgbZZCwPi4xzIw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] libc: [musl] - '@biomejs/cli-linux-x64@2.5.15': - resolution: {integrity: sha512-xE4iEW/3LqlYj9GFgGrFsFSH51dEEpUbYWBfeOv0q87WkUDxK2o/HhreSb7qMJqck70RVM6Lg96hgedcAYcOkA==} + '@biomejs/cli-linux-x64@2.6.4': + resolution: {integrity: sha512-tbFZMdL6dP/ws4edXxYG9WhvaVa1ZDzL4G5DzahnWW7Psib9H+VTdyU4XXVxpJk5j/nYZroSbvSNyYlpW3yCIw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] libc: [glibc] - '@biomejs/cli-win32-arm64@2.5.15': - resolution: {integrity: sha512-2kPKzhNlm8C+Ru3GcO0Me2ODkCBLrVOUNuyi84RJyWDVKAA4+Kjj3jMjL938lF6BRfvltC4vB2nPY9SvN51Ovg==} + '@biomejs/cli-win32-arm64@2.6.4': + resolution: {integrity: sha512-eCsqt8Ma3eVap+oyJCDnJZH60SIU464B66n3y38EUTJdM1T/HfZol1FJC9vb+sHToX0ix8XzqPcwJnOzyAJz0g==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.5.15': - resolution: {integrity: sha512-yAzh4UqEImV6Hcy0zjUqNfJAsUhoD64FBQCdTG8Md/Z2wQeVP/ZmJ3XRYAs1g8J9fjTFyl2fCtc5FB5til47+g==} + '@biomejs/cli-win32-x64@2.6.4': + resolution: {integrity: sha512-pYsMy5AThiHFOZAsngg8qN4PurM6nInKBhVX7sbj3eNpRQqo1Hb0MgCwPL7VqVMrmcEEMj9Ks3qbkallR65e8g==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -1065,9 +1095,157 @@ packages: '@changesets/write@0.4.0': resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} + '@cipherstash/auth-darwin-arm64@0.41.0': + resolution: {integrity: sha512-2B+J/bPblfiWQcxm3Z9voLhV66TZcmDpzVz5aBNS4y/B7Ke55jGH6m3H9g+c1xHZbe62q7zwDUEatveOy69f2A==} + cpu: [arm64] + os: [darwin] + + '@cipherstash/auth-darwin-x64@0.41.0': + resolution: {integrity: sha512-XrmFRSdQaoed7tqJ+RJLiBvuQr/v7qiSu7LDA3PCVbegHVcsjYQ9D0sd49zDZEEFN4zZlcwmeh80eGAEJiyhKg==} + cpu: [x64] + os: [darwin] + + '@cipherstash/auth-linux-arm64-gnu@0.41.0': + resolution: {integrity: sha512-NQJK++HzV7XCQPuNbVmIJcC5T4QuflOySYmQtP2PoTg0p+V7WK/3yruZZKgjbbCU6v8tek/D3T8hk02snq/8sQ==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@cipherstash/auth-linux-x64-gnu@0.41.0': + resolution: {integrity: sha512-9NMiMs2p8p5NBcir8Cx90zBzOlkM0EWbIZOeCIjokT9X4d6UJy3+JhXi5VRn0gWpqAA7i7+BZD+puZ+fmBzJLQ==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@cipherstash/auth-linux-x64-musl@0.41.0': + resolution: {integrity: sha512-V8QwrxXLoqO0ED02hnvQJNBid/iDZUawt3zobUL+DqieN3QZxDxI5/viFIkA4bTg7CV6oSmy2b0rINGqiHvkig==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@cipherstash/auth-win32-x64-msvc@0.41.0': + resolution: {integrity: sha512-MkC04kTuyUd7J2/dRWIzdER1if6V+g6tVDRoZI/dql/Uq/+FXtV9lBXDcS1iATDyE/1APLvMMvuAqJeELGrGag==} + cpu: [x64] + os: [win32] + + '@cipherstash/auth@0.41.0': + resolution: {integrity: sha512-jhhCthk+vilCQAvOfKYPSnIOZR2J3/+0JEYLNY3+M19rEzZ2ZmTLZDqzu4c+y1P73LgzTX+oWL6ESUoKsMd0TQ==} + peerDependencies: + '@cipherstash/auth-darwin-arm64': 0.41.0 + '@cipherstash/auth-darwin-x64': 0.41.0 + '@cipherstash/auth-linux-arm64-gnu': 0.41.0 + '@cipherstash/auth-linux-x64-gnu': 0.41.0 + '@cipherstash/auth-linux-x64-musl': 0.41.0 + '@cipherstash/auth-win32-x64-msvc': 0.41.0 + peerDependenciesMeta: + '@cipherstash/auth-darwin-arm64': + optional: true + '@cipherstash/auth-darwin-x64': + optional: true + '@cipherstash/auth-linux-arm64-gnu': + optional: true + '@cipherstash/auth-linux-x64-gnu': + optional: true + '@cipherstash/auth-linux-x64-musl': + optional: true + '@cipherstash/auth-win32-x64-msvc': + optional: true + '@cipherstash/eql@3.0.2': resolution: {integrity: sha512-E85o0aoOqgCW6RReLtJ0YLh/ExRlmDJo7LlJGpWPoMTVaw+CW8o11DJ4oJIF1vFtuxSVxNULuPzzBuVmpTvvcA==} + '@cipherstash/protect-dynamodb@6.0.1': + resolution: {integrity: sha512-AjlV0jLbD3DivFMiEtS+En3457pH7Ywrnk8S6f4l35F/NnXt1PQer033G/G8SqvVTAymrPysgoENKi5ZxrVnTA==} + deprecated: EQL v2-only package, no longer maintained. Use @cipherstash/stack/dynamodb instead. + peerDependencies: + '@cipherstash/protect': 10.2.1 + + '@cipherstash/protect-ffi-darwin-arm64@0.18.1': + resolution: {integrity: sha512-kTkshWuGG07X9m4Ug0mPXIglfZopVFCJy55/B2yy9Z+hhNP95d4Zjq6AXlRYAHsnxgcp0SnynC8LaVTcXsEx8w==} + cpu: [arm64] + os: [darwin] + + '@cipherstash/protect-ffi-darwin-arm64@0.28.0': + resolution: {integrity: sha512-QRwiovEdgjstbaCONZGYXA82NG4Gwz9mJOZeAzthUmNIQfnVErO9UQAfJ+I1T/YG1Ww2FCWcHltXMl/qjyeK4A==} + cpu: [arm64] + os: [darwin] + + '@cipherstash/protect-ffi-darwin-x64@0.18.1': + resolution: {integrity: sha512-VdoTOIF5hmS7sQUR/w6FQKAj7aJOhOD2lo2wlV3hxG0PNd2pWiB1HvE9wvrGY2VAPqBU97Cp+S8IFkf5ckqQ2A==} + cpu: [x64] + os: [darwin] + + '@cipherstash/protect-ffi-darwin-x64@0.28.0': + resolution: {integrity: sha512-H8qB2z3drJSc2bR5ITsJSFrOoNKvORbauTdHmaS1e5OleXsLl/F+56Zvghz8NWs+bXs/2aVzHxpYte8FgV8AAQ==} + cpu: [x64] + os: [darwin] + + '@cipherstash/protect-ffi-linux-arm64-gnu@0.18.1': + resolution: {integrity: sha512-DcGIgoTkRDaBqqXs3X4fB7XCOMtleSLd+kMAStS1uEq6agVHp2P/9Y+ag30MQ7Ypm0xTJBZVwl8ClDXDSklQcw==} + cpu: [arm64] + os: [linux] + + '@cipherstash/protect-ffi-linux-arm64-gnu@0.28.0': + resolution: {integrity: sha512-h7vZxB/wako6j1jspkGl41gptTN1dBTWYqAR6jhVnvKJK0TBlyUKuSJwO1NeqyNfFQ/b1KmqJ11JGvY95uRZOA==} + cpu: [arm64] + os: [linux] + + '@cipherstash/protect-ffi-linux-x64-gnu@0.18.1': + resolution: {integrity: sha512-I5Cg7vlkVX2qL3hKYiYEx1C1lTQ+uGt2YrAxaqSs09gpvpa6xC2/2QMpV9UvKnJ9uLlxVly8jycnzp7TyvS9pA==} + cpu: [x64] + os: [linux] + + '@cipherstash/protect-ffi-linux-x64-gnu@0.28.0': + resolution: {integrity: sha512-PgHn0Og0PiCwFdV4yKhipGKfqkCXP6Xchyy6ykTaISabmSlkkbRNkyNF1/tZEQYF65sm5gmqSpwSYzKODaAsbg==} + cpu: [x64] + os: [linux] + + '@cipherstash/protect-ffi-linux-x64-musl@0.18.1': + resolution: {integrity: sha512-Ol9dYVNXIaoYrhpsJv90PX5pHg1mmWKqnpnhh2ofA+NNZqEAdolo4BeTsQc10sCE6WogcM8FFJ9OcOrk79N8lA==} + cpu: [x64] + os: [linux] + + '@cipherstash/protect-ffi-linux-x64-musl@0.28.0': + resolution: {integrity: sha512-fMu3k1Y3wYMcGbGpVtrlCMNRLd1//5c9ZHcyWFjKFqimOCbBO5akgCQij4zcvj4kYDHtveu9dOdOKVhaG8k6hQ==} + cpu: [x64] + os: [linux] + + '@cipherstash/protect-ffi-win32-x64-msvc@0.18.1': + resolution: {integrity: sha512-j9mqXQDHu3vdLJx93g2lAuKDeOh+XuC1FBvsrr2FTjgzBqrZAHH60QFPXjvFT1/U1oWjV8nAgTZQ4cUMJSDa9Q==} + cpu: [x64] + os: [win32] + + '@cipherstash/protect-ffi-win32-x64-msvc@0.28.0': + resolution: {integrity: sha512-tF0y7TcyBtgN/jHodYMnrJ4etLkEI/klzDivW8Q8eIuIdoJ3q5muZKFIhNX0MbDDdh2O4GsRdNhXRubs7BiFpA==} + cpu: [x64] + os: [win32] + + '@cipherstash/protect-ffi@0.18.1': + resolution: {integrity: sha512-rDYIRIWo7EvJ+ytGEwzeb0D/4j3tQ8w+5Kpz089IEhxIVxOzavsR+f5HyMXohAKYkH+19RpD+2X+v1P8rwmiUA==} + + '@cipherstash/protect-ffi@0.28.0': + resolution: {integrity: sha512-R2L/8HwMREkVKlR5KCcuELIWz4QNButSBQzY+nRDHl1PUXjRqWG1h265FkKVtTXKNKUup7rB4mswu+M+t9KF3A==} + + '@cipherstash/protect@10.2.1': + resolution: {integrity: sha512-SCGOGpLWhwa9+hotbA11tPNGhKBZYspa5NWBtwBiHv/EgEKCQvaLDc0MAwzyT5cv7xDwbQESkhxyD9oqHnIMfg==} + deprecated: Deprecated in favour of @cipherstash/stack. Install @cipherstash/stack instead. + + '@cipherstash/schema@2.0.2': + resolution: {integrity: sha512-3DpGvJ3sbhPpAGTQFf1St+WU6AlNR0S/rumSFHG0ghwDGzNV7PjnLHCzzZcMQX8UVw9KYwDz5+n/SAZAuDQczg==} + deprecated: EQL v2-only package, no longer maintained. Use @cipherstash/stack instead. + + '@cipherstash/stack@0.19.0': + resolution: {integrity: sha512-n/jzMEiEU3AObG2isu1uMCQ34k2SqKSReVd63j63uaMU2UCHwmXZWtg9WeXF+IdS1w6G6VVj/DZCuygv3kzxWg==} + engines: {node: '>=22'} + peerDependencies: + '@supabase/supabase-js': '>=2' + drizzle-orm: '>=0.33' + peerDependenciesMeta: + '@supabase/supabase-js': + optional: true + drizzle-orm: + optional: true + '@clack/core@1.5.1': resolution: {integrity: sha512-iHTrHA8MtVuLl2TfZySmcKv1qO2PoyC9Z7pfSDozEuV5vtY3/wcOPKJXlqJ5Oq2Cx5DDGQGAMVx6HZfRRoVEbQ==} engines: {node: '>= 20.12.0'} @@ -1076,43 +1254,27 @@ packages: resolution: {integrity: sha512-dlT1m5e/0yUL0kRNcQn7yGLVThkgbB0Ga/1AmfDDC/8ik6AIiSf2QLQO2zPYvefsHP0aFgxO93cVLCCfDp7kzQ==} engines: {node: '>= 20.12.0'} - '@clerk/backend@3.23.2': - resolution: {integrity: sha512-QW2qJPY7xQyn5SrNWJ+xO7o6va60X9/v4nX8y5zq8OJFS10X7GlEz8s5PDKTgo6W6SWb8L3APhrZH+LTp7yuNw==} - engines: {node: '>=20.9.0'} - - '@clerk/backend@3.26.0': - resolution: {integrity: sha512-YSrWNakOSPzY03/vkwm21RoGjTH/ejSKJLTixOQjOQu6N51MgHI/Weo3j1RYqicR4YJqj/5qGKFR6ixJbqFaWQ==} + '@clerk/backend@3.26.5': + resolution: {integrity: sha512-znLhEv811EFbYvPjFQSGVFCaCQq6j6nz0H7UqvKXONVAoz0T9T9CVjz1j7Ii9EbjFyQikZ1uxV84WfDiDNiTeQ==} engines: {node: '>=20.9.0'} - '@clerk/nextjs@7.9.14': - resolution: {integrity: sha512-fHP9/D0zJCcC1DHJBoA/rlfMXLYBtgNoVE8T45jTBbdDeftLYIl6nJ4cbHERvNsc+D5MotTdrvZd5zenZ013EQ==} + '@clerk/nextjs@7.9.23': + resolution: {integrity: sha512-ilAL/4kKa85DZ28XPPqFIiDcxxZm8+3gA2zvRXjpLzcfRt/X1BzHalgpStv+QbwLLcLL/M5ftpvRlYMS787pTw==} engines: {node: '>=20.9.0'} peerDependencies: next: ~15.5.24 react: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0 react-dom: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0 - '@clerk/react@6.17.8': - resolution: {integrity: sha512-sNeMe+5ArLshOJgNtqUGHb7cLHjDjRhumBHBN2ovg4uHpL49kQ2UfDUTtxpRUdMNikUg0Oc1CwzLFBlUv1umXA==} - engines: {node: '>=20.9.0'} - peerDependencies: - react: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0 - react-dom: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0 - - '@clerk/shared@4.40.0': - resolution: {integrity: sha512-80KM/uw5ZseYTKwJjIhJj7jsHqX6rFem6cwcFJVCUriE3R4tpzkhXsfbhtdho6cG2pQD3NVqKspxTVbSjATzPg==} + '@clerk/react@6.18.4': + resolution: {integrity: sha512-3e2CkkI8QYsiMYpM8l4XHFF64eHCYgocC0ZB+Zws5ScJeMAPBgwvKpbDs/juxTlSzE2agURin1FGepv/5HppOA==} engines: {node: '>=20.9.0'} peerDependencies: react: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0 react-dom: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - '@clerk/shared@4.41.0': - resolution: {integrity: sha512-zLdeVxfPBOwmiDqHh3Z2y3ub/4u84zOSlEUKPDpFAibMdW1OyboPw+DIU/seH9UXDpCQCNHl6lfKUE9LLIBvfw==} + '@clerk/shared@4.43.1': + resolution: {integrity: sha512-0oyDzyEMZzU3tmvEVb4dts9ix5XqXBiNlCn9SWA8y/RNi8TtSHT5bPh/zn6HaA6fkdhJONjD6XVZIq7hkIdkyQ==} engines: {node: '>=20.9.0'} peerDependencies: react: ^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0 @@ -1438,11 +1600,11 @@ packages: cpu: [x64] os: [win32] - '@hono/node-server@2.1.3': - resolution: {integrity: sha512-TA//nWMqPhbfdfneACk6t5a9eqbS9lABEPyKn0/xZTah3H3U2XaVg85rJFl0/Fyit0I552YDHgXGVSf3GwqbUw==} + '@hono/node-server@2.1.5': + resolution: {integrity: sha512-MgP/I06GdvsilDspMk/qmRzpk8LOUStP6jFAbSRi40W09DhoyUn+Mj7eyKICPqeYKybOjVFLVIAQzvu1bfIa7Q==} engines: {node: '>=20'} peerDependencies: - hono: ^4 + hono: ^4 || ^5.0.0-0 '@img/colour@1.1.0': resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==} @@ -1615,6 +1777,9 @@ packages: '@types/node': optional: true + '@isaacs/nonrecursive-glob-match@1.0.3': + resolution: {integrity: sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==} + '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -1640,8 +1805,8 @@ packages: '@manypkg/get-packages@1.1.3': resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} - '@modelcontextprotocol/sdk@1.32.1': - resolution: {integrity: sha512-2DdE+SJDtzLEEWzY1ZjY7Q+VcPhcV1KisD3zI4u0XZyktsjHum1mwbMI+JaulUBi2OZk+KJAi2uPXzxichPkdw==} + '@modelcontextprotocol/sdk@1.32.2': + resolution: {integrity: sha512-SWsVtH/0vULSQStoZ6xxH2K09Li8fXYTMC64ZeogCdpZ3XSi1eCPOByV1OpuJxuI3OcmHhosDWYyii07tpPsLw==} engines: {node: '>=18'} peerDependencies: '@cfworker/json-schema': ^4.1.1 @@ -1666,6 +1831,9 @@ packages: resolution: {integrity: sha512-SC8xYNOH1dTnDiB2pykFhREl74gs6TF4jr2qFp0h9fwriRSoxic/CnVN2d7ikpc3XatOK1QnwfQCCmyv31x9/A==} hasBin: true + '@neon-rs/load@0.1.82': + resolution: {integrity: sha512-H4Gu2o5kPp+JOEhRrOQCnJnf7X6sv9FBLttM/wSbb4efsgFWeHzfU/ItZ01E5qqEk+U6QGdeVO7lxXIAtYHr5A==} + '@neon-rs/load@0.2.6': resolution: {integrity: sha512-7p8j+guEhGTJNJISgmHO0homqGYAc0SDfmgGZfluMcQnimcceMY87b4hdqufp+7YmsOVC4W/JvT3/Tpi3/gy+Q==} @@ -1740,14 +1908,18 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@opentelemetry/api@1.10.0': + resolution: {integrity: sha512-lMkyes8iHrG+mk6WH7X70MdCLI2RS0FwNBY1PyQ8UemaijE2m5mv5A0Niy3HtbYTFrgkUEQjFMXmSAk2hQDuPQ==} + engines: {node: '>=8.0.0'} + '@petamoriken/float16@3.9.3': resolution: {integrity: sha512-8awtpHXCx/bNpFt4mt2xdkgtgVvKqty8VbjHI/WWWQuEw+KLzFot3f4+LkQY9YmOtq7A5GdOnqoIC8Pdygjk2g==} - '@posthog/core@1.58.0': - resolution: {integrity: sha512-vluXIlVF6WGeHoQbsQK8Y1ywXZlJDU7YHEKiXAArQU38yFBpgxxfD0kInbYHtura4Fr7Z7H8WiDFvtMpCGehGg==} + '@posthog/core@1.62.0': + resolution: {integrity: sha512-KjNwGC7s0141wnWWHubNMdg1lOhZjqKRw2OTNstuzdVvNDfvv2RbFJQSSvvABmbCmTXwlMpdnbb/M/aAigDnNQ==} - '@posthog/types@1.415.2': - resolution: {integrity: sha512-BIIHPyXcPZuNTImrR1qLqLKFw7j9o8co6LG/9OpLtpWJ3RT0y89Lx6VCtd37N9/dkr/qW7y0uPjJxAxjsALHtw==} + '@posthog/types@1.419.0': + resolution: {integrity: sha512-XX7zRYt/vK8AzaD6V+oDquAzacZf5exJv971dja9En8Qf6g84Qvc3rpT0w6hDYYLWrjaSSkdjFfvvoXI0ouJDg==} '@prisma/orm-family-sql@0.17.0': resolution: {integrity: sha512-zyIBxeur7PfIGsuvYaL53XBMgkg/FAiwZlNA41OoZyBP1RZdd7FJG6Jz1sLObQzfZ+IO9rDcoVBPMil4PAC7TA==} @@ -1799,8 +1971,8 @@ packages: cpu: [arm] os: [android] - '@rollup/rollup-android-arm-eabi@4.64.12': - resolution: {integrity: sha512-Z8lz+5UOiCJLonjeqwJlhUtHA/Sr6R1AidkccQxdWF0nigNzP81aLoU+udgOaGfL5s1uzFXzcux/pCwGAMu0lw==} + '@rollup/rollup-android-arm-eabi@4.67.4': + resolution: {integrity: sha512-/v/pUAPOcwp+r1Hjjdg0cBV1TE89CzGKrKh2FgkIQw2QBcIMmVPOCSfuOZStCn4Xh/98HXfo/ht6ztcssctPNg==} cpu: [arm] os: [android] @@ -1809,18 +1981,23 @@ packages: cpu: [arm64] os: [android] - '@rollup/rollup-android-arm64@4.64.12': - resolution: {integrity: sha512-+tKxNa2psFmiTb0KfXlXs4Yj7vkEhzAvZ0DrQ5+0gWHQJM10jSleQ3l1FIVm5uvD53YM8lHfM4mgCLDDN9f1Gg==} + '@rollup/rollup-android-arm64@4.67.4': + resolution: {integrity: sha512-6tmmB/P52Vt167FXXEw5auiEUgTtZz7aqUgWHqYXToIUE0HFDY6fTdAyeekjjsNk6O/8dtpSKtClxSj1mMneKQ==} cpu: [arm64] os: [android] + '@rollup/rollup-android-x64@4.67.4': + resolution: {integrity: sha512-8Z9Q4RmotVmuL4llOvqX814JNiOK1oqoBv+glG5KbpRfUiypqzz2/fxIzK4Pq129l4dT5a8Gszmpc0/XPYoFuQ==} + cpu: [x64] + os: [android] + '@rollup/rollup-darwin-arm64@4.60.4': resolution: {integrity: sha512-tua0TaJxMOB1R0V0RS1jFZ/RpURFDJIOR2A6jWwQeawuFyS4gBW+rntLRaQd0EQ4bd6Vp44Z2rXW+YYDBsj6IA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-arm64@4.64.12': - resolution: {integrity: sha512-iiripdfvyRBugV55/Dk7GplNXQtN/PG85OcKeveU1z2UkTg0MofbBF1qk//qgPWiqJbVvQcXAVCfE56oDGO4EQ==} + '@rollup/rollup-darwin-arm64@4.67.4': + resolution: {integrity: sha512-pnq6hssxTtwuRAl6Kdi/+IDY+b1IhkUetjhUkdLAAJCssjfqtL2Oqy/FXJVJFtAWOu1oRlArIvf0Yk1O92x2HQ==} cpu: [arm64] os: [darwin] @@ -1829,8 +2006,8 @@ packages: cpu: [x64] os: [darwin] - '@rollup/rollup-darwin-x64@4.64.12': - resolution: {integrity: sha512-BmATib8swSMAagWNIfDZMnb+k34RXR4bbGOUfZgK8lLlniuMyVoSDDXCOGkdhtUmBXL4aygDh7bhjQ+TmhTvIw==} + '@rollup/rollup-darwin-x64@4.67.4': + resolution: {integrity: sha512-BeIrGZvHMVdJg/N+ohZfFywG/gF41684YhDj2wBvouj7m9ziP1tZDUNwzXRiDY+3WIKngaC4hiUBqVtBPGP5og==} cpu: [x64] os: [darwin] @@ -1839,8 +2016,8 @@ packages: cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-arm64@4.64.12': - resolution: {integrity: sha512-GzrO0CiUq8vcAI/hYJuIcp6wNm3T3YhOpumYtf9Z3Fz+cfN1VESCVfy7EPcM3/m2K8l+Gn2U+4XtNZjwhUXctQ==} + '@rollup/rollup-freebsd-arm64@4.67.4': + resolution: {integrity: sha512-fRFX/oqNg/g780DKoS8RIfYcZD59Ru5O/bSeK1N7gQljBFrTxJY/q5EX4eMs5SrJf32VgVBVVYCdfPpzAwPPnQ==} cpu: [arm64] os: [freebsd] @@ -1849,8 +2026,8 @@ packages: cpu: [x64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.64.12': - resolution: {integrity: sha512-Dpta6gigm4o6SYioXtTkZBlGLA/Sl6OpzgLqY+51uafJE2blPejAtR1w82CVLPN+F9cvo1+/em92x/zcOgY0uQ==} + '@rollup/rollup-freebsd-x64@4.67.4': + resolution: {integrity: sha512-bSrBRopG1q+0RuOsW0NtYTtIODlvNA3T3ebx5WnQVdSxWIoXFmj+rZdHUHdSLgFdZ5M6VGmekYE7r4RMGQXjfg==} cpu: [x64] os: [freebsd] @@ -1860,8 +2037,8 @@ packages: os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-gnueabihf@4.64.12': - resolution: {integrity: sha512-YpeDwQ5uFaogRvytNC8RK0keDO65kI5wNEhGSs+4GiJc3KHhxj4j5cnQh2nCu9ybJj6RP0/ycB6bkN0yFJ9I+w==} + '@rollup/rollup-linux-arm-gnueabihf@4.67.4': + resolution: {integrity: sha512-L8IvdrJVtl65g1ozwDSyjGPG+FmibhCdFUwmqTItJLw0S3+Oj4QzFs7rfgTUiK7rsPjkCLdG1/GApFxoynXFJQ==} cpu: [arm] os: [linux] libc: [glibc] @@ -1872,8 +2049,8 @@ packages: os: [linux] libc: [musl] - '@rollup/rollup-linux-arm-musleabihf@4.64.12': - resolution: {integrity: sha512-LQrB3/sImIr1ycrlEyaApOLH1rAy8JV4/dH4eoK817aWATdcs4fESXz53/w72NwDnwPM5zEUpoL7socH4ZDnwA==} + '@rollup/rollup-linux-arm-musleabihf@4.67.4': + resolution: {integrity: sha512-h7PcoQOzC31jshNpQ48J0akB9tsghjkSjSl5AZ6XsVGTxVsln7t7C4SQyw62tNVSaz2SeHgk4VT2ELbL17BSHQ==} cpu: [arm] os: [linux] libc: [musl] @@ -1884,8 +2061,8 @@ packages: os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-gnu@4.64.12': - resolution: {integrity: sha512-iAF2iYu9S4SBfNsb4k0ewNBjO83WxHEltIuKQBGMzEKFgrYfmJn+gatBDXR2t/0zJN0UW0kzR4rfvQ1UHzkZ1A==} + '@rollup/rollup-linux-arm64-gnu@4.67.4': + resolution: {integrity: sha512-KSPuOBNHoOl7AsVjeY1KZci8+0up0U4TFAHU5IzBYN8P+Z6cB9DZq28+JQycZW7f6WLLa/tSzhV7Rdy95bVi+g==} cpu: [arm64] os: [linux] libc: [glibc] @@ -1896,8 +2073,8 @@ packages: os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-musl@4.64.12': - resolution: {integrity: sha512-0MQdRtdbirJCXPIVeW/hd/LXLR8Qz96pc+2EBptuuV5q/zSGOzND7SZt8gBTE58NC9cUG/8UxcUXQiKRZ2WzzA==} + '@rollup/rollup-linux-arm64-musl@4.67.4': + resolution: {integrity: sha512-0E/mKmVk1PlQeQYygIwQm0jlwjANTzGSiNBMPrFx+rdFGFj/2Axh4p6XwcrystQIqXZVudTaGsdbDpzYgJ4wSA==} cpu: [arm64] os: [linux] libc: [musl] @@ -1908,8 +2085,8 @@ packages: os: [linux] libc: [glibc] - '@rollup/rollup-linux-loong64-gnu@4.64.12': - resolution: {integrity: sha512-yGDEwn0AGnrY/KCz2oY8R9KKNiQnTcwNuCWXeSXF0VLxXzlqoCgaS5QHsf1lbQvKWwPuN2Czkjk1wXRCBONTOQ==} + '@rollup/rollup-linux-loong64-gnu@4.67.4': + resolution: {integrity: sha512-Fvw7dOSc2Sa9UOipRZVI0zOgdLCzsjVyD/6JuHXzUHTXFu7mMgmeX/0/bCVBIut1dz+nWz3pV4WpS/Qg0XVnxw==} cpu: [loong64] os: [linux] libc: [glibc] @@ -1920,8 +2097,8 @@ packages: os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-musl@4.64.12': - resolution: {integrity: sha512-AjlbD0efZEhHaJ3bsNjxSFDoguNq6VZvC+FKGJGBCA+ZN7BrZq2TuuSWFa6AI8IpOeuvhp2LoYcP7jiZwmtU0Q==} + '@rollup/rollup-linux-loong64-musl@4.67.4': + resolution: {integrity: sha512-jzxbVHaE7V3F+P0wEK7UydQtvv7Twfdtx58jI5/3VRx1jJxyrn+qFwfXmqjVFxPhBl+zjaRs+ZJMFJw7vdHaQA==} cpu: [loong64] os: [linux] libc: [musl] @@ -1932,8 +2109,8 @@ packages: os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-gnu@4.64.12': - resolution: {integrity: sha512-sDW0CiPoUCEEUV25uBG5sJ2gKe75DJqLpj91m1eK1vKffywyY7v4i6q1450ZuR6QW4NArXg7JpbMGgKU8di3HQ==} + '@rollup/rollup-linux-ppc64-gnu@4.67.4': + resolution: {integrity: sha512-fhtrzp9p4GjEJVaigaap9g6X9nP6xgJtKiLLXSDgpE18HXufA5aqfltGn+KAqMtVZReJZfOrXm//y5YSA9BWbA==} cpu: [ppc64] os: [linux] libc: [glibc] @@ -1944,8 +2121,8 @@ packages: os: [linux] libc: [musl] - '@rollup/rollup-linux-ppc64-musl@4.64.12': - resolution: {integrity: sha512-VTQYUhMjl8kv999VuYqScgv7P9cR9KuxI/6bkUsEa3bsswqG0+otFjuLZmJ1U+ffEP4IAz0jxOeV0DX6NRBhjg==} + '@rollup/rollup-linux-ppc64-musl@4.67.4': + resolution: {integrity: sha512-uynaF7IUHwAckV0S+yC1f5esy9gB+aqCBsPH5BOck32TYdCuAn2lVG5tvUcFnEsrviGEmRZxE1NHSOieUPYJEg==} cpu: [ppc64] os: [linux] libc: [musl] @@ -1956,8 +2133,8 @@ packages: os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-gnu@4.64.12': - resolution: {integrity: sha512-ppsKwpSjNrzJ8hge3Z3uiCcoRgAAQk2tU7auy3MFF348ffWRldFPnWIT/a/enK7huijlTfnwn4DYpDoapEb45A==} + '@rollup/rollup-linux-riscv64-gnu@4.67.4': + resolution: {integrity: sha512-uaqRFdfb8eIa2bVHN/FE3ndCvR0zV2xv0AwjCfxrqSu6l6fp/54VhjfhslKlf2RIik9L1jwlt4E56PeVX6tQtQ==} cpu: [riscv64] os: [linux] libc: [glibc] @@ -1968,8 +2145,8 @@ packages: os: [linux] libc: [musl] - '@rollup/rollup-linux-riscv64-musl@4.64.12': - resolution: {integrity: sha512-Gc3cVRC1trFH+GFWWTsJz6YuD4u75fzr/q99jqQGimonN/zvN6Wecck5WGzllOHj+XYXHcq0Ibor0tanGjfI6A==} + '@rollup/rollup-linux-riscv64-musl@4.67.4': + resolution: {integrity: sha512-JZRow7kmxUDEASnxHuVG5itTm+nTXi9BQUABcVUnUEngC+OPwMrpx1uJ9hIA/v+IcAEBL52ktCSPXk5OJn9Jqg==} cpu: [riscv64] os: [linux] libc: [musl] @@ -1980,26 +2157,26 @@ packages: os: [linux] libc: [glibc] - '@rollup/rollup-linux-s390x-gnu@4.64.12': - resolution: {integrity: sha512-pjmDTFStvwFE3shTeUDvSDiSp8/qAf5bQXejcEUDDavWz4jEhTIpCdpS06G0PEwSCSNK0Lngjz2v9l4hk3Z74A==} + '@rollup/rollup-linux-s390x-gnu@4.67.4': + resolution: {integrity: sha512-rdrh4e+Lq9fCNKoDPaCqeHXbQCe7yl77Ukl45tlSClwYdZ1gpFGZz1XLJdYtY++FRlfL5aHvb6/0n3GDW/Nxsw==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.60.4': - resolution: {integrity: sha512-Boiz5+MsaROEWDf+GGEwF8VMHGhlUoQMtIPjOgA5fv4osupqTVnJteQNKJwUcnUog2G55jYXH7KZFFiJe0TEzQ==} + '@rollup/rollup-linux-x64-gnu@4.24.0': + resolution: {integrity: sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.64.12': - resolution: {integrity: sha512-mkbjxPqpR91u1JD7xY4aLZhr/Mqka4/RqGcG4WNGgN/lC1o7TzyCyqJoSJXp9qVVxMwpJGFlEF1VlERb+Ghw1Q==} + '@rollup/rollup-linux-x64-gnu@4.60.4': + resolution: {integrity: sha512-Boiz5+MsaROEWDf+GGEwF8VMHGhlUoQMtIPjOgA5fv4osupqTVnJteQNKJwUcnUog2G55jYXH7KZFFiJe0TEzQ==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.64.5': - resolution: {integrity: sha512-dR9nd6OKnvSS60Ifz/L7Mj5zzYyoqyRn2NwTuaOONKaa3xsVGXyp8YusMbvFyEOR94DxnwgcbgsFqkHd29ZSzQ==} + '@rollup/rollup-linux-x64-gnu@4.67.4': + resolution: {integrity: sha512-wL7MS4r0fYcxluF3ne2plofHZiB/LsqNCnyaUlyiKpAJLb6agPSFz7DEFCfkonWAZXMrLwCmC08b2ZEnEdJkog==} cpu: [x64] os: [linux] libc: [glibc] @@ -2010,8 +2187,8 @@ packages: os: [linux] libc: [musl] - '@rollup/rollup-linux-x64-musl@4.64.12': - resolution: {integrity: sha512-vIeut2LkuVc3gcsawLJPahNAzvzBcFRhu2O+yVb//BuQKz7PIItMF0piXRbN/lIDO3d68TSDd368Vg6YwgTybw==} + '@rollup/rollup-linux-x64-musl@4.67.4': + resolution: {integrity: sha512-4H0XHfd2VufGjX7NjUyeue78sD0bRIoKSGjGqO+F5nSvL6jN48NAU7esdmtFEYxZXwObLtt3MJ/kHS0jASMW3g==} cpu: [x64] os: [linux] libc: [musl] @@ -2021,8 +2198,8 @@ packages: cpu: [x64] os: [openbsd] - '@rollup/rollup-openbsd-x64@4.64.12': - resolution: {integrity: sha512-3Sx+D3r9oPkTdNUcPrIRM2Am+vzEV6VGWoImHG4ZVK2jJeOW+eDjLeTm6nvu/z/m0fiX2YmGLXIypblc336MXg==} + '@rollup/rollup-openbsd-x64@4.67.4': + resolution: {integrity: sha512-osRHQbE55pZpCLetpMsFmhkapyZnAUH73qRKMh+npi3boUom6u6hdaTTPSxlInXxwJHsn9r2uDhdz0V7Yoxx2A==} cpu: [x64] os: [openbsd] @@ -2031,8 +2208,8 @@ packages: cpu: [arm64] os: [openharmony] - '@rollup/rollup-openharmony-arm64@4.64.12': - resolution: {integrity: sha512-Nn2xh0teFnl71EiiUrKvECWcdGXtWF8q0uGclYwXGVw6QClGAcME0/bJSGdK+xIvd6MLEKYmjkTUvCBV+7m5Kw==} + '@rollup/rollup-openharmony-arm64@4.67.4': + resolution: {integrity: sha512-95+exYEyOwrZePsE0czi4q7X5lxKPa21+lmyAZlwbYENITQ0Unk4HAQAFp/p+KhXBHBx9mUABXRYjOC5A1wY3Q==} cpu: [arm64] os: [openharmony] @@ -2041,8 +2218,8 @@ packages: cpu: [arm64] os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.64.12': - resolution: {integrity: sha512-n1/0H9TS+kBa4xp6n9aV7yiynBNfmerjkj2nAMIfY0ZHv1zShWRXnsAuAPAH0sfEK4ZSMK+z24q2RjAPFLCN1w==} + '@rollup/rollup-win32-arm64-msvc@4.67.4': + resolution: {integrity: sha512-FOXOcKhNQpO4Po+Ynan6IbtM67SrXZbgpRJWVYwz53CT5veI7sVzDwVBmWS65N5Imv+wK3SVhIPAl+C5DXXNCg==} cpu: [arm64] os: [win32] @@ -2051,8 +2228,8 @@ packages: cpu: [ia32] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.64.12': - resolution: {integrity: sha512-AdlDbQpsLfGlsHr1NfLZFtdnvxCKNp9TwlYVYExs8JJLWjLafUQEKJk0r9zUbmU57mw9nglMEvzqPHuLWYmaKw==} + '@rollup/rollup-win32-ia32-msvc@4.67.4': + resolution: {integrity: sha512-cklKh0gJOkAZQcWziQa3hrjxZKN+PCHZ7SPTyGJDAiBVr05ZXlEjGFCG7zFJMaVibxsmzAe1FimN4u/HBns9+Q==} cpu: [ia32] os: [win32] @@ -2061,8 +2238,8 @@ packages: cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.64.12': - resolution: {integrity: sha512-u5SSUJBHod51UamjkigSr+JPre6xMy5vaWTTV2K0SnFG4RuKyYpf66dTSLFKX2cwaldpwyBurXPUCxq8riQMEg==} + '@rollup/rollup-win32-x64-gnu@4.67.4': + resolution: {integrity: sha512-AegwxJPc9bvUp8fQtlsUHkFMOMkGylWU7glyL+YD4vwG+QaYoGXYLSsQoeTD7kvoLZrVlMWNVhTg1dedY5C1VQ==} cpu: [x64] os: [win32] @@ -2071,8 +2248,8 @@ packages: cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.64.12': - resolution: {integrity: sha512-j5rXD4R/4DM5+V991AA9xOnG2Rwu2g3p5TPgu1Eu7apju0NUrLl+Bn/KpWc6wYJtlXqzwz1r+LNV1JeBU4VGvw==} + '@rollup/rollup-win32-x64-msvc@4.67.4': + resolution: {integrity: sha512-RJZnrwTWj7Iq2ooBwoGbDdC65tDwYawneGcAfFMJqVUrRZMcskka6nTkBpXR/47G7kzn3EW2qupExnaBy11vwg==} cpu: [x64] os: [win32] @@ -2124,9 +2301,6 @@ packages: '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} - '@tanstack/query-core@5.101.4': - resolution: {integrity: sha512-gNwcvOJcRbLWPOLG/2OBm+zM+Yv+MKsXKEOWC57USuZDEsI71hEErQsiEGx5wX9rzWWkfwM0fVSPoiIFSsxfiw==} - '@tanstack/query-core@5.104.5': resolution: {integrity: sha512-Q94gI8Opd+CbdVNOdj8ZCyV8WqLYitrDq1t96Xc8WZT6lY0r5iRnJLXYDxMex7EEf2v+mXvn4FcjaBKSxXZQ9A==} @@ -2169,12 +2343,12 @@ packages: '@types/deep-eql@4.0.2': resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/estree@1.0.10': + resolution: {integrity: sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==} + '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - '@types/estree@1.0.9': - resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} - '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -2207,20 +2381,20 @@ packages: resolution: {integrity: sha512-VYNCgUc0nOmC4WJmWw9GkrKdfr8Zl4/rxhC5SvgacBgxiW9W/9NRttUoHHXV8xdII3MaRgkZZVX8Ikzc/Jmjag==} engines: {node: '>=14'} - '@vitest/coverage-v8@4.1.11': - resolution: {integrity: sha512-8MVGEFnJIcdGjcbfKmeq8z0pZHH0JlVtoVZH9Q/qwUp6wyFnEJUBMrw9DCaj+ra3vShGmhavjalMIhPNxZAUcw==} + '@vitest/coverage-v8@4.1.12': + resolution: {integrity: sha512-6S7/iVknKglLAxMFxQGNppBI0iqJS2NgM6FBxavitj7KaDq/vywOWGf6dGu7F2L1Qy0G6S3uTp7aGshHrzK8JA==} peerDependencies: - '@vitest/browser': 4.1.11 - vitest: 4.1.11 + '@vitest/browser': 4.1.12 + vitest: 4.1.12 peerDependenciesMeta: '@vitest/browser': optional: true - '@vitest/expect@4.1.11': - resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==} + '@vitest/expect@4.1.12': + resolution: {integrity: sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ==} - '@vitest/mocker@4.1.11': - resolution: {integrity: sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==} + '@vitest/mocker@4.1.12': + resolution: {integrity: sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA==} peerDependencies: msw: ^2.4.9 vite: ~7.3.7 @@ -2230,20 +2404,20 @@ packages: vite: optional: true - '@vitest/pretty-format@4.1.11': - resolution: {integrity: sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==} + '@vitest/pretty-format@4.1.12': + resolution: {integrity: sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA==} - '@vitest/runner@4.1.11': - resolution: {integrity: sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==} + '@vitest/runner@4.1.12': + resolution: {integrity: sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w==} - '@vitest/snapshot@4.1.11': - resolution: {integrity: sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==} + '@vitest/snapshot@4.1.12': + resolution: {integrity: sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw==} - '@vitest/spy@4.1.11': - resolution: {integrity: sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==} + '@vitest/spy@4.1.12': + resolution: {integrity: sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg==} - '@vitest/utils@4.1.11': - resolution: {integrity: sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==} + '@vitest/utils@4.1.12': + resolution: {integrity: sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA==} accepts@2.0.0: resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} @@ -2295,11 +2469,11 @@ packages: argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - arkregex@0.0.13: - resolution: {integrity: sha512-c17sqCqiiZauxyoU1KZ2zbzCgeghGmc8dR2CrdQnlEtpq3bLhRLoLrxTL52M/8yQD8e/i1/IBRpRCNAuqJa7xQ==} + arkregex@0.0.14: + resolution: {integrity: sha512-G3I/uCtWE0IKQiPh0qqmmAFDdtjZKZQ5mNPR6gJBeAMZ7VqYCpoaDeXnLju2Zo6ywExtmxZJELeVFb0MPDjPyA==} - arktype@2.2.8: - resolution: {integrity: sha512-tZyLza7kO2vN8BXBKcj4t43IVMe8/ZyqlITH0chZv7FfEw+edLovpY922tqcK4mCjTpf4oNo2xV6np7tquP1ww==} + arktype@2.2.9: + resolution: {integrity: sha512-Cja0IMEn19rB35on9da1i1z6QMasuS7ULffXbetCry09jvCGYT8Bi1KgYiqri5FymF4nQAXkM90yksYkgSK2EA==} array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} @@ -2320,8 +2494,8 @@ packages: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} - body-parser@2.3.0: - resolution: {integrity: sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==} + body-parser@2.4.0: + resolution: {integrity: sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==} engines: {node: '>=18'} brace-expansion@5.0.12: @@ -2422,8 +2596,8 @@ packages: resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} engines: {node: ^14.18.0 || >=16.10.0} - content-disposition@1.1.0: - resolution: {integrity: sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==} + content-disposition@2.0.1: + resolution: {integrity: sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==} engines: {node: '>=18'} content-type@1.0.5: @@ -2694,8 +2868,8 @@ packages: peerDependencies: express: '>= 4.11' - express@5.2.1: - resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} + express@5.3.0: + resolution: {integrity: sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==} engines: {node: '>= 18'} exsolve@1.0.8: @@ -2724,8 +2898,8 @@ packages: fast-string-width@3.0.2: resolution: {integrity: sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==} - fast-uri@3.1.8: - resolution: {integrity: sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==} + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} fast-wrap-ansi@0.2.2: resolution: {integrity: sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==} @@ -2821,8 +2995,8 @@ packages: glob-to-regexp@0.4.1: resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==} - glob@13.0.6: - resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==} + glob@14.0.3: + resolution: {integrity: sha512-A1vjIwC3qpdCso45Iw127gnp7sPhqgY8lUQhDrArIs+GbmfaaVPFuoyy7WyLT9EPZCRZ7j7aLdwUhQmHWesEow==} engines: {node: 18 || 20 || >=22} globby@11.1.0: @@ -2848,8 +3022,8 @@ packages: resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} engines: {node: '>= 0.4'} - hono@4.13.13: - resolution: {integrity: sha512-CQ46U0ZkAGmbT/4UxdzzGJpacP2IeKgY4a5/tOI9AABbpOMfK739wfDXmv1usCk+3RkKj1hQy4/fjhiwa2xlrA==} + hono@4.13.14: + resolution: {integrity: sha512-yhRLQ21U6qa9Hsu2N7Qcbh8tE+WKEcoErjIo56LeSGiGXGp9sA7UpE86Ui9uexb61KakiGwuHMn2QdV7w6i6kQ==} engines: {node: '>=16.9.0'} html-escaper@2.0.2: @@ -2882,8 +3056,8 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - ip-address@10.7.3: - resolution: {integrity: sha512-A1kdq/tSb5QjvKvAMgIoEvDBIgL7qaqVP/jkvSwYYRZ9iEzvPpopxp2wQfu3SuZRHtpHNxMn8Fs0bS+gf5Xmwg==} + ip-address@10.7.5: + resolution: {integrity: sha512-t2v0rkILYv9WXmSL7TpAaU3HXgaFYOPUcH3QHgwQ++gpJuH3bqyMy4Fvt/DJCTKwzH3Cf+bAp5W/mFL39KPLzA==} engines: {node: '>= 12'} ipaddr.js@1.9.1: @@ -2948,8 +3122,8 @@ packages: resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} hasBin: true - jose@6.2.12: - resolution: {integrity: sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw==} + jose@6.2.14: + resolution: {integrity: sha512-3JasLuki1NRLQvY4wCoC37KZk4qxoBx2k2aFqLxT84IezqW0bkJKnNtxnZj/Fu1xsQivoc/lytxaRHJoGLjJ1A==} joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} @@ -3127,9 +3301,9 @@ packages: resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} engines: {node: '>=18'} - minimatch@10.2.5: - resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} - engines: {node: 18 || 20 || >=22} + minimatch@11.0.4: + resolution: {integrity: sha512-/UJ1dEoVQTjPNDh6SGlUo+ueLMmoHTas4q+8yaAR/5t6nLAIiBDJtoYUh20IYleix7ehiQkgczb84PE3uzHkxg==} + engines: {node: 20 || >=22} minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -3206,8 +3380,8 @@ packages: ohash@2.0.11: resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==} - on-finished@2.4.1: - resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + on-finished@2.4.2: + resolution: {integrity: sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==} engines: {node: '>= 0.8'} once@1.4.0: @@ -3265,8 +3439,8 @@ packages: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} engines: {node: '>=12'} - path-scurry@2.0.2: - resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} + path-scurry@3.0.0: + resolution: {integrity: sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==} engines: {node: 18 || 20 || >=22} path-to-regexp@8.4.2: @@ -3340,10 +3514,6 @@ packages: resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} engines: {node: '>=8.6'} - picomatch@4.0.4: - resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} - engines: {node: '>=12'} - picomatch@4.0.7: resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} engines: {node: '>=12'} @@ -3392,6 +3562,10 @@ packages: resolution: {integrity: sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==} engines: {node: ^10 || ^12 || >=14} + postcss@8.5.32: + resolution: {integrity: sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==} + engines: {node: ^10 || ^12 || >=14} + postgres-array@2.0.0: resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} engines: {node: '>=4'} @@ -3412,12 +3586,15 @@ packages: resolution: {integrity: sha512-GD3qdB0x1z9xgFI6cdRD6xu2Sp2WCOEoe3mtnyB5Ee0XrrL5Pe+e4CCnJrRMnL1zYtRDZmQQVbvOttLnKDLnaw==} engines: {node: '>=12'} - posthog-node@5.55.2: - resolution: {integrity: sha512-iDAleFns2KSEr67i1/DQ5qxseJHp5t3zhk6UHr+48vualuB1QvresneO25Qmv29fzTDmunS/JCPNcpaP9/QmKg==} + posthog-node@5.61.1: + resolution: {integrity: sha512-Az2H3hHyxxZ5PQpQAQEoJfa9FrLsM4OnuyIQwzi9hei5mtN0/mepw1yvLtAmPAbEkC6+muWXiBShBnVMKeBSXw==} engines: {node: ^20.20.0 || >=22.22.0} peerDependencies: + '@opentelemetry/api': ^1.2.0 rxjs: ^7.0.0 peerDependenciesMeta: + '@opentelemetry/api': + optional: true rxjs: optional: true @@ -3447,8 +3624,8 @@ packages: pure-rand@8.4.2: resolution: {integrity: sha512-vvuOGgcuPJAirlHvuQw1TrOiw7ptaIXXmIbNuiNOY6lNGJJH49PQ1Kj4nd783nPdQhQdicgOjVI2yI/9BD6/Ng==} - qs@6.16.0: - resolution: {integrity: sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==} + qs@6.16.1: + resolution: {integrity: sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==} engines: {node: '>=0.6'} quansync@0.2.11: @@ -3501,8 +3678,8 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rimraf@6.1.3: - resolution: {integrity: sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==} + rimraf@6.1.4: + resolution: {integrity: sha512-Fk3reQDVPZUMbEm7Zwxz03BWQMW3V5buSk9aU8OckTrO8A1nQtbqvYsAantGNermwsIsXcuOBqcoJ3HuMELctw==} engines: {node: 20 || >=22} hasBin: true @@ -3511,8 +3688,8 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rollup@4.64.12: - resolution: {integrity: sha512-GhAu8ZglZ61VWSX/ZW3K/qkazgURBIQL0/Yy51QsS8DPyebR5Cf/Z2PANJFpTU0aVZ9byJcyqR6xvBbkXhdGYQ==} + rollup@4.67.4: + resolution: {integrity: sha512-Lsv3oKcz5jgOQJej/p7nfwbVEdAbDT+z6OPf/SCdI+nF+q2ENp0pTKT35ZwXAmH8g45mfrIiJeEyAqKYSYoL9Q==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3810,6 +3987,10 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} + uuid@14.0.0: + resolution: {integrity: sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==} + hasBin: true + uuid@14.0.3: resolution: {integrity: sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw==} hasBin: true @@ -3858,20 +4039,20 @@ packages: yaml: optional: true - vitest@4.1.11: - resolution: {integrity: sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==} + vitest@4.1.12: + resolution: {integrity: sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA==} engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@opentelemetry/api': ^1.9.0 '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 - '@vitest/browser-playwright': 4.1.11 - '@vitest/browser-preview': 4.1.11 - '@vitest/browser-webdriverio': 4.1.11 - '@vitest/coverage-istanbul': 4.1.11 - '@vitest/coverage-v8': 4.1.11 - '@vitest/ui': 4.1.11 + '@vitest/browser-playwright': 4.1.12 + '@vitest/browser-preview': 4.1.12 + '@vitest/browser-webdriverio': ^4.1.11 + '@vitest/coverage-istanbul': 4.1.12 + '@vitest/coverage-v8': 4.1.12 + '@vitest/ui': 4.1.12 happy-dom: '*' jsdom: '*' vite: ~7.3.7 @@ -3961,47 +4142,48 @@ packages: snapshots: - '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.296': + '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.316': optional: true - '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.296': + '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.316': optional: true - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.296': + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.316': optional: true - '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.296': + '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.316': optional: true - '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.296': + '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.316': optional: true - '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.296': + '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.316': optional: true - '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.296': + '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.316': optional: true - '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.296': + '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.316': optional: true - '@anthropic-ai/claude-agent-sdk@0.3.296(@anthropic-ai/sdk@0.133.0(zod@3.25.76))(@modelcontextprotocol/sdk@1.32.1(zod@3.25.76))(zod@3.25.76)': + '@anthropic-ai/claude-agent-sdk@0.3.316(@anthropic-ai/sdk@0.137.0(zod@3.25.76))(@modelcontextprotocol/sdk@1.32.2(zod@3.25.76))(zod@3.25.76)': dependencies: - '@anthropic-ai/sdk': 0.133.0(zod@3.25.76) - '@modelcontextprotocol/sdk': 1.32.1(zod@3.25.76) + '@anthropic-ai/sdk': 0.137.0(zod@3.25.76) + '@modelcontextprotocol/sdk': 1.32.2(zod@3.25.76) zod: 3.25.76 optionalDependencies: - '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.296 - '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.296 - '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.296 - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.296 - '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.296 - '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.296 - '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.296 - '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.296 - - '@anthropic-ai/sdk@0.133.0(zod@3.25.76)': - dependencies: + '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.316 + '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.316 + '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.316 + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.316 + '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.316 + '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.316 + '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.316 + '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.316 + + '@anthropic-ai/sdk@0.137.0(zod@3.25.76)': + dependencies: + '@opentelemetry/api': 1.10.0 json-schema-to-ts: 3.1.1 standardwebhooks: 1.1.1 optionalDependencies: @@ -4013,11 +4195,11 @@ snapshots: '@types/json-schema': 7.0.15 js-yaml: 4.3.2 - '@ark/schema@0.56.7': + '@ark/schema@0.56.8': dependencies: - '@ark/util': 0.56.7 + '@ark/util': 0.56.8 - '@ark/util@0.56.7': {} + '@ark/util@0.56.8': {} '@babel/helper-string-parser@7.29.7': {} @@ -4038,39 +4220,47 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} - '@biomejs/biome@2.5.15': + '@biomejs/biome@2.6.4': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.5.15 - '@biomejs/cli-darwin-x64': 2.5.15 - '@biomejs/cli-linux-arm64': 2.5.15 - '@biomejs/cli-linux-arm64-musl': 2.5.15 - '@biomejs/cli-linux-x64': 2.5.15 - '@biomejs/cli-linux-x64-musl': 2.5.15 - '@biomejs/cli-win32-arm64': 2.5.15 - '@biomejs/cli-win32-x64': 2.5.15 + '@biomejs/cli-android-arm64': 2.6.4 + '@biomejs/cli-android-x64': 2.6.4 + '@biomejs/cli-darwin-arm64': 2.6.4 + '@biomejs/cli-darwin-x64': 2.6.4 + '@biomejs/cli-linux-arm64': 2.6.4 + '@biomejs/cli-linux-arm64-musl': 2.6.4 + '@biomejs/cli-linux-x64': 2.6.4 + '@biomejs/cli-linux-x64-musl': 2.6.4 + '@biomejs/cli-win32-arm64': 2.6.4 + '@biomejs/cli-win32-x64': 2.6.4 + + '@biomejs/cli-android-arm64@2.6.4': + optional: true + + '@biomejs/cli-android-x64@2.6.4': + optional: true - '@biomejs/cli-darwin-arm64@2.5.15': + '@biomejs/cli-darwin-arm64@2.6.4': optional: true - '@biomejs/cli-darwin-x64@2.5.15': + '@biomejs/cli-darwin-x64@2.6.4': optional: true - '@biomejs/cli-linux-arm64-musl@2.5.15': + '@biomejs/cli-linux-arm64-musl@2.6.4': optional: true - '@biomejs/cli-linux-arm64@2.5.15': + '@biomejs/cli-linux-arm64@2.6.4': optional: true - '@biomejs/cli-linux-x64-musl@2.5.15': + '@biomejs/cli-linux-x64-musl@2.6.4': optional: true - '@biomejs/cli-linux-x64@2.5.15': + '@biomejs/cli-linux-x64@2.6.4': optional: true - '@biomejs/cli-win32-arm64@2.5.15': + '@biomejs/cli-win32-arm64@2.6.4': optional: true - '@biomejs/cli-win32-x64@2.5.15': + '@biomejs/cli-win32-x64@2.6.4': optional: true '@byteslice/result@0.2.0': {} @@ -4220,8 +4410,139 @@ snapshots: human-id: 4.2.0 prettier: 2.8.8 + '@cipherstash/auth-darwin-arm64@0.41.0': + optional: true + + '@cipherstash/auth-darwin-x64@0.41.0': + optional: true + + '@cipherstash/auth-linux-arm64-gnu@0.41.0': + optional: true + + '@cipherstash/auth-linux-x64-gnu@0.41.0': + optional: true + + '@cipherstash/auth-linux-x64-musl@0.41.0': + optional: true + + '@cipherstash/auth-win32-x64-msvc@0.41.0': + optional: true + + '@cipherstash/auth@0.41.0(@cipherstash/auth-darwin-arm64@0.41.0)(@cipherstash/auth-darwin-x64@0.41.0)(@cipherstash/auth-linux-arm64-gnu@0.41.0)(@cipherstash/auth-linux-x64-gnu@0.41.0)(@cipherstash/auth-linux-x64-musl@0.41.0)(@cipherstash/auth-win32-x64-msvc@0.41.0)': + dependencies: + '@byteslice/result': 0.3.0 + optionalDependencies: + '@cipherstash/auth-darwin-arm64': 0.41.0 + '@cipherstash/auth-darwin-x64': 0.41.0 + '@cipherstash/auth-linux-arm64-gnu': 0.41.0 + '@cipherstash/auth-linux-x64-gnu': 0.41.0 + '@cipherstash/auth-linux-x64-musl': 0.41.0 + '@cipherstash/auth-win32-x64-msvc': 0.41.0 + '@cipherstash/eql@3.0.2': {} + '@cipherstash/protect-dynamodb@6.0.1(@cipherstash/protect@10.2.1)': + dependencies: + '@byteslice/result': 0.2.0 + '@cipherstash/protect': 10.2.1 + + '@cipherstash/protect-ffi-darwin-arm64@0.18.1': + optional: true + + '@cipherstash/protect-ffi-darwin-arm64@0.28.0': + optional: true + + '@cipherstash/protect-ffi-darwin-x64@0.18.1': + optional: true + + '@cipherstash/protect-ffi-darwin-x64@0.28.0': + optional: true + + '@cipherstash/protect-ffi-linux-arm64-gnu@0.18.1': + optional: true + + '@cipherstash/protect-ffi-linux-arm64-gnu@0.28.0': + optional: true + + '@cipherstash/protect-ffi-linux-x64-gnu@0.18.1': + optional: true + + '@cipherstash/protect-ffi-linux-x64-gnu@0.28.0': + optional: true + + '@cipherstash/protect-ffi-linux-x64-musl@0.18.1': + optional: true + + '@cipherstash/protect-ffi-linux-x64-musl@0.28.0': + optional: true + + '@cipherstash/protect-ffi-win32-x64-msvc@0.18.1': + optional: true + + '@cipherstash/protect-ffi-win32-x64-msvc@0.28.0': + optional: true + + '@cipherstash/protect-ffi@0.18.1': + dependencies: + '@neon-rs/load': 0.1.82 + optionalDependencies: + '@cipherstash/protect-ffi-darwin-arm64': 0.18.1 + '@cipherstash/protect-ffi-darwin-x64': 0.18.1 + '@cipherstash/protect-ffi-linux-arm64-gnu': 0.18.1 + '@cipherstash/protect-ffi-linux-x64-gnu': 0.18.1 + '@cipherstash/protect-ffi-linux-x64-musl': 0.18.1 + '@cipherstash/protect-ffi-win32-x64-msvc': 0.18.1 + + '@cipherstash/protect-ffi@0.28.0': + dependencies: + '@neon-rs/load': 0.1.82 + optionalDependencies: + '@cipherstash/protect-ffi-darwin-arm64': 0.28.0 + '@cipherstash/protect-ffi-darwin-x64': 0.28.0 + '@cipherstash/protect-ffi-linux-arm64-gnu': 0.28.0 + '@cipherstash/protect-ffi-linux-x64-gnu': 0.28.0 + '@cipherstash/protect-ffi-linux-x64-musl': 0.28.0 + '@cipherstash/protect-ffi-win32-x64-msvc': 0.28.0 + + '@cipherstash/protect@10.2.1': + dependencies: + '@byteslice/result': 0.2.0 + '@cipherstash/protect-ffi': 0.18.1 + '@cipherstash/schema': 2.0.2 + zod: 3.25.76 + optionalDependencies: + '@rollup/rollup-linux-x64-gnu': 4.24.0 + + '@cipherstash/schema@2.0.2': + dependencies: + zod: 3.25.76 + + '@cipherstash/stack@0.19.0(@supabase/supabase-js@2.118.0(@opentelemetry/api@1.10.0))(drizzle-orm@0.45.4(@opentelemetry/api@1.10.0)(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9))(next@15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3)': + dependencies: + '@byteslice/result': 0.2.0 + '@cipherstash/auth': 0.41.0(@cipherstash/auth-darwin-arm64@0.41.0)(@cipherstash/auth-darwin-x64@0.41.0)(@cipherstash/auth-linux-arm64-gnu@0.41.0)(@cipherstash/auth-linux-x64-gnu@0.41.0)(@cipherstash/auth-linux-x64-musl@0.41.0)(@cipherstash/auth-win32-x64-msvc@0.41.0) + '@cipherstash/protect-ffi': 0.28.0 + evlog: 1.11.0(next@15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3) + uuid: 14.0.0 + zod: 3.25.76 + optionalDependencies: + '@cipherstash/auth-darwin-arm64': 0.41.0 + '@cipherstash/auth-darwin-x64': 0.41.0 + '@cipherstash/auth-linux-arm64-gnu': 0.41.0 + '@cipherstash/auth-linux-x64-gnu': 0.41.0 + '@cipherstash/auth-linux-x64-musl': 0.41.0 + '@cipherstash/auth-win32-x64-msvc': 0.41.0 + '@supabase/supabase-js': 2.118.0(@opentelemetry/api@1.10.0) + drizzle-orm: 0.45.4(@opentelemetry/api@1.10.0)(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9) + transitivePeerDependencies: + - '@nuxt/kit' + - h3 + - next + - nitro + - nitropack + - ofetch + - react + '@clack/core@1.5.1': dependencies: fast-wrap-ansi: 0.2.2 @@ -4234,53 +4555,31 @@ snapshots: fast-wrap-ansi: 0.2.2 sisteransi: 1.0.5 - '@clerk/backend@3.23.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/backend@3.26.5(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: - '@clerk/shared': 4.41.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/shared': 4.43.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3) standardwebhooks: 1.1.1 - tslib: 2.8.1 transitivePeerDependencies: - react - react-dom - '@clerk/backend@3.26.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/nextjs@7.9.23(next@15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: - '@clerk/shared': 4.41.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - standardwebhooks: 1.1.1 - tslib: 2.8.1 - transitivePeerDependencies: - - react - - react-dom - - '@clerk/nextjs@7.9.14(next@15.5.28(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': - dependencies: - '@clerk/backend': 3.23.2(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@clerk/react': 6.17.8(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@clerk/shared': 4.40.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - next: 15.5.28(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/backend': 3.26.5(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/react': 6.18.4(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/shared': 4.43.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + next: 15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) react: 19.2.3 react-dom: 19.2.3(react@19.2.3) server-only: 0.0.1 - tslib: 2.8.1 - '@clerk/react@6.17.8(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/react@6.18.4(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: - '@clerk/shared': 4.41.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@clerk/shared': 4.43.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3) react: 19.2.3 react-dom: 19.2.3(react@19.2.3) - tslib: 2.8.1 - '@clerk/shared@4.40.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': - dependencies: - '@tanstack/query-core': 5.101.4 - dequal: 2.0.3 - glob-to-regexp: 0.4.1 - js-cookie: 3.0.8 - optionalDependencies: - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - - '@clerk/shared@4.41.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@clerk/shared@4.43.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: '@tanstack/query-core': 5.104.5 dequal: 2.0.3 @@ -4451,9 +4750,9 @@ snapshots: '@esbuild/win32-x64@0.28.2': optional: true - '@hono/node-server@2.1.3(hono@4.13.13)': + '@hono/node-server@2.1.5(hono@4.13.14)': dependencies: - hono: 4.13.13 + hono: 4.13.14 '@img/colour@1.1.0': optional: true @@ -4569,6 +4868,8 @@ snapshots: optionalDependencies: '@types/node': 22.20.5 + '@isaacs/nonrecursive-glob-match@1.0.3': {} + '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -4607,9 +4908,9 @@ snapshots: globby: 11.1.0 read-yaml-file: 1.1.0 - '@modelcontextprotocol/sdk@1.32.1(zod@3.25.76)': + '@modelcontextprotocol/sdk@1.32.2(zod@3.25.76)': dependencies: - '@hono/node-server': 2.1.3(hono@4.13.13) + '@hono/node-server': 2.1.5(hono@4.13.14) ajv: 8.20.0 ajv-formats: 3.0.1(ajv@8.20.0) content-type: 1.0.5 @@ -4617,10 +4918,10 @@ snapshots: cross-spawn: 7.0.6 eventsource: 3.0.7 eventsource-parser: 3.1.1 - express: 5.2.1 - express-rate-limit: 8.7.1(express@5.2.1) - hono: 4.13.13 - jose: 6.2.12 + express: 5.3.0 + express-rate-limit: 8.7.1(express@5.3.0) + hono: 4.13.14 + jose: 6.2.14 json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 raw-body: 3.0.2 @@ -4636,6 +4937,8 @@ snapshots: '@neon-rs/cli@0.2.6': {} + '@neon-rs/load@0.1.82': {} + '@neon-rs/load@0.2.6': {} '@next/env@15.5.28': {} @@ -4678,21 +4981,23 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.20.1 + '@opentelemetry/api@1.10.0': {} + '@petamoriken/float16@3.9.3': optional: true - '@posthog/core@1.58.0': + '@posthog/core@1.62.0': dependencies: - '@posthog/types': 1.415.2 + '@posthog/types': 1.419.0 - '@posthog/types@1.415.2': {} + '@posthog/types@1.419.0': {} '@prisma/orm-family-sql@0.17.0(magicast@0.5.4)(typanion@3.14.0)(typescript@5.9.3)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1))': dependencies: '@prisma/orm-framework': 0.17.0(typescript@5.9.3) '@prisma/orm-toolchain': 0.17.0(magicast@0.5.4)(typanion@3.14.0)(typescript@5.9.3)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) '@standard-schema/spec': 1.1.0 - arktype: 2.2.8 + arktype: 2.2.9 pathe: 2.0.3 pluralize: 8.0.0 ts-toolbelt: 9.6.0 @@ -4708,7 +5013,7 @@ snapshots: '@prisma/orm-framework': 0.17.0(typescript@5.9.3) '@prisma/orm-toolchain': 0.17.0(typescript@5.9.3)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) '@standard-schema/spec': 1.1.0 - arktype: 2.2.8 + arktype: 2.2.9 pathe: 2.0.3 pluralize: 8.0.0 ts-toolbelt: 9.6.0 @@ -4722,7 +5027,7 @@ snapshots: '@prisma/orm-framework@0.17.0(typescript@5.9.3)': dependencies: '@standard-schema/spec': 1.1.0 - arktype: 2.2.8 + arktype: 2.2.9 pathe: 2.0.3 uniku: 0.4.3 optionalDependencies: @@ -4752,7 +5057,7 @@ snapshots: '@prisma/orm-toolchain': 0.17.0(magicast@0.5.4)(typanion@3.14.0)(typescript@5.9.3)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) '@standard-schema/spec': 1.1.0 '@types/pg': 8.20.0 - arktype: 2.2.8 + arktype: 2.2.9 pathe: 2.0.3 pg: 8.22.0 pg-cursor: 2.21.0(pg@8.22.0) @@ -4771,7 +5076,7 @@ snapshots: '@prisma/orm-toolchain': 0.17.0(typescript@5.9.3)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) '@standard-schema/spec': 1.1.0 '@types/pg': 8.20.0 - arktype: 2.2.8 + arktype: 2.2.9 pathe: 2.0.3 pg: 8.22.0 pg-cursor: 2.21.0(pg@8.22.0) @@ -4788,7 +5093,7 @@ snapshots: '@clack/prompts': 1.8.1 '@prisma/orm-framework': 0.17.0(typescript@5.9.3) '@vercel/detect-agent': 1.2.3 - arktype: 2.2.8 + arktype: 2.2.9 c12: 3.3.4(magicast@0.5.4) ci-info: 4.4.0 clipanion: 4.0.0-rc.4(typanion@3.14.0) @@ -4817,7 +5122,7 @@ snapshots: '@clack/prompts': 1.8.1 '@prisma/orm-framework': 0.17.0(typescript@5.9.3) '@vercel/detect-agent': 1.2.3 - arktype: 2.2.8 + arktype: 2.2.9 c12: 3.3.4(magicast@0.5.4) ci-info: 4.4.0 clipanion: 4.0.0-rc.4(typanion@3.14.0) @@ -4844,154 +5149,157 @@ snapshots: '@rollup/rollup-android-arm-eabi@4.60.4': optional: true - '@rollup/rollup-android-arm-eabi@4.64.12': + '@rollup/rollup-android-arm-eabi@4.67.4': optional: true '@rollup/rollup-android-arm64@4.60.4': optional: true - '@rollup/rollup-android-arm64@4.64.12': + '@rollup/rollup-android-arm64@4.67.4': + optional: true + + '@rollup/rollup-android-x64@4.67.4': optional: true '@rollup/rollup-darwin-arm64@4.60.4': optional: true - '@rollup/rollup-darwin-arm64@4.64.12': + '@rollup/rollup-darwin-arm64@4.67.4': optional: true '@rollup/rollup-darwin-x64@4.60.4': optional: true - '@rollup/rollup-darwin-x64@4.64.12': + '@rollup/rollup-darwin-x64@4.67.4': optional: true '@rollup/rollup-freebsd-arm64@4.60.4': optional: true - '@rollup/rollup-freebsd-arm64@4.64.12': + '@rollup/rollup-freebsd-arm64@4.67.4': optional: true '@rollup/rollup-freebsd-x64@4.60.4': optional: true - '@rollup/rollup-freebsd-x64@4.64.12': + '@rollup/rollup-freebsd-x64@4.67.4': optional: true '@rollup/rollup-linux-arm-gnueabihf@4.60.4': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.64.12': + '@rollup/rollup-linux-arm-gnueabihf@4.67.4': optional: true '@rollup/rollup-linux-arm-musleabihf@4.60.4': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.64.12': + '@rollup/rollup-linux-arm-musleabihf@4.67.4': optional: true '@rollup/rollup-linux-arm64-gnu@4.60.4': optional: true - '@rollup/rollup-linux-arm64-gnu@4.64.12': + '@rollup/rollup-linux-arm64-gnu@4.67.4': optional: true '@rollup/rollup-linux-arm64-musl@4.60.4': optional: true - '@rollup/rollup-linux-arm64-musl@4.64.12': + '@rollup/rollup-linux-arm64-musl@4.67.4': optional: true '@rollup/rollup-linux-loong64-gnu@4.60.4': optional: true - '@rollup/rollup-linux-loong64-gnu@4.64.12': + '@rollup/rollup-linux-loong64-gnu@4.67.4': optional: true '@rollup/rollup-linux-loong64-musl@4.60.4': optional: true - '@rollup/rollup-linux-loong64-musl@4.64.12': + '@rollup/rollup-linux-loong64-musl@4.67.4': optional: true '@rollup/rollup-linux-ppc64-gnu@4.60.4': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.64.12': + '@rollup/rollup-linux-ppc64-gnu@4.67.4': optional: true '@rollup/rollup-linux-ppc64-musl@4.60.4': optional: true - '@rollup/rollup-linux-ppc64-musl@4.64.12': + '@rollup/rollup-linux-ppc64-musl@4.67.4': optional: true '@rollup/rollup-linux-riscv64-gnu@4.60.4': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.64.12': + '@rollup/rollup-linux-riscv64-gnu@4.67.4': optional: true '@rollup/rollup-linux-riscv64-musl@4.60.4': optional: true - '@rollup/rollup-linux-riscv64-musl@4.64.12': + '@rollup/rollup-linux-riscv64-musl@4.67.4': optional: true '@rollup/rollup-linux-s390x-gnu@4.60.4': optional: true - '@rollup/rollup-linux-s390x-gnu@4.64.12': + '@rollup/rollup-linux-s390x-gnu@4.67.4': optional: true - '@rollup/rollup-linux-x64-gnu@4.60.4': + '@rollup/rollup-linux-x64-gnu@4.24.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.64.12': + '@rollup/rollup-linux-x64-gnu@4.60.4': optional: true - '@rollup/rollup-linux-x64-gnu@4.64.5': + '@rollup/rollup-linux-x64-gnu@4.67.4': optional: true '@rollup/rollup-linux-x64-musl@4.60.4': optional: true - '@rollup/rollup-linux-x64-musl@4.64.12': + '@rollup/rollup-linux-x64-musl@4.67.4': optional: true '@rollup/rollup-openbsd-x64@4.60.4': optional: true - '@rollup/rollup-openbsd-x64@4.64.12': + '@rollup/rollup-openbsd-x64@4.67.4': optional: true '@rollup/rollup-openharmony-arm64@4.60.4': optional: true - '@rollup/rollup-openharmony-arm64@4.64.12': + '@rollup/rollup-openharmony-arm64@4.67.4': optional: true '@rollup/rollup-win32-arm64-msvc@4.60.4': optional: true - '@rollup/rollup-win32-arm64-msvc@4.64.12': + '@rollup/rollup-win32-arm64-msvc@4.67.4': optional: true '@rollup/rollup-win32-ia32-msvc@4.60.4': optional: true - '@rollup/rollup-win32-ia32-msvc@4.64.12': + '@rollup/rollup-win32-ia32-msvc@4.67.4': optional: true '@rollup/rollup-win32-x64-gnu@4.60.4': optional: true - '@rollup/rollup-win32-x64-gnu@4.64.12': + '@rollup/rollup-win32-x64-gnu@4.67.4': optional: true '@rollup/rollup-win32-x64-msvc@4.60.4': optional: true - '@rollup/rollup-win32-x64-msvc@4.64.12': + '@rollup/rollup-win32-x64-msvc@4.67.4': optional: true '@sec-ant/readable-stream@0.4.1': {} @@ -5026,20 +5334,20 @@ snapshots: iceberg-js: 0.8.1 tslib: 2.8.1 - '@supabase/supabase-js@2.118.0': + '@supabase/supabase-js@2.118.0(@opentelemetry/api@1.10.0)': dependencies: '@supabase/auth-js': 2.118.0 '@supabase/functions-js': 2.118.0 '@supabase/postgrest-js': 2.118.0 '@supabase/realtime-js': 2.118.0 '@supabase/storage-js': 2.118.0 + optionalDependencies: + '@opentelemetry/api': 1.10.0 '@swc/helpers@0.5.15': dependencies: tslib: 2.8.1 - '@tanstack/query-core@5.101.4': {} - '@tanstack/query-core@5.104.5': {} '@tsconfig/node22@22.0.6': {} @@ -5069,9 +5377,9 @@ snapshots: '@types/deep-eql@4.0.2': {} - '@types/estree@1.0.8': {} + '@types/estree@1.0.10': {} - '@types/estree@1.0.9': {} + '@types/estree@1.0.8': {} '@types/json-schema@7.0.15': {} @@ -5108,10 +5416,10 @@ snapshots: '@vercel/detect-agent@1.2.3': {} - '@vitest/coverage-v8@4.1.11(vitest@4.1.11)': + '@vitest/coverage-v8@4.1.12(vitest@4.1.12)': dependencies: '@bcoe/v8-coverage': 1.0.2 - '@vitest/utils': 4.1.11 + '@vitest/utils': 4.1.12 ast-v8-to-istanbul: 1.0.6 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 @@ -5120,54 +5428,54 @@ snapshots: obug: 2.2.1 std-env: 4.2.0 tinyrainbow: 3.1.1 - vitest: 4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + vitest: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) - '@vitest/expect@4.1.11': + '@vitest/expect@4.1.12': dependencies: '@standard-schema/spec': 1.1.0 '@types/chai': 5.2.3 - '@vitest/spy': 4.1.11 - '@vitest/utils': 4.1.11 + '@vitest/spy': 4.1.12 + '@vitest/utils': 4.1.12 chai: 6.2.2 tinyrainbow: 3.1.1 - '@vitest/mocker@4.1.11(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1))': + '@vitest/mocker@4.1.12(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1))': dependencies: - '@vitest/spy': 4.1.11 + '@vitest/spy': 4.1.12 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: vite: 7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1) - '@vitest/mocker@4.1.11(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1))': + '@vitest/mocker@4.1.12(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1))': dependencies: - '@vitest/spy': 4.1.11 + '@vitest/spy': 4.1.12 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: vite: 7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1) - '@vitest/pretty-format@4.1.11': + '@vitest/pretty-format@4.1.12': dependencies: tinyrainbow: 3.1.1 - '@vitest/runner@4.1.11': + '@vitest/runner@4.1.12': dependencies: - '@vitest/utils': 4.1.11 + '@vitest/utils': 4.1.12 pathe: 2.0.3 - '@vitest/snapshot@4.1.11': + '@vitest/snapshot@4.1.12': dependencies: - '@vitest/pretty-format': 4.1.11 - '@vitest/utils': 4.1.11 + '@vitest/pretty-format': 4.1.12 + '@vitest/utils': 4.1.12 magic-string: 0.30.21 pathe: 2.0.3 - '@vitest/spy@4.1.11': {} + '@vitest/spy@4.1.12': {} - '@vitest/utils@4.1.11': + '@vitest/utils@4.1.12': dependencies: - '@vitest/pretty-format': 4.1.11 + '@vitest/pretty-format': 4.1.12 convert-source-map: 2.0.0 tinyrainbow: 3.1.1 @@ -5188,7 +5496,7 @@ snapshots: ajv@8.20.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.8 + fast-uri: 3.1.9 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -5208,15 +5516,15 @@ snapshots: argparse@2.0.1: {} - arkregex@0.0.13: + arkregex@0.0.14: dependencies: - '@ark/util': 0.56.7 + '@ark/util': 0.56.8 - arktype@2.2.8: + arktype@2.2.9: dependencies: - '@ark/schema': 0.56.7 - '@ark/util': 0.56.7 - arkregex: 0.0.13 + '@ark/schema': 0.56.8 + '@ark/util': 0.56.8 + arkregex: 0.0.14 array-union@2.1.0: {} @@ -5234,15 +5542,15 @@ snapshots: dependencies: is-windows: 1.0.2 - body-parser@2.3.0: + body-parser@2.4.0: dependencies: bytes: 3.1.2 content-type: 2.1.0 debug: 4.4.3 http-errors: 2.0.1 iconv-lite: 0.7.3 - on-finished: 2.4.1 - qs: 6.16.0 + on-finished: 2.4.2 + qs: 6.16.1 raw-body: 3.0.2 type-is: 2.1.0 transitivePeerDependencies: @@ -5334,7 +5642,7 @@ snapshots: consola@3.4.2: {} - content-disposition@1.1.0: {} + content-disposition@2.0.1: {} content-type@1.0.5: {} @@ -5380,8 +5688,9 @@ snapshots: dotenv@17.4.2: {} - drizzle-orm@0.45.4(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9): + drizzle-orm@0.45.4(@opentelemetry/api@1.10.0)(@types/pg@8.23.1)(gel@2.2.0)(pg@8.23.1)(postgres@3.4.9): optionalDependencies: + '@opentelemetry/api': 1.10.0 '@types/pg': 8.23.1 gel: 2.2.0 pg: 8.23.1 @@ -5489,9 +5798,9 @@ snapshots: dependencies: eventsource-parser: 3.1.1 - evlog@1.11.0(next@15.5.28(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3): + evlog@1.11.0(next@15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3): optionalDependencies: - next: 15.5.28(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + next: 15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) react: 19.2.3 execa@9.6.1: @@ -5511,20 +5820,20 @@ snapshots: expect-type@1.3.0: {} - express-rate-limit@8.7.1(express@5.2.1): + express-rate-limit@8.7.1(express@5.3.0): dependencies: debug: 4.4.3 - express: 5.2.1 - ip-address: 10.7.3 + express: 5.3.0 + ip-address: 10.7.5 transitivePeerDependencies: - supports-color - express@5.2.1: + express@5.3.0: dependencies: accepts: 2.0.0 - body-parser: 2.3.0 - content-disposition: 1.1.0 - content-type: 1.0.5 + body-parser: 2.4.0 + content-disposition: 2.0.1 + content-type: 2.1.0 cookie: 0.7.2 cookie-signature: 1.2.2 debug: 4.4.3 @@ -5537,11 +5846,11 @@ snapshots: http-errors: 2.0.1 merge-descriptors: 2.0.0 mime-types: 3.0.2 - on-finished: 2.4.1 + on-finished: 2.4.2 once: 1.4.0 parseurl: 1.3.3 proxy-addr: 2.0.8 - qs: 6.16.0 + qs: 6.16.1 range-parser: 1.3.0 router: 2.2.0 send: 1.2.1 @@ -5578,7 +5887,7 @@ snapshots: dependencies: fast-string-truncated-width: 3.0.3 - fast-uri@3.1.8: {} + fast-uri@3.1.9: {} fast-wrap-ansi@0.2.2: dependencies: @@ -5588,10 +5897,6 @@ snapshots: dependencies: reusify: 1.1.0 - fdir@6.5.0(picomatch@4.0.4): - optionalDependencies: - picomatch: 4.0.4 - fdir@6.5.0(picomatch@4.0.7): optionalDependencies: picomatch: 4.0.7 @@ -5609,7 +5914,7 @@ snapshots: debug: 4.4.3 encodeurl: 2.0.0 escape-html: 1.0.3 - on-finished: 2.4.1 + on-finished: 2.4.2 parseurl: 1.3.3 statuses: 2.0.2 transitivePeerDependencies: @@ -5694,11 +5999,11 @@ snapshots: glob-to-regexp@0.4.1: {} - glob@13.0.6: + glob@14.0.3: dependencies: - minimatch: 10.2.5 + minimatch: 11.0.4 minipass: 7.1.3 - path-scurry: 2.0.2 + path-scurry: 3.0.0 globby@11.1.0: dependencies: @@ -5721,7 +6026,7 @@ snapshots: dependencies: function-bind: 1.1.2 - hono@4.13.13: {} + hono@4.13.14: {} html-escaper@2.0.2: {} @@ -5747,7 +6052,7 @@ snapshots: inherits@2.0.4: {} - ip-address@10.7.3: {} + ip-address@10.7.5: {} ipaddr.js@1.9.1: {} @@ -5793,7 +6098,7 @@ snapshots: jiti@2.7.0: {} - jose@6.2.12: {} + jose@6.2.14: {} joycon@3.1.1: {} @@ -5936,8 +6241,9 @@ snapshots: dependencies: mime-db: 1.54.0 - minimatch@10.2.5: + minimatch@11.0.4: dependencies: + '@isaacs/nonrecursive-glob-match': 1.0.3 brace-expansion: 5.0.12 minimist@1.2.8: {} @@ -5967,7 +6273,7 @@ snapshots: dependencies: content-type: 2.1.0 - next@15.5.28(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3): + next@15.5.28(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3): dependencies: '@next/env': 15.5.28 '@swc/helpers': 0.5.15 @@ -5985,6 +6291,7 @@ snapshots: '@next/swc-linux-x64-musl': 15.5.28 '@next/swc-win32-arm64-msvc': 15.5.28 '@next/swc-win32-x64-msvc': 15.5.28 + '@opentelemetry/api': 1.10.0 sharp: 0.35.5(@types/node@26.2.0) transitivePeerDependencies: - '@babel/core' @@ -6010,7 +6317,7 @@ snapshots: ohash@2.0.11: {} - on-finished@2.4.1: + on-finished@2.4.2: dependencies: ee-first: 1.1.1 @@ -6054,7 +6361,7 @@ snapshots: path-key@4.0.0: {} - path-scurry@2.0.2: + path-scurry@3.0.0: dependencies: lru-cache: 11.3.6 minipass: 7.1.3 @@ -6126,8 +6433,6 @@ snapshots: picomatch@2.3.2: {} - picomatch@4.0.4: {} - picomatch@4.0.7: {} pify@4.0.1: {} @@ -6150,12 +6455,12 @@ snapshots: pluralize@8.0.0: {} - postcss-load-config@6.0.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(yaml@2.9.1): + postcss-load-config@6.0.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(yaml@2.9.1): dependencies: lilconfig: 3.1.3 optionalDependencies: jiti: 2.7.0 - postcss: 8.5.31 + postcss: 8.5.32 tsx: 4.23.15 yaml: 2.9.1 @@ -6165,6 +6470,12 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.2 + postcss@8.5.32: + dependencies: + nanoid: 3.3.20 + picocolors: 1.1.1 + source-map-js: 1.2.2 + postgres-array@2.0.0: {} postgres-bytea@1.0.1: {} @@ -6177,9 +6488,11 @@ snapshots: postgres@3.4.9: {} - posthog-node@5.55.2: + posthog-node@5.61.1(@opentelemetry/api@1.10.0): dependencies: - '@posthog/core': 1.58.0 + '@posthog/core': 1.62.0 + optionalDependencies: + '@opentelemetry/api': 1.10.0 prettier@2.8.8: {} @@ -6198,7 +6511,7 @@ snapshots: pure-rand@8.4.2: {} - qs@6.16.0: + qs@6.16.1: dependencies: es-define-property: 1.0.1 side-channel: 1.1.1 @@ -6245,9 +6558,9 @@ snapshots: reusify@1.1.0: {} - rimraf@6.1.3: + rimraf@6.1.4: dependencies: - glob: 13.0.6 + glob: 14.0.3 package-json-from-dist: 1.0.1 rollup@4.60.4: @@ -6281,36 +6594,37 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.60.4 fsevents: 2.3.3 - rollup@4.64.12: + rollup@4.67.4: dependencies: - '@types/estree': 1.0.9 + '@types/estree': 1.0.10 optionalDependencies: '@napi-rs/lzma-linux-x64-gnu': 1.5.1 - '@rollup/rollup-android-arm-eabi': 4.64.12 - '@rollup/rollup-android-arm64': 4.64.12 - '@rollup/rollup-darwin-arm64': 4.64.12 - '@rollup/rollup-darwin-x64': 4.64.12 - '@rollup/rollup-freebsd-arm64': 4.64.12 - '@rollup/rollup-freebsd-x64': 4.64.12 - '@rollup/rollup-linux-arm-gnueabihf': 4.64.12 - '@rollup/rollup-linux-arm-musleabihf': 4.64.12 - '@rollup/rollup-linux-arm64-gnu': 4.64.12 - '@rollup/rollup-linux-arm64-musl': 4.64.12 - '@rollup/rollup-linux-loong64-gnu': 4.64.12 - '@rollup/rollup-linux-loong64-musl': 4.64.12 - '@rollup/rollup-linux-ppc64-gnu': 4.64.12 - '@rollup/rollup-linux-ppc64-musl': 4.64.12 - '@rollup/rollup-linux-riscv64-gnu': 4.64.12 - '@rollup/rollup-linux-riscv64-musl': 4.64.12 - '@rollup/rollup-linux-s390x-gnu': 4.64.12 - '@rollup/rollup-linux-x64-gnu': 4.64.12 - '@rollup/rollup-linux-x64-musl': 4.64.12 - '@rollup/rollup-openbsd-x64': 4.64.12 - '@rollup/rollup-openharmony-arm64': 4.64.12 - '@rollup/rollup-win32-arm64-msvc': 4.64.12 - '@rollup/rollup-win32-ia32-msvc': 4.64.12 - '@rollup/rollup-win32-x64-gnu': 4.64.12 - '@rollup/rollup-win32-x64-msvc': 4.64.12 + '@rollup/rollup-android-arm-eabi': 4.67.4 + '@rollup/rollup-android-arm64': 4.67.4 + '@rollup/rollup-android-x64': 4.67.4 + '@rollup/rollup-darwin-arm64': 4.67.4 + '@rollup/rollup-darwin-x64': 4.67.4 + '@rollup/rollup-freebsd-arm64': 4.67.4 + '@rollup/rollup-freebsd-x64': 4.67.4 + '@rollup/rollup-linux-arm-gnueabihf': 4.67.4 + '@rollup/rollup-linux-arm-musleabihf': 4.67.4 + '@rollup/rollup-linux-arm64-gnu': 4.67.4 + '@rollup/rollup-linux-arm64-musl': 4.67.4 + '@rollup/rollup-linux-loong64-gnu': 4.67.4 + '@rollup/rollup-linux-loong64-musl': 4.67.4 + '@rollup/rollup-linux-ppc64-gnu': 4.67.4 + '@rollup/rollup-linux-ppc64-musl': 4.67.4 + '@rollup/rollup-linux-riscv64-gnu': 4.67.4 + '@rollup/rollup-linux-riscv64-musl': 4.67.4 + '@rollup/rollup-linux-s390x-gnu': 4.67.4 + '@rollup/rollup-linux-x64-gnu': 4.67.4 + '@rollup/rollup-linux-x64-musl': 4.67.4 + '@rollup/rollup-openbsd-x64': 4.67.4 + '@rollup/rollup-openharmony-arm64': 4.67.4 + '@rollup/rollup-win32-arm64-msvc': 4.67.4 + '@rollup/rollup-win32-ia32-msvc': 4.67.4 + '@rollup/rollup-win32-x64-gnu': 4.67.4 + '@rollup/rollup-win32-x64-msvc': 4.67.4 fsevents: 2.3.3 router@2.2.0: @@ -6343,7 +6657,7 @@ snapshots: http-errors: 2.0.1 mime-types: 3.0.2 ms: 2.1.3 - on-finished: 2.4.1 + on-finished: 2.4.2 range-parser: 1.3.0 statuses: 2.0.2 transitivePeerDependencies: @@ -6503,7 +6817,7 @@ snapshots: lines-and-columns: 1.2.4 mz: 2.7.0 pirates: 4.0.7 - tinyglobby: 0.2.16 + tinyglobby: 0.2.17 ts-interface-checker: 0.1.13 supports-color@7.2.0: @@ -6536,13 +6850,13 @@ snapshots: tinyglobby@0.2.15: dependencies: - fdir: 6.5.0(picomatch@4.0.4) - picomatch: 4.0.4 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 tinyglobby@0.2.16: dependencies: - fdir: 6.5.0(picomatch@4.0.4) - picomatch: 4.0.4 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 tinyglobby@0.2.17: dependencies: @@ -6567,7 +6881,7 @@ snapshots: tslib@2.8.1: {} - tsup@8.5.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1): + tsup@8.5.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(typescript@5.9.3)(yaml@2.9.1): dependencies: bundle-require: 5.1.0(esbuild@0.28.1) cac: 6.7.14 @@ -6578,7 +6892,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.7.0)(postcss@8.5.31)(tsx@4.23.15)(yaml@2.9.1) + postcss-load-config: 6.0.1(jiti@2.7.0)(postcss@8.5.32)(tsx@4.23.15)(yaml@2.9.1) resolve-from: 5.0.0 rollup: 4.60.4 source-map: 0.7.6 @@ -6587,7 +6901,7 @@ snapshots: tinyglobby: 0.2.16 tree-kill: 1.2.2 optionalDependencies: - postcss: 8.5.31 + postcss: 8.5.32 typescript: 5.9.3 transitivePeerDependencies: - jiti @@ -6637,6 +6951,8 @@ snapshots: unpipe@1.0.0: {} + uuid@14.0.0: {} + uuid@14.0.3: {} vary@1.1.2: {} @@ -6646,8 +6962,8 @@ snapshots: esbuild: 0.28.2 fdir: 6.5.0(picomatch@4.0.7) picomatch: 4.0.7 - postcss: 8.5.31 - rollup: 4.64.12 + postcss: 8.5.32 + rollup: 4.67.4 tinyglobby: 0.2.17 optionalDependencies: '@types/node': 22.20.5 @@ -6663,8 +6979,8 @@ snapshots: esbuild: 0.28.2 fdir: 6.5.0(picomatch@4.0.7) picomatch: 4.0.7 - postcss: 8.5.31 - rollup: 4.64.12 + postcss: 8.5.32 + rollup: 4.67.4 tinyglobby: 0.2.17 optionalDependencies: '@types/node': 26.2.0 @@ -6675,59 +6991,61 @@ snapshots: tsx: 4.23.15 yaml: 2.9.1 - vitest@4.1.11(@types/node@22.20.5)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)): + vitest@4.1.12(@opentelemetry/api@1.10.0)(@types/node@22.20.5)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)): dependencies: - '@vitest/expect': 4.1.11 - '@vitest/mocker': 4.1.11(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) - '@vitest/pretty-format': 4.1.11 - '@vitest/runner': 4.1.11 - '@vitest/snapshot': 4.1.11 - '@vitest/spy': 4.1.11 - '@vitest/utils': 4.1.11 + '@vitest/expect': 4.1.12 + '@vitest/mocker': 4.1.12(vite@7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + '@vitest/pretty-format': 4.1.12 + '@vitest/runner': 4.1.12 + '@vitest/snapshot': 4.1.12 + '@vitest/spy': 4.1.12 + '@vitest/utils': 4.1.12 es-module-lexer: 2.3.2 expect-type: 1.3.0 magic-string: 0.30.21 obug: 2.2.1 pathe: 2.0.3 - picomatch: 4.0.4 + picomatch: 4.0.7 std-env: 4.2.0 tinybench: 2.9.0 tinyexec: 1.3.1 - tinyglobby: 0.2.16 + tinyglobby: 0.2.17 tinyrainbow: 3.1.1 vite: 7.3.7(@types/node@22.20.5)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1) why-is-node-running: 2.3.0 optionalDependencies: + '@opentelemetry/api': 1.10.0 '@types/node': 22.20.5 - '@vitest/coverage-v8': 4.1.11(vitest@4.1.11) + '@vitest/coverage-v8': 4.1.12(vitest@4.1.12) transitivePeerDependencies: - msw - vitest@4.1.11(@types/node@26.2.0)(@vitest/coverage-v8@4.1.11)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)): + vitest@4.1.12(@opentelemetry/api@1.10.0)(@types/node@26.2.0)(@vitest/coverage-v8@4.1.12)(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)): dependencies: - '@vitest/expect': 4.1.11 - '@vitest/mocker': 4.1.11(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) - '@vitest/pretty-format': 4.1.11 - '@vitest/runner': 4.1.11 - '@vitest/snapshot': 4.1.11 - '@vitest/spy': 4.1.11 - '@vitest/utils': 4.1.11 + '@vitest/expect': 4.1.12 + '@vitest/mocker': 4.1.12(vite@7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1)) + '@vitest/pretty-format': 4.1.12 + '@vitest/runner': 4.1.12 + '@vitest/snapshot': 4.1.12 + '@vitest/spy': 4.1.12 + '@vitest/utils': 4.1.12 es-module-lexer: 2.3.2 expect-type: 1.3.0 magic-string: 0.30.21 obug: 2.2.1 pathe: 2.0.3 - picomatch: 4.0.4 + picomatch: 4.0.7 std-env: 4.2.0 tinybench: 2.9.0 tinyexec: 1.3.1 - tinyglobby: 0.2.16 + tinyglobby: 0.2.17 tinyrainbow: 3.1.1 vite: 7.3.7(@types/node@26.2.0)(jiti@2.7.0)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.23.15)(yaml@2.9.1) why-is-node-running: 2.3.0 optionalDependencies: + '@opentelemetry/api': 1.10.0 '@types/node': 26.2.0 - '@vitest/coverage-v8': 4.1.11(vitest@4.1.11) + '@vitest/coverage-v8': 4.1.12(vitest@4.1.12) transitivePeerDependencies: - msw diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e4b2eac019..fc42e15220 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -42,17 +42,17 @@ catalogs: tsup: 8.5.1 tsx: 4.23.15 typescript: 5.9.3 - vitest: 4.1.11 + vitest: 4.1.12 # Must track `vitest` exactly: the coverage provider is versioned in # lockstep with the runner, and vitest refuses to start against a mismatched # one ("Vitest failed to load @vitest/coverage-v8"). Enforced by a test # rather than by this comment: see `e2e/tests/supply-chain.e2e.test.ts`. Dependabot # groups both under `dev-dependencies` and will otherwise move one alone. - '@vitest/coverage-v8': 4.1.11 + '@vitest/coverage-v8': 4.1.12 security: - '@clerk/nextjs': 7.9.14 + '@clerk/nextjs': 7.9.23 next: 15.5.28 - vite: 8.3.4 + vite: 8.3.5 # Security overrides for Dependabot alerts on transitive deps that Dependabot # cannot PR against (it only PRs direct dependencies). Each selector is scoped @@ -158,7 +158,9 @@ overrides: # #215 CVE-2026-84394 (GHSA-58mr-gqgx-xq4g) — raised to 3.1.7 (published # 2026-09-02). # #223 CVE-2026-86472 — raised to 3.1.8 (published 2026-09-15). - 'fast-uri@<3.1.8': '3.1.8' + # #280-#283 CVE-2026-110306, CVE-2026-110180, CVE-2026-110725, + # CVE-2026-110095 — raised to 3.1.9 (published 2026-10-19). + 'fast-uri@<3.1.9': '3.1.9' # GHSA-f88m-g3jw-g9cj — sharp's vendored libvips carries multiple High # libvips CVEs (CVE-2026-33327, CVE-2026-33328, CVE-2026-35590, # CVE-2026-35591), fixed >=0.35.0. Pulled in as an optional dependency of diff --git a/scripts/__tests__/migration-fixture-client.test.mjs b/scripts/__tests__/migration-fixture-client.test.mjs new file mode 100644 index 0000000000..4d2128709c --- /dev/null +++ b/scripts/__tests__/migration-fixture-client.test.mjs @@ -0,0 +1,71 @@ +import { afterEach, expect, it, vi } from 'vitest' + +const { protect } = vi.hoisted(() => ({ protect: vi.fn() })) + +vi.mock('../../e2e/node_modules/@cipherstash/protect', () => ({ + protect, + csTable: (_name, columns) => columns, + csColumn: () => { + const column = { + equality: () => column, + dataType: () => column, + } + return column + }, +})) +vi.mock('../../e2e/node_modules/@cipherstash/protect-dynamodb', () => ({ + protectDynamoDB: () => ({}), +})) +vi.mock('../../e2e/migration-harness/fixture/src/stores.mjs', () => ({ + createStores: async () => ({}), +})) + +import { createApp } from '../../e2e/migration-harness/fixture/src/app.mjs' + +afterEach(() => { + vi.unstubAllEnvs() + protect.mockReset() +}) + +const env = (region) => ({ + CS_WORKSPACE_CRN: `crn:${region}:workspace`, + CS_CLIENT_ID: 'test-client', + CS_CLIENT_KEY: 'test-key', + CS_CLIENT_ACCESS_KEY: 'test-access-key', +}) + +it('restores the original hosts after overlapping client initialization', async () => { + vi.stubEnv('CS_CTS_HOST', 'https://original.cts.invalid') + vi.stubEnv('CS_ZEROKMS_HOST', 'https://original.kms.invalid') + const completions = [] + protect.mockImplementation( + () => new Promise((resolve) => completions.push(resolve)), + ) + const first = createApp(env('first')) + const second = createApp(env('second')) + await vi.waitFor(() => expect(completions.length).toBeGreaterThan(0)) + completions[0]({}) + await first + await vi.waitFor(() => expect(completions).toHaveLength(2)) + completions[1]({}) + await second + + expect(process.env.CS_CTS_HOST).toBe('https://original.cts.invalid') + expect(process.env.CS_ZEROKMS_HOST).toBe('https://original.kms.invalid') +}) + +it('restores absent hosts after rejection and allows a later client', async () => { + vi.stubEnv('CS_CTS_HOST', undefined) + vi.stubEnv('CS_ZEROKMS_HOST', undefined) + protect.mockRejectedValueOnce(new Error('initialization failed')) + protect.mockResolvedValueOnce({}) + + await expect(createApp(env('first'))).rejects.toThrow('initialization failed') + expect(process.env.CS_CTS_HOST).toBeUndefined() + expect(process.env.CS_ZEROKMS_HOST).toBeUndefined() + + await createApp(env('second')) + expect(protect).toHaveBeenCalledTimes(2) + expect(process.env.CS_CTS_HOST).toBeUndefined() + expect(process.env.CS_ZEROKMS_HOST).toBeUndefined() +}) diff --git a/scripts/__tests__/protect-crossover-prerequisites.test.mjs b/scripts/__tests__/protect-crossover-prerequisites.test.mjs new file mode 100644 index 0000000000..b5aa91ed57 --- /dev/null +++ b/scripts/__tests__/protect-crossover-prerequisites.test.mjs @@ -0,0 +1,90 @@ +import { describe, expect, it } from 'vitest' +import { runsWhen } from './lib/expressions.mjs' +import { readWorkflow } from './lib/workflows.mjs' + +const steps = readWorkflow('.github/workflows/tests.yml').jobs['e2e-tests'] + .steps +const database = steps.find((step) => step.id === 'db') +const crossover = steps.find((step) => + step.run?.includes('run test:protect-crossover'), +) +const bindings = steps.filter((step) => + [ + './.github/actions/build-ffi-binding', + './.github/actions/build-auth-binding', + ].includes(step.uses), +) + +// Model each named step's outcome. Explicit !cancelled() conditions bypass +// GitHub's implicit success() guard, so they must inspect prerequisite outcomes. +function contextWithFailure(failed) { + return { + steps: Object.fromEntries( + steps + .filter((step) => step.id) + .map((step) => [ + step.id, + { outcome: step === failed ? 'failure' : 'success' }, + ]), + ), + } +} + +describe('cross-store suite prerequisites', () => { + it('finds both bindings and the database and suite steps', () => { + expect(bindings).toHaveLength(2) + expect(database).toBeDefined() + expect(crossover).toBeDefined() + }) + + for (const binding of bindings) { + it(`does not start postgres or crossover after ${binding.name} fails`, () => { + const context = contextWithFailure(binding) + const startsDatabase = runsWhen(database.if, context) + expect( + startsDatabase, + 'A failed binding must prevent database startup', + ).toBe(false) + context.steps.db.outcome = startsDatabase ? 'success' : 'skipped' + expect(runsWhen(crossover.if, context)).toBe(false) + }) + } + + it('still runs crossover after the independent compatibility suite fails', () => { + const compat = steps.find((step) => + step.run?.includes('run test:protect-compat'), + ) + expect(compat).toBeDefined() + const context = contextWithFailure(compat) + expect(runsWhen(database.if, context)).toBe(true) + expect(runsWhen(crossover.if, context)).toBe(true) + }) + + it('does not run crossover when postgres fails', () => { + expect(runsWhen(crossover.if, contextWithFailure(database))).toBe(false) + }) +}) + +// The integration image is PostgreSQL 17. The upgrade example's dependency +// preflight reads pg_constraint, whose contents changed in 18 (NOT NULL rows), +// so the suite must keep running against 18 as well. +describe('upgrade example on PostgreSQL 18', () => { + const db18 = steps.find((step) => step.id === 'db18') + const run18 = steps.find((step) => step.if?.includes('steps.db18.outcome')) + + it('starts a digest-pinned PostgreSQL 18 after both bindings build', () => { + expect(db18?.run).toMatch(/postgres:18@sha256:[0-9a-f]{64}/) + for (const binding of bindings) { + expect(runsWhen(db18.if, contextWithFailure(binding))).toBe(false) + } + }) + + it('runs the upgrade suite against that database', () => { + expect(run18?.run).toContain('run test:protect-crossover') + expect(run18?.run).toContain('tests/protect-postgres-upgrade.e2e.test.ts') + expect(run18?.env?.DATABASE_URL).toBe( + '${{ steps.db18.outputs.database-url }}', + ) + expect(runsWhen(run18.if, contextWithFailure(db18))).toBe(false) + }) +}) diff --git a/scripts/impact-gate.py b/scripts/impact-gate.py index c25688bc16..345a24c132 100644 --- a/scripts/impact-gate.py +++ b/scripts/impact-gate.py @@ -157,16 +157,15 @@ def report(args: argparse.Namespace, policy: str) -> None: publish(mark_misread_spans(result, args.base, spans)) -# lizard's TypeScript reader sometimes misses a function's closing brace (an -# arrow callback followed by a ternary returning an object literal is one -# trigger) and runs the span on into the next top-level declaration. Edits to +# lizard's TypeScript reader sometimes misses a function's closing brace (in +# lizard 1.24.3, a `{` in a regex literal is one trigger) and runs the span on +# into the next top-level declaration. Edits to # that neighbour are then charged to a function the PR never touched. In # formatted code nothing inside a function body starts at column 0, so a # top-level declaration strictly inside a span is the tell. Pygments decides # what is code: a column-0 `const` inside a template literal is string text. -# Limit: when the misread makes lizard drop functions instead (the same -# trigger inside a class method reports only an `(anonymous)` function), the -# edits land on a row that has no span to check, and nothing is marked. +# Limit: when the misread makes lizard drop functions instead, the edits land +# on a row that has no span to check, and nothing is marked. SPAN_SUFFIXES = ('.ts', '.tsx', '.js', '.jsx') DECLARATION = re.compile(r'@|(export|import|declare|abstract|async|function|const|let|var' r'|class|interface|type|enum)\b') diff --git a/scripts/tests/test_impact_gate.py b/scripts/tests/test_impact_gate.py index 15c5010513..e8f3ea85b0 100644 --- a/scripts/tests/test_impact_gate.py +++ b/scripts/tests/test_impact_gate.py @@ -10,11 +10,13 @@ import unittest DRIVER = Path(__file__).resolve().parents[1] / 'impact-gate.py' -# lizard misses this function's closing brace (a ternary returning an object -# literal after an arrow callback) and runs its span on into whatever follows. -PICK = ('export function pick(xs: readonly string[], hint?: string) {\n' - ' const hinted = xs.find((c) => c === hint)\n' - " return hinted ? { hinted, via: 'hint' } : null\n" +# lizard 1.24.3 misses this function's closing brace (the `{` in the regex +# literal) and runs its span on to the next `function`, over any top-level code +# between them. 1.24.3 fixed the trigger these tests used before (a ternary +# returning an object literal); when lizard fixes this one too, the tests +# that use PICK fail and need a new trigger. +PICK = ('export function pick(s: string) {\n' + ' return /\\{/.test(s)\n' '}\n') @@ -118,19 +120,22 @@ def test_pull_request_pin_refuses_a_checkout_that_is_not_the_pr_merge(self): self.assertNotIn('sha=', result.stdout) def test_marks_cost_drivers_whose_function_span_lizard_misread(self): - # lizard ends `pick` at the end of `after`: a ternary returning an - # object literal after an arrow callback loses the closing brace. Edits - # to `after` are then charged to `pick`, which the PR never touched. + # lizard runs `pick` on to `after` (see PICK), so the top-level code + # between them is charged to `pick`, which the PR never touched. def branches(name, arg, result): return (f'export function {name}({arg}: number): number {{\n' + ''.join(f' if ({arg} === {i}) return {i};\n' for i in range(200)) + f' return {result}\n}}\n') + + def checks(count): + return '\nexport const LIMIT = 10\n' + ''.join( + f'if (LIMIT === {i}) console.log({i})\n' for i in range(count)) + after = '\nexport function after(x: number): number {\n return x + 1\n}\n' self.commit('src/pick.ts', 'export function third(y: number): number {\n return y\n}\n\n' - + PICK + '\nexport function after(x: number): number {\n return x + 1\n}\n') + + PICK + checks(1) + after) self.run_driver('prepare') self.git('checkout', '-qb', 'feature') - self.commit('src/pick.ts', branches('third', 'y', 'y') + '\n' + PICK + '\n' - + branches('after', 'x', 'x + 1')) + self.commit('src/pick.ts', branches('third', 'y', 'y') + '\n' + PICK + checks(200) + after) # The grade multiplies cost by files changed; the drivers table is only # printed above the warn percentile. for index in range(6): @@ -177,17 +182,15 @@ def test_unindented_declarations_inside_a_function_body_are_not_top_level(self): self.assertEqual(self.load_driver().misread_functions([head], 'src/flat.ts'), set()) def test_a_span_ending_on_a_one_line_declaration_swallows_it(self): - # lizard ends `path` on the next declaration's first line. That is - # harmless when only a signature is there, but a one-line declaration - # is there whole, so edits to it are charged to `path`. - path = ('export function path(segments: string[]): string {\n' - ' return `$.${segments.join(".")}`\n}\n\n') - self.commit('src/path.ts', path + 'export const LIMIT = 10\n') - self.commit('src/boundary.ts', path + 'export function next(x: number): number {\n' + # lizard ends `pick` (see PICK) on the next declaration's first line. + # That is harmless when only a signature is there, but a one-line + # declaration is there whole, so edits to it are charged to `pick`. + self.commit('src/path.ts', PICK + '\nexport const LIMIT = 10\n') + self.commit('src/boundary.ts', PICK + '\nexport function next(x: number): number {\n' ' return x\n}\n') head = self.git('rev-parse', 'HEAD') driver = self.load_driver() - self.assertEqual(driver.misread_functions([head], 'src/path.ts'), {('', 'path')}) + self.assertEqual(driver.misread_functions([head], 'src/path.ts'), {('', 'pick')}) self.assertEqual(driver.misread_functions([head], 'src/boundary.ts'), set()) def test_a_declaration_continued_on_the_next_line_is_not_whole(self): @@ -214,9 +217,9 @@ def test_a_declaration_continued_on_the_next_line_is_not_whole(self): self.assertEqual(driver.declaration_lines('a.ts', source)[1], whole) def test_marks_a_function_above_a_removed_declaration(self): - # At the base, `pick`'s span swallows `gone`; the PR deletes `gone`. - self.commit('src/pick.ts', PICK + '\nexport function gone(x: number): number {\n' - ' return x\n}\n\nexport function kept(y: number): number {\n return y\n}\n') + # At the base, `pick`'s span swallows `GONE`; the PR deletes `GONE`. + self.commit('src/pick.ts', PICK + '\nexport const GONE = 1\n' + '\nexport function kept(y: number): number {\n return y\n}\n') base = self.git('rev-parse', 'HEAD') self.commit('src/pick.ts', PICK + '\nexport function kept(y: number): number {\n' ' return y + 1\n}\n') @@ -225,12 +228,14 @@ def test_marks_a_function_above_a_removed_declaration(self): self.assertNotIn(('', 'kept'), found) def test_marks_a_function_above_appended_code(self): - # At the base `pick` ends the file; the PR appends after it. + # At the base `pick` ends the file; the PR appends a declaration and a + # function after it. self.commit('src/pick.ts', 'export function edited(y: number): number {\n return y\n}\n\n' + PICK) base = self.git('rev-parse', 'HEAD') self.commit('src/pick.ts', 'export function edited(y: number): number {\n return y + 1\n}\n\n' - + PICK + '\nexport function appended(x: number): number {\n return x\n}\n') + + PICK + '\nexport const LIMIT = 10\n' + '\nexport function appended(x: number): number {\n return x\n}\n') found = self.load_driver().misread_functions([base, 'HEAD'], 'src/pick.ts') self.assertIn(('', 'pick'), found) self.assertNotIn(('', 'edited'), found) diff --git a/skills/stash-auth/SKILL.md b/skills/stash-auth/SKILL.md index 0fb7f2edf9..76e09fe7c8 100644 --- a/skills/stash-auth/SKILL.md +++ b/skills/stash-auth/SKILL.md @@ -159,7 +159,7 @@ yourself. | Strategy | Use for | Credential source | |---|---|---| -| `AutoStrategy` (the default when `config.authStrategy` is unset) | Most apps | `CS_CLIENT_ACCESS_KEY` **and** `CS_WORKSPACE_CRN` env vars, else the dev profile (`~/.cipherstash/auth.json`), else fails `NOT_AUTHENTICATED` | +| `AutoStrategy` (the default when `config.authStrategy` is unset) | Most apps | `CS_CLIENT_ACCESS_KEY` **and** `CS_WORKSPACE_CRN` env vars, else the dev profile (`~/.cipherstash/auth.json`) — the session of the workspace named by `CS_WORKSPACE_CRN` if set (tokens are checked against it, `WORKSPACE_MISMATCH` otherwise), else the CLI's current workspace's — else fails `NOT_AUTHENTICATED`. **That workspace pin is in `@cipherstash/auth`'s `AutoStrategy` (pass it as `config.authStrategy`); the default client built without `config.authStrategy` resolves credentials inside `@cipherstash/protect-ffi`, which still follows the CLI's *current* workspace — for the token and for the client key it reads from the profile — until it picks the pin up. Pass `config.authStrategy` and keep the CLI's current workspace equal to `CS_WORKSPACE_CRN` until then** | | `AccessKeyStrategy` | Services, CI, backfill jobs | Explicit workspace CRN + access key | | `OidcFederationStrategy` | Per-user (identity-bound) encryption | Your IdP's JWT, fetched via a callback on every operation — one CTS token cached per distinct JWT (see Client lifetime) | | `DeviceSessionStrategy` | CLI-adjacent tooling | The device-code session `stash auth login` created | @@ -217,9 +217,9 @@ pass `.data`. | `failure.type` | Meaning / fix | |---|---| -| `NOT_AUTHENTICATED` | No credentials found — set the `CS_*` variables, or run `npx stash auth login` for a dev profile | +| `NOT_AUTHENTICATED` | No credentials found — set the `CS_*` variables, or run `npx stash auth login` for a dev profile. With `@cipherstash/auth`'s `AutoStrategy` and `CS_WORKSPACE_CRN` set, the dev profile must be logged in to *that* workspace (the CLI's current workspace doesn't count): log in to it, or unset `CS_WORKSPACE_CRN`. The default client (no `config.authStrategy`) uses the CLI's current workspace instead — make the intended workspace current | | `MISSING_WORKSPACE_CRN` | `CS_CLIENT_ACCESS_KEY` is set but `CS_WORKSPACE_CRN` isn't — the access-key path needs both | -| `WORKSPACE_MISMATCH` (`expected` / `actual`) | The access key belongs to a different workspace than the CRN — you've mixed environments' credentials | +| `WORKSPACE_MISMATCH` (`expected` / `actual`) | The access key (or dev-profile session) belongs to a different workspace than the CRN — you've mixed environments' credentials | | `INVALID_ACCESS_KEY` / `INVALID_CRN` | Malformed values — check for truncation/quoting in the secret store | | `EXPIRED_TOKEN` / `INVALID_GRANT` | The underlying session/JWT expired — for `OidcFederationStrategy`, check that `getJwt` returns a *fresh* token | | `ACCESS_DENIED` | CTS refused the exchange — membership, provider config, or (as an HTTP 402) billing | @@ -399,12 +399,14 @@ client-side strategy model applies to apps behind the Proxy. ## Quick diagnosis 1. **`NOT_AUTHENTICATED` locally** → `npx stash auth login` (dev profile), - or export the four `CS_*` variables. + or export the four `CS_*` variables. With `@cipherstash/auth`'s + `AutoStrategy` and `CS_WORKSPACE_CRN` set, log in to that workspace, or + unset it; the default client follows the CLI's current workspace. 2. **Works locally, 401 in CI/production** → the deployed environment lacks the `CS_*` variables, or they're from the wrong workspace — mint with `stash env`, compare `CS_WORKSPACE_CRN`. -3. **`WORKSPACE_MISMATCH`** → the access key and the CRN name different - workspaces; re-mint rather than mix-and-match. +3. **`WORKSPACE_MISMATCH`** → the access key (or dev-profile session) and + the CRN name different workspaces; re-mint rather than mix-and-match. 4. **`No OIDC provider found for issuer`** → add your IdP at dashboard.cipherstash.com → workspace → OIDC providers, and check the issuer URL matches the JWT's `iss` exactly. diff --git a/skills/stash-cli/SKILL.md b/skills/stash-cli/SKILL.md index f45c156bf9..4ea65c39ca 100644 --- a/skills/stash-cli/SKILL.md +++ b/skills/stash-cli/SKILL.md @@ -643,6 +643,8 @@ Runs from the `backfilled` phase and drops the original plaintext ``. It ve Flags: `--table`, `--column`, `--migrations-dir `. +On Drizzle projects the migration is journaled by `drizzle-kit generate --custom`, so it lands in the `out` directory of `drizzle.config.ts` (the path drizzle-kit reports). `--migrations-dir` is only a fallback there, and the command warns when drizzle-kit wrote elsewhere. + ### Decrypt The reverse lifecycle: moving encrypted columns back to plaintext, for leaving CipherStash or un-encrypting a column. It mirrors `encrypt` step for step, on the same `@cipherstash/migrate` engine, and records its own events in `cipherstash.cs_migrations` — keyed by the **encrypted** column, so they never mix with the forward history kept under the plaintext name. Decryption is never charged. @@ -720,6 +722,8 @@ Generating records `encrypted-dropped`, which stops a second drop being generate Flags: `--table`, `--column`, `--plaintext-column`, `--migrations-dir `, `--uninstall-eql`. +On Drizzle projects the migration is journaled by `drizzle-kit generate --custom`, so it lands in the `out` directory of `drizzle.config.ts` (the path drizzle-kit reports). `--migrations-dir` is only a fallback there, and the command warns when drizzle-kit wrote elsewhere. + ### Deployment #### `env` diff --git a/skills/stash-dynamodb/SKILL.md b/skills/stash-dynamodb/SKILL.md index 6facd6f96b..96884cf90c 100644 --- a/skills/stash-dynamodb/SKILL.md +++ b/skills/stash-dynamodb/SKILL.md @@ -45,12 +45,23 @@ Non-encrypted attributes pass through unchanged. On decryption, the `__source` a ## Schema and Stored Versions Schema authoring and every write are EQL v3-only. Existing v2 DynamoDB items -remain readable by passing the same v3 table descriptor plus -`{ storedEqlVersion: 2 }` to `decryptModel` or `bulkDecryptModels`. Both entries -serve legacy reads — the default `@cipherstash/stack` one and +remain readable with the same v3 table descriptor. A top-level scalar attribute +carries no version, so it reads with or without `{ storedEqlVersion: 2 }`, and +one read call covers items written before and after the upgrade. Pass +`{ storedEqlVersion: 2 }` to `decryptModel` or `bulkDecryptModels` when a grouped +v2 field is declared by its bare leaf name (see "Grouped v2 fields" below): only +that read matches the leaf inside its group. Both +entries serve legacy reads — the default `@cipherstash/stack` one and `@cipherstash/stack/wasm-inline`. -There is no infrastructure migration between the versions — DynamoDB has no EQL extension to install and no schema to alter — and there is no automatic *data* migration either. To fully move a table to v3, re-encrypt every item with the v3 schema. +DynamoDB has no EQL extension to install or schema to alter. Compatibility tests cover `@cipherstash/protect@10.2.1` with `@cipherstash/protect-dynamodb@6.0.1`, using the default keyset and no lock context. For the tested top-level scalar equality columns and unindexed text, Stack reads the existing `__source` without re-encryption. Text and numeric equality terms stay compatible when the schema and normalization match. Other Protect versions, nested attributes, custom keysets and lock contexts need separate verification before relying on this upgrade path. + +Keep each property key the same and map supported text and numeric equality columns to an `Eq` domain (`TextEq`, `IntegerEq`, `DoubleEq`, `BigintEq`, …); use `DoubleEq` for fractional numbers. Keeping DB column names unchanged is simplest. Plan for these differences: + +- A v3 `Boolean` mints no equality term, so a boolean `__hmac` that protect-dynamodb stored can no longer be queried. Re-encrypting does not bring it back; redesign the lookup before deploying. A plaintext replacement exposes the value, so use it only if that exposure is acceptable for the field. Populating a replacement attribute on existing items requires a separate backfill. +- When Stack updates an attribute in place and its v3 domain writes no `__hmac` (`Boolean`, an `Ord` domain, or a storage-only domain such as `Text`), `REMOVE` the stale `__hmac` in the same `UpdateItem`. Otherwise an equality lookup on the old value still matches the item. +- A v2 `downcase` filter has no v3 equivalent, so the app now normalizes on both sides. Lowercase the value before `encryptQuery` and the stored `__hmac` matches. Lowercase it before every write too: Stack hashes a mixed-case value such as `Ada@Example.com` case-sensitively, so a lowercase query silently misses it. Lowercasing on write means the stored ciphertext no longer keeps the original casing (protect-dynamodb's did). If the app needs it, write the original to a separate attribute (for example `emailDisplay: types.Text('emailDisplay')`) and keep the lowercased one for lookups. +- A v2 `dataType('json')` attribute was stored as a scalar ciphertext, not a `types.Json` document, and does not decrypt through the adapter as `types.Json`. Backfill it by wrapping its `__source` in a v2 scalar envelope (`{ v: 2, k: 'ct', i: { t: legacyTableName, c: legacyColumnName }, c: source }`), decrypting with the encryption client's `decrypt`, then encrypting the plaintext with `types.Json` and persisting the replacement attributes. Preserve item keys and other attributes, guard concurrent writes, and plan rollback: Protect's original JSON schema cannot read the rewritten representation. The client must be built for the table. Build the client with the same v3 table you hand to `encryptedDynamoDB` — `Encryption({ schemas: [users] })` returns the typed v3 client for a concrete v3 schema set. Passing a v3 table to a client that never registered it (a client built for a different schema set) throws a clear error naming the table on the first operation, instead of failing later with an opaque FFI deserialization error. @@ -181,12 +192,16 @@ const decrypted = await dynamo.decryptModel( const dynamo = encryptedDynamoDB({ encryptionClient, options: { + // Receives a log-safe copy of the error: its message names the failure's + // kind and code, never the original message. logger: { error: (message, error) => console.error(`[DynamoDB] ${message}`, error), }, + // Receives the full error. Its message can quote a plaintext value, so + // log `error.code`, not `error.message`. errorHandler: (error) => { // Send to monitoring, etc. - console.error(`[${error.code}] ${error.message}`) + console.error(`[DynamoDB] ${error.code}`) }, }, }) @@ -317,7 +332,16 @@ if (queryResult.failure) { throw new Error(`Query encryption failed: ${queryResult.failure.message}`) } -const emailHmac = queryResult.data.hm +const emailHmac = hmacOf(queryResult.data) + +// encryptQuery's result type also covers ciphertexts, strings and null, so +// narrow to the equality term before reading `hm` (`.data.hm` does not compile). +function hmacOf(term: unknown): string { + if (typeof term === "object" && term !== null && "hm" in term && typeof term.hm === "string") { + return term.hm + } + throw new Error("encryptQuery returned no equality term: is the column an *Eq domain?") +} // 2. Use the HMAC in a DynamoDB query const result = await docClient.send(new QueryCommand({ @@ -463,8 +487,11 @@ reconstruct a legacy v2 envelope when explicitly requested. Let `T` be inferred from the argument; do not pass explicit type arguments on the v3 path. -For a stored v2 item, pass `{ storedEqlVersion: 2 }` as `readOptions`. The table -is still the current v3 descriptor, which supplies table and column identity. +For a stored v2 item, pass `{ storedEqlVersion: 2 }` as `readOptions`. It is +needed for a grouped v2 field declared by its bare leaf name; a top-level scalar +item reads either way. The +table is still the current v3 descriptor, which supplies table and column +identity. That descriptor must be one of the tables you passed to `Encryption({ schemas })`. The adapter forwards it to the client to drive envelope and `Date` reconstruction, @@ -510,18 +537,11 @@ const result = await encryptionClient.encryptQuery( // `data?.hm` would mask a failure (and a null-plaintext result) as `undefined`, // producing a malformed key condition rather than a clear error. if (result.failure) throw new Error(result.failure.message) -const hmac = result.data.hm // Use this in DynamoDB key conditions - -// EQL v2 — pass queryType explicitly (`usersV2` is the legacy table declared -// in the v2 read section above; `users` is the v3 one and infers its queryType): -const v2Result = await encryptionClient.encryptQuery( - "search-value", - { table: usersV2, column: usersV2.email, queryType: "equality" } -) -if (v2Result.failure) throw new Error(v2Result.failure.message) -const v2Hmac = v2Result.data.hm +const hmac = hmacOf(result.data) // Use this in DynamoDB key conditions (`hmacOf`: see "Encrypted Partition Key") ``` +For compatible legacy scalar equality attributes, use the same v3 query above against the existing `__hmac`. Legacy reads use the v3 table and the read options described in "Reading Existing EQL v2 Items". + > On a `types.TextSearch` column `encryptQuery` returns `hm` alongside ordering > and bloom-filter terms regardless of `queryType`. Only `hm` is meaningful for > DynamoDB — a free-text query cannot be expressed as a key condition. @@ -570,7 +590,14 @@ const queryEnc = await encryptionClient.encryptQuery("alice@example.com", { column: users.email, }) if (queryEnc.failure) throw new Error(queryEnc.failure.message) -const hmac = queryEnc.data.hm +const hmac = hmacOf(queryEnc.data) + +function hmacOf(term: unknown): string { + if (typeof term === "object" && term !== null && "hm" in term && typeof term.hm === "string") { + return term.hm + } + throw new Error("encryptQuery returned no equality term: is the column an *Eq domain?") +} const queryResult = await docClient.send(new QueryCommand({ TableName: "Users", diff --git a/skills/stash-postgres/SKILL.md b/skills/stash-postgres/SKILL.md index 991b428c9b..4c2a47a0a2 100644 --- a/skills/stash-postgres/SKILL.md +++ b/skills/stash-postgres/SKILL.md @@ -105,6 +105,14 @@ public.eql_v3_bigint_ord → eql_v3.query_bigint_ord public.eql_v3_timestamp_ord → eql_v3.query_timestamp_ord ``` +Use the query domain of the column's *own* domain. Pairing a column with a +different domain's query operand (for example `public.eql_v3_text_ord` with +`eql_v3.query_text_eq`) raises `operator = is not supported for ...: use the +query domain that matches the column` rather than returning no rows. This +guard covers the comparison operators (`=`, `<>`, `<`, `<=`, `>`, `>=`, `@@`) +that both the column and the wrong query domain support, within one type +family. Build the cast from the column's own domain every time. + **One irregular case:** `types.Json` builds `public.eql_v3_json_search`, but its query domain is `eql_v3.query_json` — not `query_json_search`. @@ -455,6 +463,18 @@ Project the column raw. payload (1–2 KB per row) and spills. Group on the extractor — `GROUP BY eql_v3.eq_term(email)` — which is small and deterministic. +**`public` off the `search_path`.** The operators on encrypted columns are +created in `public`. Inside a function pinned to `SET search_path = ''` (the +hardening Supabase recommends for `SECURITY DEFINER` functions), or under a +role whose path omits `public`, a bare `col < $1` never finds them — Postgres +falls back to the built-in `jsonb` operator, which compares the ciphertext and +returns a wrong answer without an error. There, call the function form +(`eql_v3.lt(col, $1::eql_v3.query_integer_ord)`) or name the operator's schema +(`col OPERATOR(public.<) $1::eql_v3.query_integer_ord`), and write the column +domains as `public.eql_v3_…`. Both forms still use the functional index. On +`_ord_ore` columns they need an EQL release newer than 3.0.6: earlier ones compared +those values byte-wise in this setting too. + **Predicates are not indexes.** Everything here works without an index and sequential-scans. Adding the functional index over the extractor is a separate step — see `stash-indexing`. diff --git a/skills/stash-supabase/SKILL.md b/skills/stash-supabase/SKILL.md index 57b396aceb..0c98503142 100644 --- a/skills/stash-supabase/SKILL.md +++ b/skills/stash-supabase/SKILL.md @@ -509,6 +509,14 @@ const { data, error } = await es `select()` also accepts an optional second parameter: `select(columns, { head?: boolean, count?: 'exact' | 'planned' | 'estimated' })`. +Tables with no encrypted columns (an `audit_log`, a lookup table) go through the +same `es.from()`. Their rows are returned as stored, with no call to the +encryption client. One limit: an embedded relation to an encrypted table, such +as `es.from("audit_log").select("id, users(email)")`, is not decrypted. The +wrapper returns an error naming the column rather than hand you ciphertext, so +query the encrypted table directly. In declared mode, the same error means a +table declared with `{}` has an `eql_v3_*` column you have not declared. + ## Query Filters All filter values for encrypted columns are automatically encrypted before diff --git a/turbo.json b/turbo.json index 3ca98935a2..c20c70ffcc 100644 --- a/turbo.json +++ b/turbo.json @@ -96,6 +96,22 @@ "inputs": ["$TURBO_DEFAULT$", ".env*"], "cache": false }, + // The protect-dynamodb compatibility suite (`e2e`), which `test:e2e` + // leaves out because it fails without CS_* credentials. Workflows run it + // with `--env-mode=loose` so those reach it. + "test:protect-compat": { + "dependsOn": ["^build", "build"], + "inputs": ["$TURBO_DEFAULT$", ".env*"], + "cache": false + }, + // The DynamoDB <-> Postgres cross-store suite: CS_* credentials plus + // DATABASE_URL, so it too runs with `--env-mode=loose`. `^build` builds the + // stash CLI it installs EQL v3 with. + "test:protect-crossover": { + "dependsOn": ["^build", "build"], + "inputs": ["$TURBO_DEFAULT$", ".env*"], + "cache": false + }, "test:integration": { "dependsOn": ["^build", "build"], "inputs": ["$TURBO_DEFAULT$", ".env*"],