From 34980df5a42633ecc6411bd57901c3358345557a Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 27 May 2026 16:29:05 -0700 Subject: [PATCH 01/33] refactor(types): move postgres-specific types under src/types/postgres/ Phase 0.1 of SQLite generalization. Moves generated/, overrides/, generate.ts, introspect.ts, and the PG-specific index.test.ts under src/types/postgres/. runtime.ts, deserialize.ts, cast.test.ts, and match.test.ts remain at top level as dialect-agnostic. src/types/index.ts is a transitional re-export shim so external callers don't have to change in one shot. Co-Authored-By: Claude Opus 4.7 (1M context) --- eslint.config.js | 2 +- package.json | 4 +- plan.md | 313 ++++++++++++++++++ src/builder/insert.ts | 2 +- src/builder/update.ts | 2 +- src/table.ts | 2 +- src/tables/generate.ts | 2 +- src/types/index.ts | 83 +---- src/types/{ => postgres}/generate.ts | 8 +- src/types/{ => postgres}/generated/aclitem.ts | 4 +- src/types/{ => postgres}/generated/any.ts | 4 +- .../{ => postgres}/generated/anyarray.ts | 4 +- .../{ => postgres}/generated/anycompatible.ts | 4 +- .../generated/anycompatiblearray.ts | 4 +- .../generated/anycompatiblemultirange.ts | 4 +- .../generated/anycompatiblenonarray.ts | 4 +- .../generated/anycompatiblerange.ts | 4 +- .../{ => postgres}/generated/anyelement.ts | 4 +- src/types/{ => postgres}/generated/anyenum.ts | 4 +- .../{ => postgres}/generated/anymultirange.ts | 4 +- .../{ => postgres}/generated/anynonarray.ts | 4 +- .../{ => postgres}/generated/anyrange.ts | 4 +- src/types/{ => postgres}/generated/bit.ts | 4 +- src/types/{ => postgres}/generated/bool.ts | 4 +- src/types/{ => postgres}/generated/bpchar.ts | 4 +- src/types/{ => postgres}/generated/bytea.ts | 4 +- src/types/{ => postgres}/generated/char.ts | 4 +- src/types/{ => postgres}/generated/cid.ts | 4 +- src/types/{ => postgres}/generated/cidr.ts | 4 +- src/types/{ => postgres}/generated/circle.ts | 4 +- src/types/{ => postgres}/generated/date.ts | 4 +- src/types/{ => postgres}/generated/float4.ts | 4 +- src/types/{ => postgres}/generated/float8.ts | 4 +- .../{ => postgres}/generated/gtsvector.ts | 4 +- src/types/{ => postgres}/generated/inet.ts | 4 +- src/types/{ => postgres}/generated/int2.ts | 4 +- src/types/{ => postgres}/generated/int4.ts | 4 +- src/types/{ => postgres}/generated/int8.ts | 4 +- .../{ => postgres}/generated/interval.ts | 4 +- src/types/{ => postgres}/generated/json.ts | 4 +- src/types/{ => postgres}/generated/jsonb.ts | 4 +- .../{ => postgres}/generated/jsonpath.ts | 4 +- src/types/{ => postgres}/generated/macaddr.ts | 4 +- .../{ => postgres}/generated/macaddr8.ts | 4 +- src/types/{ => postgres}/generated/money.ts | 4 +- src/types/{ => postgres}/generated/numeric.ts | 4 +- src/types/{ => postgres}/generated/oid.ts | 4 +- src/types/{ => postgres}/generated/path.ts | 4 +- .../generated/pg_brin_bloom_summary.ts | 4 +- .../generated/pg_brin_minmax_multi_summary.ts | 4 +- .../generated/pg_dependencies.ts | 4 +- src/types/{ => postgres}/generated/pg_lsn.ts | 4 +- .../{ => postgres}/generated/pg_mcv_list.ts | 4 +- .../{ => postgres}/generated/pg_ndistinct.ts | 4 +- .../{ => postgres}/generated/pg_node_tree.ts | 4 +- .../{ => postgres}/generated/pg_snapshot.ts | 4 +- src/types/{ => postgres}/generated/polygon.ts | 4 +- src/types/{ => postgres}/generated/record.ts | 4 +- .../{ => postgres}/generated/refcursor.ts | 4 +- .../{ => postgres}/generated/regclass.ts | 4 +- .../{ => postgres}/generated/regcollation.ts | 4 +- .../{ => postgres}/generated/regconfig.ts | 4 +- .../{ => postgres}/generated/regdictionary.ts | 4 +- .../{ => postgres}/generated/regnamespace.ts | 4 +- src/types/{ => postgres}/generated/regoper.ts | 4 +- .../{ => postgres}/generated/regoperator.ts | 4 +- src/types/{ => postgres}/generated/regproc.ts | 4 +- .../{ => postgres}/generated/regprocedure.ts | 4 +- src/types/{ => postgres}/generated/regrole.ts | 4 +- src/types/{ => postgres}/generated/regtype.ts | 4 +- src/types/{ => postgres}/generated/text.ts | 4 +- src/types/{ => postgres}/generated/tid.ts | 4 +- src/types/{ => postgres}/generated/time.ts | 4 +- .../{ => postgres}/generated/timestamp.ts | 4 +- .../{ => postgres}/generated/timestamptz.ts | 4 +- src/types/{ => postgres}/generated/timetz.ts | 4 +- src/types/{ => postgres}/generated/tsquery.ts | 4 +- .../{ => postgres}/generated/tsvector.ts | 4 +- .../{ => postgres}/generated/txid_snapshot.ts | 4 +- src/types/{ => postgres}/generated/unknown.ts | 4 +- src/types/{ => postgres}/generated/uuid.ts | 4 +- src/types/{ => postgres}/generated/varbit.ts | 4 +- src/types/{ => postgres}/generated/varchar.ts | 4 +- src/types/{ => postgres}/generated/xid.ts | 4 +- src/types/{ => postgres}/generated/xid8.ts | 4 +- src/types/{ => postgres}/generated/xml.ts | 4 +- src/types/{ => postgres}/index.test.ts | 14 +- src/types/postgres/index.ts | 80 +++++ src/types/{ => postgres}/introspect.ts | 0 src/types/{ => postgres}/overrides/any.ts | 12 +- .../{ => postgres}/overrides/anyarray.ts | 8 +- .../overrides/anycompatiblearray.ts | 4 +- src/types/{ => postgres}/overrides/bool.ts | 4 +- src/types/{ => postgres}/overrides/record.ts | 6 +- 94 files changed, 585 insertions(+), 269 deletions(-) create mode 100644 plan.md rename src/types/{ => postgres}/generate.ts (99%) rename src/types/{ => postgres}/generated/aclitem.ts (93%) rename src/types/{ => postgres}/generated/any.ts (97%) rename src/types/{ => postgres}/generated/anyarray.ts (99%) rename src/types/{ => postgres}/generated/anycompatible.ts (85%) rename src/types/{ => postgres}/generated/anycompatiblearray.ts (96%) rename src/types/{ => postgres}/generated/anycompatiblemultirange.ts (72%) rename src/types/{ => postgres}/generated/anycompatiblenonarray.ts (70%) rename src/types/{ => postgres}/generated/anycompatiblerange.ts (72%) rename src/types/{ => postgres}/generated/anyelement.ts (96%) rename src/types/{ => postgres}/generated/anyenum.ts (98%) rename src/types/{ => postgres}/generated/anymultirange.ts (99%) rename src/types/{ => postgres}/generated/anynonarray.ts (83%) rename src/types/{ => postgres}/generated/anyrange.ts (99%) rename src/types/{ => postgres}/generated/bit.ts (99%) rename src/types/{ => postgres}/generated/bool.ts (98%) rename src/types/{ => postgres}/generated/bpchar.ts (99%) rename src/types/{ => postgres}/generated/bytea.ts (99%) rename src/types/{ => postgres}/generated/char.ts (98%) rename src/types/{ => postgres}/generated/cid.ts (93%) rename src/types/{ => postgres}/generated/cidr.ts (93%) rename src/types/{ => postgres}/generated/circle.ts (99%) rename src/types/{ => postgres}/generated/date.ts (99%) rename src/types/{ => postgres}/generated/float4.ts (99%) rename src/types/{ => postgres}/generated/float8.ts (99%) rename src/types/{ => postgres}/generated/gtsvector.ts (86%) rename src/types/{ => postgres}/generated/inet.ts (99%) rename src/types/{ => postgres}/generated/int2.ts (99%) rename src/types/{ => postgres}/generated/int4.ts (99%) rename src/types/{ => postgres}/generated/int8.ts (99%) rename src/types/{ => postgres}/generated/interval.ts (99%) rename src/types/{ => postgres}/generated/json.ts (98%) rename src/types/{ => postgres}/generated/jsonb.ts (99%) rename src/types/{ => postgres}/generated/jsonpath.ts (89%) rename src/types/{ => postgres}/generated/macaddr.ts (98%) rename src/types/{ => postgres}/generated/macaddr8.ts (98%) rename src/types/{ => postgres}/generated/money.ts (99%) rename src/types/{ => postgres}/generated/numeric.ts (99%) rename src/types/{ => postgres}/generated/oid.ts (98%) rename src/types/{ => postgres}/generated/path.ts (98%) rename src/types/{ => postgres}/generated/pg_brin_bloom_summary.ts (87%) rename src/types/{ => postgres}/generated/pg_brin_minmax_multi_summary.ts (88%) rename src/types/{ => postgres}/generated/pg_dependencies.ts (87%) rename src/types/{ => postgres}/generated/pg_lsn.ts (98%) rename src/types/{ => postgres}/generated/pg_mcv_list.ts (86%) rename src/types/{ => postgres}/generated/pg_ndistinct.ts (86%) rename src/types/{ => postgres}/generated/pg_node_tree.ts (86%) rename src/types/{ => postgres}/generated/pg_snapshot.ts (94%) rename src/types/{ => postgres}/generated/polygon.ts (99%) rename src/types/{ => postgres}/generated/record.ts (98%) rename src/types/{ => postgres}/generated/refcursor.ts (86%) rename src/types/{ => postgres}/generated/regclass.ts (91%) rename src/types/{ => postgres}/generated/regcollation.ts (89%) rename src/types/{ => postgres}/generated/regconfig.ts (98%) rename src/types/{ => postgres}/generated/regdictionary.ts (90%) rename src/types/{ => postgres}/generated/regnamespace.ts (89%) rename src/types/{ => postgres}/generated/regoper.ts (89%) rename src/types/{ => postgres}/generated/regoperator.ts (89%) rename src/types/{ => postgres}/generated/regproc.ts (89%) rename src/types/{ => postgres}/generated/regprocedure.ts (89%) rename src/types/{ => postgres}/generated/regrole.ts (89%) rename src/types/{ => postgres}/generated/regtype.ts (89%) rename src/types/{ => postgres}/generated/text.ts (99%) rename src/types/{ => postgres}/generated/tid.ts (98%) rename src/types/{ => postgres}/generated/time.ts (99%) rename src/types/{ => postgres}/generated/timestamp.ts (99%) rename src/types/{ => postgres}/generated/timestamptz.ts (99%) rename src/types/{ => postgres}/generated/timetz.ts (98%) rename src/types/{ => postgres}/generated/tsquery.ts (99%) rename src/types/{ => postgres}/generated/tsvector.ts (99%) rename src/types/{ => postgres}/generated/txid_snapshot.ts (94%) rename src/types/{ => postgres}/generated/unknown.ts (89%) rename src/types/{ => postgres}/generated/uuid.ts (98%) rename src/types/{ => postgres}/generated/varbit.ts (98%) rename src/types/{ => postgres}/generated/varchar.ts (91%) rename src/types/{ => postgres}/generated/xid.ts (96%) rename src/types/{ => postgres}/generated/xid8.ts (98%) rename src/types/{ => postgres}/generated/xml.ts (94%) rename src/types/{ => postgres}/index.test.ts (98%) create mode 100644 src/types/postgres/index.ts rename src/types/{ => postgres}/introspect.ts (100%) rename src/types/{ => postgres}/overrides/any.ts (97%) rename src/types/{ => postgres}/overrides/anyarray.ts (87%) rename src/types/{ => postgres}/overrides/anycompatiblearray.ts (96%) rename src/types/{ => postgres}/overrides/bool.ts (89%) rename src/types/{ => postgres}/overrides/record.ts (93%) diff --git a/eslint.config.js b/eslint.config.js index 3cdbc1b..04ed479 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -57,6 +57,6 @@ export default [ }, }, { - ignores: ["dist/", "src/types/generated/"], + ignores: ["dist/", "src/types/postgres/generated/"], }, ]; diff --git a/package.json b/package.json index 474e781..d22bfe7 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ }, "scripts": { "build": "tsdown", - "codegen": "node --experimental-strip-types src/types/generate.ts", - "codegen:check": "tmp=$(mktemp -d) && node --experimental-strip-types src/types/generate.ts --out-dir \"$tmp\" && { diff -r \"$tmp\" src/types/generated || { echo 'src/types/generated is stale — run `npm run codegen` and commit.' >&2; rm -rf \"$tmp\"; exit 1; }; } && rm -rf \"$tmp\"", + "codegen": "node --experimental-strip-types src/types/postgres/generate.ts", + "codegen:check": "tmp=$(mktemp -d) && node --experimental-strip-types src/types/postgres/generate.ts --out-dir \"$tmp\" && { diff -r \"$tmp\" src/types/postgres/generated || { echo 'src/types/postgres/generated is stale — run `npm run codegen` and commit.' >&2; rm -rf \"$tmp\"; exit 1; }; } && rm -rf \"$tmp\"", "lint": "eslint src", "typecheck": "tsgo --noEmit", "format": "prettier --write src", diff --git a/plan.md b/plan.md new file mode 100644 index 0000000..e824753 --- /dev/null +++ b/plan.md @@ -0,0 +1,313 @@ +# Typegres: SQLite Generalization Plan + +## Context (read first on resumption) + +**Why**: Two design partners are pulling Typegres past Postgres. Kenton Varda (Cloudflare, Principal Engineer) wants a DO/SQLite version for the Cloudflare agent harness shipping in June. Mengxi Lu (Kanmon, CTO) wants Snowflake support for an OLAP CFO copilot. + +**Scope of this plan**: SQLite generalization only. Snowflake is a separate plan (inherits this work plus OLAP-specific abstractions: window functions, recursive CTEs, GROUPING SETS, VARIANT, etc.). Live queries on SQLite are punted; Snowflake-specific work is punted. + +**Non-goal**: feature parity with PG on SQLite. Arrays, ranges, geometric/network/interval types are explicitly out of scope. SQLite users who need arrays should use Postgres. + +**Strategic frame the plan rests on**: Typegres delivers high encapsulation + high composability + high locality of meaning. SQLite generalization is the architectural lift that lets this be claimed across multiple substrates. Done well, it also unlocks Snowflake (the higher-value OLAP wedge) on a clean foundation. + +--- + +## Phase 0 — Foundation (3-5 days) + +The refactor that makes everything else tractable. Land this completely before any per-dialect work; mixing them produces dual-maintenance during the refactor. + +### 0.1 Move `src/types/` → `src/types/postgres/` + +- Move all of `src/types/generated/`, `src/types/overrides/` under `src/types/postgres/` +- `src/types/index.ts` becomes `src/types/postgres/index.ts` (the auto-generated barrel) +- Top-level `src/types/` keeps: + - `runtime.ts` (shared `meta` symbol, `NullOf`, `TsTypeOf`, etc.) + - `deserialize.ts` (registry; refactored below) + - `introspect.ts` (PG-specific; rename to `postgres/introspect.ts`) + - `generate.ts` (PG codegen; rename to `postgres/generate.ts`) + - A small shared `Any` base class (decide: stay in `runtime.ts` or move to `src/types/any.ts`) +- Update all imports across the codebase (`src/builder/`, `src/database.ts`, `src/table.ts`, `src/index.ts`, `src/cli.ts`, `src/exoeval/`, tests) + +### 0.2 Rename `runtime.PgFunc` → `runtime.Func` + +- `runtime.PgFunc` currently in `src/types/runtime.ts` (search for its definition there) +- Rename to `Func`; add `dialect` param to signature +- All call sites are in `src/types/generated/*.ts` (auto-generated — regenerate after refactor; don't hand-edit) +- May need to also rename related symbols (`PgClass`, `PgConst`, etc. — check the runtime.ts surface) + +### 0.3 Per-dialect `deserialize.ts` registry + +- Current: single registry keyed by PG type names (`bool`, `int4`, `int8`, etc.) +- Target: per-dialect registries, looked up via dialect context +- Likely shape: + ```ts + const postgresRegistry: Registry = { bool: {...}, int4: {...}, ... } + const sqliteRegistry: Registry = { integer: {...}, text: {...}, ... } + export const getTypeDef = (dialect, typname) => registries[dialect][typname] ?? defaultTypeDef + ``` +- `getTypeDef` call sites: search `getTypeDef(` across `src/types/` (especially `overrides/any.ts`, `runtime.ts`) + +### 0.4 Add `CompileContext` + `Cast` AST node + +- `Driver` interface gets `readonly dialect: "postgres" | "sqlite"` +- `src/builder/sql.ts` introduces `CompileContext { dialect }` +- `Sql.bind(ctx: CompileContext)` — signature change across all AST nodes +- `compile(root, ctx, style)` takes the same `CompileContext` (uniform with `bind`) +- `Database.execute()` builds the ctx from its driver and passes it in +- New `Cast` class in `src/builder/sql.ts`: + ```ts + export class Cast extends Sql { + constructor(readonly expr: Sql, readonly typname: Sql) { super(); } + bind(ctx: CompileContext): BoundSql { + // dialect-aware: pg uses CAST(... AS ...), sqlite same syntax but limited typenames + return sql`CAST(${this.expr} AS ${this.typname})`.bind(ctx); + } + override children(): readonly Sql[] { return [this.expr, this.typname]; } + } + ``` +- Replaces inline CAST templating in: + - `Param.bind()` / `TypedParam.bind()` in `src/builder/sql.ts` (~line 161-164) + - `Any.cast()` in `src/types/postgres/overrides/any.ts` (~line 59) +- Rationale: per-dialect bind() variation lives in one node's bind() rather than scattered across template strings + +### 0.5 `Bool` via mixin + +- Current: `src/types/overrides/bool.ts` has hard-coded `CAST(${sql.param(other)} AS bool)` — PG-specific +- Target: extract `BoolMixin = (Sup: Sup) => class extends Sup { and(...), or(...), not() }` so shared logic isn't duplicated across dialects +- Per-dialect concrete `Bool` extends `BoolMixin(Generated)` (Postgres) or `BoolMixin(SqliteValue)` (SQLite) +- The `Bool` mixin can use the new `Cast` node to handle the CAST-to-bool difference + +### 0.6 Verify PG tests still pass + +- Run full test suite (`npm run check`) after each major refactor step +- Tests live in `*.test.ts` across `src/` (search: `find src -name "*.test.ts"`) +- pglite-based tests are the canary — they exercise the runtime path end-to-end + +### Risk areas (Phase 0) + +- **Auto-generated files**: `src/types/postgres/generated/*.ts` will need to be regenerated after `PgFunc → Func` rename. Don't hand-edit; run `npm run codegen`. +- **Circular imports**: `runtime.ts` ↔ `types/index.ts` ↔ `builder/sql.ts` currently has cycles. Reorganizing risks new cycles. +- **`meta` symbol usage**: Heavily relied on by `Any` for declared-type narrowing. Don't move it without testing. + +--- + +## Phase 1 — SQLite types (5-7 days) + +Auto-gen target: build a runtime-introspection tool that pulls signatures from SQLite itself. + +### 1.1 The inference tool + +- Lives at `src/types/sqlite/generate.ts` (parallel to PG's `generate.ts`) +- Step 1: Connect to an in-memory SQLite (`better-sqlite3` or `node:sqlite`) +- Step 2: Read `PRAGMA function_list` → `[{name, builtin, type, enc, narg, flags}]` +- Step 3: For each function, run a typed input matrix: + - Test inputs: `1` (integer), `1.5` (real), `'x'` (text), `X'01'` (blob), `NULL` + - Test arities: 0, 1, 2, 3 args (skip arities beyond `narg`) + - Capture `typeof(fn(...))` → infer return type + - Capture errors → mark argument signature as invalid +- Step 4: Aggregate observations into a signature table per function +- Step 5: Generate `src/types/sqlite/generated/*.ts` from the signature table + +### 1.2 Reference docs (authoritative for typing) + +Use these as the source of truth — validate inferred signatures and resolve ambiguity: + +- [lang_corefunc.html](https://sqlite.org/lang_corefunc.html) — scalar built-ins (`abs`, `coalesce`, `length`, etc.) +- [lang_aggfunc.html](https://sqlite.org/lang_aggfunc.html) — aggregates (`avg`, `count`, `group_concat`, etc.) +- [lang_mathfunc.html](https://sqlite.org/lang_mathfunc.html) — math (`acos`, `atan2`, `log`, `pi`, etc.) +- [json1.html](https://sqlite.org/json1.html) — JSON1 (default-built since 3.38) +- [lang_datefunc.html](https://sqlite.org/lang_datefunc.html) — date/time (`date`, `time`, `datetime`, `julianday`, `strftime`) +- [windowfunctions.html](https://sqlite.org/windowfunctions.html) — window function semantics + +### 1.3 Hand-written pieces + +- `SqliteValue` base class (parallel to `Any` but for SQLite) +- Five core type classes: `Integer`, `Text`, `Real`, `Blob`, `Json` (text-backed) +- `Bool` (via mixin, see Phase 0.5) — deserializes from `0`/`1` integer +- Skip: array, range, geometric, network, interval, multirange, polygon, circle, inet, cidr, macaddr, etc. + +### 1.4 Fallback metadata + +- If inference can't disambiguate (variadic functions, polymorphic return based on input type), hand-curate in `src/types/sqlite/overrides.toml` (or `.json`) +- Codegen reads inference results + overrides; overrides win + +### Risk areas (Phase 1) + +- **JSON1 availability**: assume yes (default since 3.38); document the version requirement +- **`pragma function_list` introduced in 3.30** (2020) — set minimum SQLite version explicitly +- **Polymorphic returns**: some functions return different types based on input (`max(a,b)` returns same type as args). Inference can capture this with the input matrix but the codegen needs to express it. +- **Variadic functions**: `printf`, `concat`, `coalesce` — signature has to be variadic in TS + +--- + +## Phase 2 — Builder dialect-routing (3-5 days) + +### 2.1 `Scalar` AST node + +- New class in `src/builder/sql.ts`: + ```ts + export class Scalar extends Sql { + constructor( + readonly qb: QueryBuilder, + readonly cardinality: "one" | "many" | "maybe", + readonly dialect: "pg" | "sqlite", + ) { super(); } + bind(): BoundSql { + // dispatch on dialect: + // pg → ROW(...) + array_agg(...) + COALESCE(..., '{}') + // sqlite → json_object(...) + json_group_array(...) + COALESCE(..., '[]') + } + } + ``` +- Replaces inline templating in `QueryBuilder.scalar()` (`src/builder/query.ts:408-430`) +- Dialect comes from the QueryBuilder's database context + +### 2.2 Operator emission per-dialect + +- `Op` and `UnaryOp` classes in `src/builder/sql.ts` +- PG-extended operators that need dialect handling: + - JSON: `->` (PG) vs `json_extract(...)` (SQLite) + - JSON path: `->>` (PG) vs `json_extract(...)` returning text (SQLite) + - Concatenation: `||` (portable, no change) + - Array: `&&`, `<@`, `@>` (PG only — runtime error on SQLite) +- Decide: dispatch at `Op.bind()` level or push into per-dialect type method definitions + +### 2.3 Runtime errors for unsupported features + +- `LATERAL` joins: throw if `dialect === "sqlite"` and lateral requested (not in current builder; if/when restored) +- Array operations: throw at type-construction time (SQLite types don't expose array methods anyway) + +### Risk areas (Phase 2) + +- **`scalar()` complexity**: ROW vs json_object semantics differ in nullability handling. Test thoroughly. +- **JSON path expressions**: PG's `#>{a,b}` vs SQLite's `'$.a.b'` syntax — translation isn't trivial +- **Comparison semantics**: PG's `IS DISTINCT FROM` has no direct SQLite equivalent (`IS NOT` works for NULL-safe equality but the surface is different) + +--- + +## Phase 3 — Table codegen (2-3 days) + +- Currently in `src/tables/generate.ts` +- Uses `information_schema.columns`, `information_schema.tables`, `information_schema.referential_constraints` (all PG-flavored) +- For SQLite: + - `PRAGMA table_info()` — columns + - `PRAGMA foreign_key_list(
)` — FKs + - `SELECT name FROM sqlite_master WHERE type='table'` — table list + - `sqlite_schema` is the modern alias; use that +- Decide: `tg generate --dialect sqlite` flag, or auto-detect from connection string + +### Risk areas (Phase 3) + +- **SQLite's type affinity vs strict types**: column type declarations are *hints* in SQLite (default) — only with `STRICT` tables (3.37+) does the DB enforce. Decide how to surface this in codegen output. +- **No native bool**: SQLite uses INTEGER 0/1 for booleans. Codegen needs to recognize `BOOLEAN` declaration and emit `Bool` column type. + +--- + +## Phase 4 — Driver (1-2 days) + +- `SqliteDriver` implementing the `Driver` interface from `src/driver.ts` +- Use `better-sqlite3` (synchronous, fast, simple) — wrap in Promise.resolve for the async interface +- Register dialect on driver attach so downstream code (Scalar, Cast, etc.) can read it from the connected Database + +### Risk areas (Phase 4) + +- **Driver choice: `better-sqlite3`** (locked in). Sync, mature, matches pglite shape. Wrap in `Promise.resolve` for the async Driver interface. +- **Transaction semantics**: SQLite locks differently from PG. Verify `runInSingleConnection` semantics still hold. + +--- + +## Phase 4b — DO driver (1-2 days, after Phase 4) + +- `DurableObjectDriver` wrapping `ctx.storage.sql` (Cloudflare's SQLite-backed DO API) +- Same SQLite dialect; different I/O layer +- This is the artifact that ships to Kenton + +### Risk areas (Phase 4b) + +- **DO API limits**: `ctx.storage.sql` has different query/result semantics than `better-sqlite3`. Map carefully. +- **No filesystem**: SQLite-in-DO uses Cloudflare's storage, not a local file. Some features (e.g., `ATTACH DATABASE`) may not work. + +--- + +## Phase 5 — Live queries + +**Punted for v1.** PG's `xid8`-based mechanism in `src/live/events-ddl.ts` has no SQLite equivalent. Revisit only when a real user requires it. + +If implementing later: triggers + rowid threshold polling, or WAL-mode frame counter as alternative to `xid8`. ~1-2 weeks of work. Separate project. + +In the meantime: feature-flag `Database.live()` to throw with a clear error message when dialect is SQLite. + +--- + +## Phase 6 — Tests + +### 6.1 Bespoke SQLite tests first + +- Create `src/builder/sql.sqlite.test.ts`, `src/builder/query.sqlite.test.ts`, etc. +- Mirror the PG test shapes but with SQLite-specific expectations (`?` placeholders, no `RETURNING` on old SQLite, etc.) +- Run against in-memory SQLite via `better-sqlite3` + +### 6.2 Validate Phase 0 didn't break PG + +- The existing PG test suite (including pglite-based tests) should continue to pass at every step of Phase 0 +- `npm run check` after each commit + +### 6.3 Parameterize later + +- Once SQLite surface is stable enough, refactor tests that exercise dialect-agnostic logic to run against both backends +- Don't try this during Phase 0-2 — premature abstraction will fight the refactor + +--- + +## Open questions to resolve before/during execution + +1. ~~better-sqlite3 vs node:sqlite vs sqlite3~~ **Resolved: better-sqlite3.** +2. **Inference fallback threshold**: if the inference tool can resolve X% of functions, accept the rest as hand-curated. What's X? (Suggest 90%+ inferred is a good target.) +3. **JSON1 assumption**: assume default-built (3.38+) or graceful degrade? Suggest assume + document minimum version. +4. **Auto-detect dialect on Database construction**: from driver type, or explicit param? +5. **Window functions**: deferred from before. When to bring back — during SQLite work, or wait for Snowflake plan? (Suggest: Snowflake plan; out of scope here.) + +--- + +## What NOT to do (drift watch) + +- **Don't reintroduce window functions in this scope.** They're a Snowflake-plan item. +- **Don't try to support arrays on SQLite via JSON emulation.** Semantic differences are real and the maintenance cost is high. +- **Don't parameterize tests during Phase 0-2.** Bespoke SQLite tests first; parameterize only when surface is stable. +- **Don't try to implement live queries on SQLite in this scope.** Separate project. +- **Don't conflate the inference tool with codegen entirely.** Inference produces signatures; codegen produces classes. Keep them as two stages. +- **Don't bake dialect into nodes at construction.** Pass it through `bind(ctx)` via `CompileContext` — construction happens without driver context (e.g., `Bool.from(true)`), and threading it through bind is the cleaner alternative. `compile(root, ctx, style)` takes the same `CompileContext`, so the signature is uniform. + +--- + +## Codebase reference (where things live, for orientation on resumption) + +- `src/builder/sql.ts` — Sql AST: Raw, Ident, Param, Alias, Join, WithScope, Op, UnaryOp, Func, Column, TypedParam, Unbound. `compile(root, style)`. `Cast` and `Scalar` to be added here. +- `src/builder/query.ts` — QueryBuilder. `scalar()` at ~line 408. `.join()` at ~line 261. `bind()` produces FROM/SELECT/WHERE. +- `src/builder/insert.ts`, `update.ts`, `delete.ts` — mutation builders, use `RETURNING`. +- `src/builder/values.ts` — VALUES clause. +- `src/types/runtime.ts` — `meta` symbol, `PgFunc` (to rename), `Func`, `NullOf`, `TsTypeOf`, `StrictNull`, `MaybeNull`, `Nullable`, `Aggregate`, `AggregateRow`, `ColumnKeys`, `IsRequired`, `RequiredKeys`, `OptionalKeys`, `InsertRow`. +- `src/types/overrides/any.ts` — `Any` base class; `isColumn`, `getColumn`, `Any.cast()`, `Any.from()`, `Any.serialize()`, `Any.column()`, `Any.in()`, `Any.coalesce()`. +- `src/types/overrides/bool.ts` — `Bool.and()`, `Bool.or()`, `Bool.not()`. Currently hard-codes PG `CAST(... AS bool)`. +- `src/types/overrides/anyarray.ts`, `anycompatiblearray.ts`, `record.ts` — other overrides. +- `src/types/generated/*.ts` — 77 auto-generated PG type classes. +- `src/types/deserialize.ts` — type registry; `getTypeDef(typname)`. +- `src/types/generate.ts` — PG codegen (introspects pg_catalog). +- `src/types/introspect.ts` — PG-specific introspection queries. +- `src/tables/generate.ts` — `tg generate` CLI; introspects user's schema via information_schema. +- `src/driver.ts` — `Driver` interface (`execute`, `runInSingleConnection`, `close`). +- `src/database.ts` — `Database` class; `transaction()`, `execute()`, `hydrate()`, `live()`. +- `src/live/events-ddl.ts` — PG-specific live events table DDL (xid8, jsonb, GENERATED IDENTITY). +- `src/live/bus.ts`, `extractor.ts`, `snapshot.ts`, `events.ts` — live query implementation. +- `src/exoeval/*` — constrained interpreter for RPC (orthogonal to dialect work). +- `src/table.ts` — `Table()` factory; `TableBase`. +- `src/pg.ts` — pg driver. +- `src/index.ts` — public API barrel. + +--- + +## Resumption pointer + +Phase 0 is the gating refactor. Don't begin per-dialect work (Phase 1+) until Phase 0 lands and PG tests still pass. + +*Last updated: May 27, 2026* diff --git a/src/builder/insert.ts b/src/builder/insert.ts index d64dc5f..7cb019a 100644 --- a/src/builder/insert.ts +++ b/src/builder/insert.ts @@ -4,7 +4,7 @@ import type { RowType, RowTypeToTsType } from "./query"; import { compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; import { Database } from "../database"; -import { getColumn } from "../types/overrides/any"; +import { getColumn } from "../types/postgres/overrides/any"; import { meta } from "../types/runtime"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; diff --git a/src/builder/update.ts b/src/builder/update.ts index cfc0f0d..79f0f9a 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -8,7 +8,7 @@ import type { RowType, RowTypeToTsType } from "./query"; import { combinePredicates, compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; import { Database } from "../database"; -import { Any, getColumn } from "../types/overrides/any"; +import { Any, getColumn } from "../types/postgres/overrides/any"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; diff --git a/src/table.ts b/src/table.ts index a4d20f7..ae57963 100644 --- a/src/table.ts +++ b/src/table.ts @@ -5,7 +5,7 @@ import { QueryBuilder } from "./builder/query"; import { DeleteBuilder } from "./builder/delete"; import { UpdateBuilder } from "./builder/update"; import { InsertBuilder } from "./builder/insert"; -import { isColumn } from "./types/overrides/any"; +import { isColumn } from "./types/postgres/overrides/any"; import type { InsertRow } from "./types/runtime"; // A per-op SQL rewrite hook. Tables opt in via the `transformer` option; diff --git a/src/tables/generate.ts b/src/tables/generate.ts index 139842e..5df4006 100644 --- a/src/tables/generate.ts +++ b/src/tables/generate.ts @@ -2,7 +2,7 @@ import pg from "pg"; import * as fs from "node:fs"; import * as path from "node:path"; import type { Config } from "../config.ts"; -import { pgNameToClassName } from "../types/introspect.ts"; +import { pgNameToClassName } from "../types/postgres/introspect.ts"; // --- Config --- diff --git a/src/types/index.ts b/src/types/index.ts index bad725d..3c2d109 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,80 +1,3 @@ -// Auto-generated block — do not edit between markers -// [generated-start] -export { Aclitem } from "./generated/aclitem"; -export { Any } from "./overrides/any"; -export { Anyarray } from "./overrides/anyarray"; -export { Anycompatible } from "./generated/anycompatible"; -export { Anycompatiblearray } from "./overrides/anycompatiblearray"; -export { Anycompatiblemultirange } from "./generated/anycompatiblemultirange"; -export { Anycompatiblenonarray } from "./generated/anycompatiblenonarray"; -export { Anycompatiblerange } from "./generated/anycompatiblerange"; -export { Anyelement } from "./generated/anyelement"; -export { Anyenum } from "./generated/anyenum"; -export { Anymultirange } from "./generated/anymultirange"; -export { Anynonarray } from "./generated/anynonarray"; -export { Anyrange } from "./generated/anyrange"; -export { Bit } from "./generated/bit"; -export { Bool } from "./overrides/bool"; -export { Bpchar } from "./generated/bpchar"; -export { Bytea } from "./generated/bytea"; -export { Char } from "./generated/char"; -export { Cid } from "./generated/cid"; -export { Cidr } from "./generated/cidr"; -export { Circle } from "./generated/circle"; -export { Date } from "./generated/date"; -export { Float4 } from "./generated/float4"; -export { Float8 } from "./generated/float8"; -export { Gtsvector } from "./generated/gtsvector"; -export { Inet } from "./generated/inet"; -export { Int2 } from "./generated/int2"; -export { Int4 } from "./generated/int4"; -export { Int8 } from "./generated/int8"; -export { Interval } from "./generated/interval"; -export { Json } from "./generated/json"; -export { Jsonb } from "./generated/jsonb"; -export { Jsonpath } from "./generated/jsonpath"; -export { Macaddr } from "./generated/macaddr"; -export { Macaddr8 } from "./generated/macaddr8"; -export { Money } from "./generated/money"; -export { Numeric } from "./generated/numeric"; -export { Oid } from "./generated/oid"; -export { Path } from "./generated/path"; -export { PgBrinBloomSummary } from "./generated/pg_brin_bloom_summary"; -export { PgBrinMinmaxMultiSummary } from "./generated/pg_brin_minmax_multi_summary"; -export { PgDependencies } from "./generated/pg_dependencies"; -export { PgLsn } from "./generated/pg_lsn"; -export { PgMcvList } from "./generated/pg_mcv_list"; -export { PgNdistinct } from "./generated/pg_ndistinct"; -export { PgNodeTree } from "./generated/pg_node_tree"; -export { PgSnapshot } from "./generated/pg_snapshot"; -export { Polygon } from "./generated/polygon"; -export { Record } from "./overrides/record"; -export { Refcursor } from "./generated/refcursor"; -export { Regclass } from "./generated/regclass"; -export { Regcollation } from "./generated/regcollation"; -export { Regconfig } from "./generated/regconfig"; -export { Regdictionary } from "./generated/regdictionary"; -export { Regnamespace } from "./generated/regnamespace"; -export { Regoper } from "./generated/regoper"; -export { Regoperator } from "./generated/regoperator"; -export { Regproc } from "./generated/regproc"; -export { Regprocedure } from "./generated/regprocedure"; -export { Regrole } from "./generated/regrole"; -export { Regtype } from "./generated/regtype"; -export { Text } from "./generated/text"; -export { Tid } from "./generated/tid"; -export { Time } from "./generated/time"; -export { Timestamp } from "./generated/timestamp"; -export { Timestamptz } from "./generated/timestamptz"; -export { Timetz } from "./generated/timetz"; -export { Tsquery } from "./generated/tsquery"; -export { Tsvector } from "./generated/tsvector"; -export { TxidSnapshot } from "./generated/txid_snapshot"; -export { Unknown } from "./generated/unknown"; -export { Uuid } from "./generated/uuid"; -export { Varbit } from "./generated/varbit"; -export { Varchar } from "./generated/varchar"; -export { Xid } from "./generated/xid"; -export { Xid8 } from "./generated/xid8"; -export { Xml } from "./generated/xml"; -// [generated-end] +// Transitional re-export of the Postgres type barrel. +// Direct callers should migrate to `../types/postgres` over time. +export * from "./postgres"; diff --git a/src/types/generate.ts b/src/types/postgres/generate.ts similarity index 99% rename from src/types/generate.ts rename to src/types/postgres/generate.ts index 52168fc..ec3dc2d 100644 --- a/src/types/generate.ts +++ b/src/types/postgres/generate.ts @@ -3,8 +3,8 @@ import camelcase from "camelcase"; import * as fs from "node:fs"; import * as path from "node:path"; import { pathToFileURL } from "node:url"; -import { requireDatabaseUrl } from "../pg.ts"; -import { getTypeDef } from "./deserialize.ts"; +import { requireDatabaseUrl } from "../../pg.ts"; +import { getTypeDef } from "../deserialize.ts"; import { introspect, groupByFirstArg, @@ -200,11 +200,11 @@ const generateTypeFile = ( const lines: string[] = []; lines.push("// Auto-generated — do not edit"); - lines.push('import * as runtime from "../runtime";'); + lines.push('import * as runtime from "../../runtime";'); // @expose.unchecked exposes every codegen'd method to exoeval-bound code // without arg validation (typegres's runtime overload dispatcher already // validates internally). One import here, prepended on every method. - lines.push('import { expose } from "../../exoeval/tool";'); + lines.push('import { expose } from "../../../exoeval/tool";'); // Parent class needs a direct import, not `types.Parent`: class `extends` // clauses evaluate at module-load time, and the barrel may not have finished diff --git a/src/types/generated/aclitem.ts b/src/types/postgres/generated/aclitem.ts similarity index 93% rename from src/types/generated/aclitem.ts rename to src/types/postgres/generated/aclitem.ts index bb9b0eb..bcb61f9 100644 --- a/src/types/generated/aclitem.ts +++ b/src/types/postgres/generated/aclitem.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/any.ts b/src/types/postgres/generated/any.ts similarity index 97% rename from src/types/generated/any.ts rename to src/types/postgres/generated/any.ts index d5b0233..e9265f7 100644 --- a/src/types/generated/any.ts +++ b/src/types/postgres/generated/any.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import * as types from "../index"; export class Any { diff --git a/src/types/generated/anyarray.ts b/src/types/postgres/generated/anyarray.ts similarity index 99% rename from src/types/generated/anyarray.ts rename to src/types/postgres/generated/anyarray.ts index 04bff2f..4bdeaff 100644 --- a/src/types/generated/anyarray.ts +++ b/src/types/postgres/generated/anyarray.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anycompatiblearray } from "../overrides/anycompatiblearray"; import * as types from "../index"; diff --git a/src/types/generated/anycompatible.ts b/src/types/postgres/generated/anycompatible.ts similarity index 85% rename from src/types/generated/anycompatible.ts rename to src/types/postgres/generated/anycompatible.ts index e23cbb7..57f2bdb 100644 --- a/src/types/generated/anycompatible.ts +++ b/src/types/postgres/generated/anycompatible.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Any } from "../overrides/any"; import * as types from "../index"; diff --git a/src/types/generated/anycompatiblearray.ts b/src/types/postgres/generated/anycompatiblearray.ts similarity index 96% rename from src/types/generated/anycompatiblearray.ts rename to src/types/postgres/generated/anycompatiblearray.ts index 9e4cff8..13737a9 100644 --- a/src/types/generated/anycompatiblearray.ts +++ b/src/types/postgres/generated/anycompatiblearray.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anyelement } from "../generated/anyelement"; import * as types from "../index"; diff --git a/src/types/generated/anycompatiblemultirange.ts b/src/types/postgres/generated/anycompatiblemultirange.ts similarity index 72% rename from src/types/generated/anycompatiblemultirange.ts rename to src/types/postgres/generated/anycompatiblemultirange.ts index 9898fc2..96846d2 100644 --- a/src/types/generated/anycompatiblemultirange.ts +++ b/src/types/postgres/generated/anycompatiblemultirange.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anyelement } from "../generated/anyelement"; import * as types from "../index"; diff --git a/src/types/generated/anycompatiblenonarray.ts b/src/types/postgres/generated/anycompatiblenonarray.ts similarity index 70% rename from src/types/generated/anycompatiblenonarray.ts rename to src/types/postgres/generated/anycompatiblenonarray.ts index 3c4936c..bcd4c62 100644 --- a/src/types/generated/anycompatiblenonarray.ts +++ b/src/types/postgres/generated/anycompatiblenonarray.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anyelement } from "../generated/anyelement"; import * as types from "../index"; diff --git a/src/types/generated/anycompatiblerange.ts b/src/types/postgres/generated/anycompatiblerange.ts similarity index 72% rename from src/types/generated/anycompatiblerange.ts rename to src/types/postgres/generated/anycompatiblerange.ts index da17e08..e29b59a 100644 --- a/src/types/generated/anycompatiblerange.ts +++ b/src/types/postgres/generated/anycompatiblerange.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anyelement } from "../generated/anyelement"; import * as types from "../index"; diff --git a/src/types/generated/anyelement.ts b/src/types/postgres/generated/anyelement.ts similarity index 96% rename from src/types/generated/anyelement.ts rename to src/types/postgres/generated/anyelement.ts index b866969..6dd6ca8 100644 --- a/src/types/generated/anyelement.ts +++ b/src/types/postgres/generated/anyelement.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anycompatible } from "../generated/anycompatible"; import * as types from "../index"; diff --git a/src/types/generated/anyenum.ts b/src/types/postgres/generated/anyenum.ts similarity index 98% rename from src/types/generated/anyenum.ts rename to src/types/postgres/generated/anyenum.ts index 6842a9d..e7645e6 100644 --- a/src/types/generated/anyenum.ts +++ b/src/types/postgres/generated/anyenum.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/anymultirange.ts b/src/types/postgres/generated/anymultirange.ts similarity index 99% rename from src/types/generated/anymultirange.ts rename to src/types/postgres/generated/anymultirange.ts index bd870ce..d81002c 100644 --- a/src/types/generated/anymultirange.ts +++ b/src/types/postgres/generated/anymultirange.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anycompatiblemultirange } from "../generated/anycompatiblemultirange"; import * as types from "../index"; diff --git a/src/types/generated/anynonarray.ts b/src/types/postgres/generated/anynonarray.ts similarity index 83% rename from src/types/generated/anynonarray.ts rename to src/types/postgres/generated/anynonarray.ts index d3d22b3..f04d2ef 100644 --- a/src/types/generated/anynonarray.ts +++ b/src/types/postgres/generated/anynonarray.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anycompatiblenonarray } from "../generated/anycompatiblenonarray"; import * as types from "../index"; diff --git a/src/types/generated/anyrange.ts b/src/types/postgres/generated/anyrange.ts similarity index 99% rename from src/types/generated/anyrange.ts rename to src/types/postgres/generated/anyrange.ts index f4bc8de..a4bbb62 100644 --- a/src/types/generated/anyrange.ts +++ b/src/types/postgres/generated/anyrange.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anycompatiblerange } from "../generated/anycompatiblerange"; import * as types from "../index"; diff --git a/src/types/generated/bit.ts b/src/types/postgres/generated/bit.ts similarity index 99% rename from src/types/generated/bit.ts rename to src/types/postgres/generated/bit.ts index 27274ba..937c049 100644 --- a/src/types/generated/bit.ts +++ b/src/types/postgres/generated/bit.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/bool.ts b/src/types/postgres/generated/bool.ts similarity index 98% rename from src/types/generated/bool.ts rename to src/types/postgres/generated/bool.ts index 2c2f508..b01ae75 100644 --- a/src/types/generated/bool.ts +++ b/src/types/postgres/generated/bool.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/bpchar.ts b/src/types/postgres/generated/bpchar.ts similarity index 99% rename from src/types/generated/bpchar.ts rename to src/types/postgres/generated/bpchar.ts index e2ae856..1f3ea00 100644 --- a/src/types/generated/bpchar.ts +++ b/src/types/postgres/generated/bpchar.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/bytea.ts b/src/types/postgres/generated/bytea.ts similarity index 99% rename from src/types/generated/bytea.ts rename to src/types/postgres/generated/bytea.ts index 2ad2136..a712018 100644 --- a/src/types/generated/bytea.ts +++ b/src/types/postgres/generated/bytea.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/char.ts b/src/types/postgres/generated/char.ts similarity index 98% rename from src/types/generated/char.ts rename to src/types/postgres/generated/char.ts index a4d3389..f88da79 100644 --- a/src/types/generated/char.ts +++ b/src/types/postgres/generated/char.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/cid.ts b/src/types/postgres/generated/cid.ts similarity index 93% rename from src/types/generated/cid.ts rename to src/types/postgres/generated/cid.ts index ae564bf..3f093ba 100644 --- a/src/types/generated/cid.ts +++ b/src/types/postgres/generated/cid.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/cidr.ts b/src/types/postgres/generated/cidr.ts similarity index 93% rename from src/types/generated/cidr.ts rename to src/types/postgres/generated/cidr.ts index ea33236..9bf3bd4 100644 --- a/src/types/generated/cidr.ts +++ b/src/types/postgres/generated/cidr.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/circle.ts b/src/types/postgres/generated/circle.ts similarity index 99% rename from src/types/generated/circle.ts rename to src/types/postgres/generated/circle.ts index e367659..48f561e 100644 --- a/src/types/generated/circle.ts +++ b/src/types/postgres/generated/circle.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/date.ts b/src/types/postgres/generated/date.ts similarity index 99% rename from src/types/generated/date.ts rename to src/types/postgres/generated/date.ts index fa42021..f1a4900 100644 --- a/src/types/generated/date.ts +++ b/src/types/postgres/generated/date.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/float4.ts b/src/types/postgres/generated/float4.ts similarity index 99% rename from src/types/generated/float4.ts rename to src/types/postgres/generated/float4.ts index 1fd8094..4bf7bad 100644 --- a/src/types/generated/float4.ts +++ b/src/types/postgres/generated/float4.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/float8.ts b/src/types/postgres/generated/float8.ts similarity index 99% rename from src/types/generated/float8.ts rename to src/types/postgres/generated/float8.ts index 2c07e1e..48c9dbc 100644 --- a/src/types/generated/float8.ts +++ b/src/types/postgres/generated/float8.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/gtsvector.ts b/src/types/postgres/generated/gtsvector.ts similarity index 86% rename from src/types/generated/gtsvector.ts rename to src/types/postgres/generated/gtsvector.ts index 11496d6..217f037 100644 --- a/src/types/generated/gtsvector.ts +++ b/src/types/postgres/generated/gtsvector.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/inet.ts b/src/types/postgres/generated/inet.ts similarity index 99% rename from src/types/generated/inet.ts rename to src/types/postgres/generated/inet.ts index 93c29ca..03ba265 100644 --- a/src/types/generated/inet.ts +++ b/src/types/postgres/generated/inet.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/int2.ts b/src/types/postgres/generated/int2.ts similarity index 99% rename from src/types/generated/int2.ts rename to src/types/postgres/generated/int2.ts index 562a82f..0354c1c 100644 --- a/src/types/generated/int2.ts +++ b/src/types/postgres/generated/int2.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/int4.ts b/src/types/postgres/generated/int4.ts similarity index 99% rename from src/types/generated/int4.ts rename to src/types/postgres/generated/int4.ts index 6c9b1e5..9a014e1 100644 --- a/src/types/generated/int4.ts +++ b/src/types/postgres/generated/int4.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/int8.ts b/src/types/postgres/generated/int8.ts similarity index 99% rename from src/types/generated/int8.ts rename to src/types/postgres/generated/int8.ts index fdccbeb..6f8e0b5 100644 --- a/src/types/generated/int8.ts +++ b/src/types/postgres/generated/int8.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/interval.ts b/src/types/postgres/generated/interval.ts similarity index 99% rename from src/types/generated/interval.ts rename to src/types/postgres/generated/interval.ts index 171756d..123c0ea 100644 --- a/src/types/generated/interval.ts +++ b/src/types/postgres/generated/interval.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/json.ts b/src/types/postgres/generated/json.ts similarity index 98% rename from src/types/generated/json.ts rename to src/types/postgres/generated/json.ts index 845bedf..5202908 100644 --- a/src/types/generated/json.ts +++ b/src/types/postgres/generated/json.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/jsonb.ts b/src/types/postgres/generated/jsonb.ts similarity index 99% rename from src/types/generated/jsonb.ts rename to src/types/postgres/generated/jsonb.ts index c134c68..086cc00 100644 --- a/src/types/generated/jsonb.ts +++ b/src/types/postgres/generated/jsonb.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/jsonpath.ts b/src/types/postgres/generated/jsonpath.ts similarity index 89% rename from src/types/generated/jsonpath.ts rename to src/types/postgres/generated/jsonpath.ts index df39a7b..2014134 100644 --- a/src/types/generated/jsonpath.ts +++ b/src/types/postgres/generated/jsonpath.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/macaddr.ts b/src/types/postgres/generated/macaddr.ts similarity index 98% rename from src/types/generated/macaddr.ts rename to src/types/postgres/generated/macaddr.ts index fcbda16..97ccf31 100644 --- a/src/types/generated/macaddr.ts +++ b/src/types/postgres/generated/macaddr.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/macaddr8.ts b/src/types/postgres/generated/macaddr8.ts similarity index 98% rename from src/types/generated/macaddr8.ts rename to src/types/postgres/generated/macaddr8.ts index fee2e17..7add578 100644 --- a/src/types/generated/macaddr8.ts +++ b/src/types/postgres/generated/macaddr8.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/money.ts b/src/types/postgres/generated/money.ts similarity index 99% rename from src/types/generated/money.ts rename to src/types/postgres/generated/money.ts index e7ec15f..f6402f5 100644 --- a/src/types/generated/money.ts +++ b/src/types/postgres/generated/money.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/numeric.ts b/src/types/postgres/generated/numeric.ts similarity index 99% rename from src/types/generated/numeric.ts rename to src/types/postgres/generated/numeric.ts index e54d619..8222c36 100644 --- a/src/types/generated/numeric.ts +++ b/src/types/postgres/generated/numeric.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/oid.ts b/src/types/postgres/generated/oid.ts similarity index 98% rename from src/types/generated/oid.ts rename to src/types/postgres/generated/oid.ts index b1f7b94..3e27526 100644 --- a/src/types/generated/oid.ts +++ b/src/types/postgres/generated/oid.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/path.ts b/src/types/postgres/generated/path.ts similarity index 98% rename from src/types/generated/path.ts rename to src/types/postgres/generated/path.ts index fee8ebe..4865caa 100644 --- a/src/types/generated/path.ts +++ b/src/types/postgres/generated/path.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/pg_brin_bloom_summary.ts b/src/types/postgres/generated/pg_brin_bloom_summary.ts similarity index 87% rename from src/types/generated/pg_brin_bloom_summary.ts rename to src/types/postgres/generated/pg_brin_bloom_summary.ts index a2a2e96..6406883 100644 --- a/src/types/generated/pg_brin_bloom_summary.ts +++ b/src/types/postgres/generated/pg_brin_bloom_summary.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/pg_brin_minmax_multi_summary.ts b/src/types/postgres/generated/pg_brin_minmax_multi_summary.ts similarity index 88% rename from src/types/generated/pg_brin_minmax_multi_summary.ts rename to src/types/postgres/generated/pg_brin_minmax_multi_summary.ts index 9ef28ff..71c292d 100644 --- a/src/types/generated/pg_brin_minmax_multi_summary.ts +++ b/src/types/postgres/generated/pg_brin_minmax_multi_summary.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/pg_dependencies.ts b/src/types/postgres/generated/pg_dependencies.ts similarity index 87% rename from src/types/generated/pg_dependencies.ts rename to src/types/postgres/generated/pg_dependencies.ts index d3500e4..43c7c44 100644 --- a/src/types/generated/pg_dependencies.ts +++ b/src/types/postgres/generated/pg_dependencies.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/pg_lsn.ts b/src/types/postgres/generated/pg_lsn.ts similarity index 98% rename from src/types/generated/pg_lsn.ts rename to src/types/postgres/generated/pg_lsn.ts index ced07c9..499a3ae 100644 --- a/src/types/generated/pg_lsn.ts +++ b/src/types/postgres/generated/pg_lsn.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/pg_mcv_list.ts b/src/types/postgres/generated/pg_mcv_list.ts similarity index 86% rename from src/types/generated/pg_mcv_list.ts rename to src/types/postgres/generated/pg_mcv_list.ts index 3698733..5800076 100644 --- a/src/types/generated/pg_mcv_list.ts +++ b/src/types/postgres/generated/pg_mcv_list.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/pg_ndistinct.ts b/src/types/postgres/generated/pg_ndistinct.ts similarity index 86% rename from src/types/generated/pg_ndistinct.ts rename to src/types/postgres/generated/pg_ndistinct.ts index 47eaf4f..d6b7e61 100644 --- a/src/types/generated/pg_ndistinct.ts +++ b/src/types/postgres/generated/pg_ndistinct.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/pg_node_tree.ts b/src/types/postgres/generated/pg_node_tree.ts similarity index 86% rename from src/types/generated/pg_node_tree.ts rename to src/types/postgres/generated/pg_node_tree.ts index 5cee325..c2fd6aa 100644 --- a/src/types/generated/pg_node_tree.ts +++ b/src/types/postgres/generated/pg_node_tree.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/pg_snapshot.ts b/src/types/postgres/generated/pg_snapshot.ts similarity index 94% rename from src/types/generated/pg_snapshot.ts rename to src/types/postgres/generated/pg_snapshot.ts index 8128a3b..fc71015 100644 --- a/src/types/generated/pg_snapshot.ts +++ b/src/types/postgres/generated/pg_snapshot.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/polygon.ts b/src/types/postgres/generated/polygon.ts similarity index 99% rename from src/types/generated/polygon.ts rename to src/types/postgres/generated/polygon.ts index 8a97947..754c2a3 100644 --- a/src/types/generated/polygon.ts +++ b/src/types/postgres/generated/polygon.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/record.ts b/src/types/postgres/generated/record.ts similarity index 98% rename from src/types/generated/record.ts rename to src/types/postgres/generated/record.ts index b011d96..62a1151 100644 --- a/src/types/generated/record.ts +++ b/src/types/postgres/generated/record.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/refcursor.ts b/src/types/postgres/generated/refcursor.ts similarity index 86% rename from src/types/generated/refcursor.ts rename to src/types/postgres/generated/refcursor.ts index c3f1787..6b0d120 100644 --- a/src/types/generated/refcursor.ts +++ b/src/types/postgres/generated/refcursor.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regclass.ts b/src/types/postgres/generated/regclass.ts similarity index 91% rename from src/types/generated/regclass.ts rename to src/types/postgres/generated/regclass.ts index bf9aac2..38e31ea 100644 --- a/src/types/generated/regclass.ts +++ b/src/types/postgres/generated/regclass.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regcollation.ts b/src/types/postgres/generated/regcollation.ts similarity index 89% rename from src/types/generated/regcollation.ts rename to src/types/postgres/generated/regcollation.ts index 0e95132..6f9e11e 100644 --- a/src/types/generated/regcollation.ts +++ b/src/types/postgres/generated/regcollation.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regconfig.ts b/src/types/postgres/generated/regconfig.ts similarity index 98% rename from src/types/generated/regconfig.ts rename to src/types/postgres/generated/regconfig.ts index a668e7c..6e5a948 100644 --- a/src/types/generated/regconfig.ts +++ b/src/types/postgres/generated/regconfig.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regdictionary.ts b/src/types/postgres/generated/regdictionary.ts similarity index 90% rename from src/types/generated/regdictionary.ts rename to src/types/postgres/generated/regdictionary.ts index e705604..65c78ea 100644 --- a/src/types/generated/regdictionary.ts +++ b/src/types/postgres/generated/regdictionary.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regnamespace.ts b/src/types/postgres/generated/regnamespace.ts similarity index 89% rename from src/types/generated/regnamespace.ts rename to src/types/postgres/generated/regnamespace.ts index f53141b..f72cd5e 100644 --- a/src/types/generated/regnamespace.ts +++ b/src/types/postgres/generated/regnamespace.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regoper.ts b/src/types/postgres/generated/regoper.ts similarity index 89% rename from src/types/generated/regoper.ts rename to src/types/postgres/generated/regoper.ts index ab4d776..b1cf05b 100644 --- a/src/types/generated/regoper.ts +++ b/src/types/postgres/generated/regoper.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regoperator.ts b/src/types/postgres/generated/regoperator.ts similarity index 89% rename from src/types/generated/regoperator.ts rename to src/types/postgres/generated/regoperator.ts index 9479684..74224e7 100644 --- a/src/types/generated/regoperator.ts +++ b/src/types/postgres/generated/regoperator.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regproc.ts b/src/types/postgres/generated/regproc.ts similarity index 89% rename from src/types/generated/regproc.ts rename to src/types/postgres/generated/regproc.ts index 32405f3..2b65d2b 100644 --- a/src/types/generated/regproc.ts +++ b/src/types/postgres/generated/regproc.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regprocedure.ts b/src/types/postgres/generated/regprocedure.ts similarity index 89% rename from src/types/generated/regprocedure.ts rename to src/types/postgres/generated/regprocedure.ts index b33e279..fff11ef 100644 --- a/src/types/generated/regprocedure.ts +++ b/src/types/postgres/generated/regprocedure.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regrole.ts b/src/types/postgres/generated/regrole.ts similarity index 89% rename from src/types/generated/regrole.ts rename to src/types/postgres/generated/regrole.ts index 58b2a09..3ee5c29 100644 --- a/src/types/generated/regrole.ts +++ b/src/types/postgres/generated/regrole.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/regtype.ts b/src/types/postgres/generated/regtype.ts similarity index 89% rename from src/types/generated/regtype.ts rename to src/types/postgres/generated/regtype.ts index beabd3b..fca7d80 100644 --- a/src/types/generated/regtype.ts +++ b/src/types/postgres/generated/regtype.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/text.ts b/src/types/postgres/generated/text.ts similarity index 99% rename from src/types/generated/text.ts rename to src/types/postgres/generated/text.ts index 443f510..69faa5c 100644 --- a/src/types/generated/text.ts +++ b/src/types/postgres/generated/text.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/tid.ts b/src/types/postgres/generated/tid.ts similarity index 98% rename from src/types/generated/tid.ts rename to src/types/postgres/generated/tid.ts index c997fdf..57ede8d 100644 --- a/src/types/generated/tid.ts +++ b/src/types/postgres/generated/tid.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/time.ts b/src/types/postgres/generated/time.ts similarity index 99% rename from src/types/generated/time.ts rename to src/types/postgres/generated/time.ts index 8660319..a58b76e 100644 --- a/src/types/generated/time.ts +++ b/src/types/postgres/generated/time.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/timestamp.ts b/src/types/postgres/generated/timestamp.ts similarity index 99% rename from src/types/generated/timestamp.ts rename to src/types/postgres/generated/timestamp.ts index ccf1f85..4a8a847 100644 --- a/src/types/generated/timestamp.ts +++ b/src/types/postgres/generated/timestamp.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/timestamptz.ts b/src/types/postgres/generated/timestamptz.ts similarity index 99% rename from src/types/generated/timestamptz.ts rename to src/types/postgres/generated/timestamptz.ts index 839a4cc..063a69a 100644 --- a/src/types/generated/timestamptz.ts +++ b/src/types/postgres/generated/timestamptz.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/timetz.ts b/src/types/postgres/generated/timetz.ts similarity index 98% rename from src/types/generated/timetz.ts rename to src/types/postgres/generated/timetz.ts index 351ac0e..cba6c94 100644 --- a/src/types/generated/timetz.ts +++ b/src/types/postgres/generated/timetz.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/tsquery.ts b/src/types/postgres/generated/tsquery.ts similarity index 99% rename from src/types/generated/tsquery.ts rename to src/types/postgres/generated/tsquery.ts index c26b237..9939a6e 100644 --- a/src/types/generated/tsquery.ts +++ b/src/types/postgres/generated/tsquery.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/tsvector.ts b/src/types/postgres/generated/tsvector.ts similarity index 99% rename from src/types/generated/tsvector.ts rename to src/types/postgres/generated/tsvector.ts index 6ec9cfa..d9b7ca9 100644 --- a/src/types/generated/tsvector.ts +++ b/src/types/postgres/generated/tsvector.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/txid_snapshot.ts b/src/types/postgres/generated/txid_snapshot.ts similarity index 94% rename from src/types/generated/txid_snapshot.ts rename to src/types/postgres/generated/txid_snapshot.ts index 02953d6..ff21e8f 100644 --- a/src/types/generated/txid_snapshot.ts +++ b/src/types/postgres/generated/txid_snapshot.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/unknown.ts b/src/types/postgres/generated/unknown.ts similarity index 89% rename from src/types/generated/unknown.ts rename to src/types/postgres/generated/unknown.ts index 506fd08..6a2d410 100644 --- a/src/types/generated/unknown.ts +++ b/src/types/postgres/generated/unknown.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/uuid.ts b/src/types/postgres/generated/uuid.ts similarity index 98% rename from src/types/generated/uuid.ts rename to src/types/postgres/generated/uuid.ts index f7a1807..80ee928 100644 --- a/src/types/generated/uuid.ts +++ b/src/types/postgres/generated/uuid.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/varbit.ts b/src/types/postgres/generated/varbit.ts similarity index 98% rename from src/types/generated/varbit.ts rename to src/types/postgres/generated/varbit.ts index c1bd7ca..f4c2649 100644 --- a/src/types/generated/varbit.ts +++ b/src/types/postgres/generated/varbit.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/varchar.ts b/src/types/postgres/generated/varchar.ts similarity index 91% rename from src/types/generated/varchar.ts rename to src/types/postgres/generated/varchar.ts index 5e78452..880a0b2 100644 --- a/src/types/generated/varchar.ts +++ b/src/types/postgres/generated/varchar.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/xid.ts b/src/types/postgres/generated/xid.ts similarity index 96% rename from src/types/generated/xid.ts rename to src/types/postgres/generated/xid.ts index e88e6f3..ee79bb2 100644 --- a/src/types/generated/xid.ts +++ b/src/types/postgres/generated/xid.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/xid8.ts b/src/types/postgres/generated/xid8.ts similarity index 98% rename from src/types/generated/xid8.ts rename to src/types/postgres/generated/xid8.ts index 4e64136..86736a0 100644 --- a/src/types/generated/xid8.ts +++ b/src/types/postgres/generated/xid8.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/generated/xml.ts b/src/types/postgres/generated/xml.ts similarity index 94% rename from src/types/generated/xml.ts rename to src/types/postgres/generated/xml.ts index 98142e2..a3ff206 100644 --- a/src/types/generated/xml.ts +++ b/src/types/postgres/generated/xml.ts @@ -1,6 +1,6 @@ // Auto-generated — do not edit -import * as runtime from "../runtime"; -import { expose } from "../../exoeval/tool"; +import * as runtime from "../../runtime"; +import { expose } from "../../../exoeval/tool"; import { Anynonarray } from "../generated/anynonarray"; import * as types from "../index"; diff --git a/src/types/index.test.ts b/src/types/postgres/index.test.ts similarity index 98% rename from src/types/index.test.ts rename to src/types/postgres/index.test.ts index 4fd9fbc..b98f1b4 100644 --- a/src/types/index.test.ts +++ b/src/types/postgres/index.test.ts @@ -1,13 +1,13 @@ import { test, expect, expectTypeOf, beforeAll, afterAll } from "vitest"; -import type { meta } from "./runtime"; -import type { StrictNull, MaybeNull, NullOf, TsTypeOf } from "./runtime"; +import type { meta } from "../runtime"; +import type { StrictNull, MaybeNull, NullOf, TsTypeOf } from "../runtime"; import type { Any, Float8, Anyrange, Anymultirange } from "./index"; import { Int4, Text, Bool, Int8, Record, Anyarray } from "./index"; -import { compile } from "../builder/sql"; -import { sql } from "../builder/sql"; -import { PgDriver } from "../driver"; -import { requireDatabaseUrl } from "../pg"; -import type { Driver } from "../driver"; +import { compile } from "../../builder/sql"; +import { sql } from "../../builder/sql"; +import { PgDriver } from "../../driver"; +import { requireDatabaseUrl } from "../../pg"; +import type { Driver } from "../../driver"; let exec: Driver; diff --git a/src/types/postgres/index.ts b/src/types/postgres/index.ts new file mode 100644 index 0000000..bad725d --- /dev/null +++ b/src/types/postgres/index.ts @@ -0,0 +1,80 @@ +// Auto-generated block — do not edit between markers +// [generated-start] +export { Aclitem } from "./generated/aclitem"; +export { Any } from "./overrides/any"; +export { Anyarray } from "./overrides/anyarray"; +export { Anycompatible } from "./generated/anycompatible"; +export { Anycompatiblearray } from "./overrides/anycompatiblearray"; +export { Anycompatiblemultirange } from "./generated/anycompatiblemultirange"; +export { Anycompatiblenonarray } from "./generated/anycompatiblenonarray"; +export { Anycompatiblerange } from "./generated/anycompatiblerange"; +export { Anyelement } from "./generated/anyelement"; +export { Anyenum } from "./generated/anyenum"; +export { Anymultirange } from "./generated/anymultirange"; +export { Anynonarray } from "./generated/anynonarray"; +export { Anyrange } from "./generated/anyrange"; +export { Bit } from "./generated/bit"; +export { Bool } from "./overrides/bool"; +export { Bpchar } from "./generated/bpchar"; +export { Bytea } from "./generated/bytea"; +export { Char } from "./generated/char"; +export { Cid } from "./generated/cid"; +export { Cidr } from "./generated/cidr"; +export { Circle } from "./generated/circle"; +export { Date } from "./generated/date"; +export { Float4 } from "./generated/float4"; +export { Float8 } from "./generated/float8"; +export { Gtsvector } from "./generated/gtsvector"; +export { Inet } from "./generated/inet"; +export { Int2 } from "./generated/int2"; +export { Int4 } from "./generated/int4"; +export { Int8 } from "./generated/int8"; +export { Interval } from "./generated/interval"; +export { Json } from "./generated/json"; +export { Jsonb } from "./generated/jsonb"; +export { Jsonpath } from "./generated/jsonpath"; +export { Macaddr } from "./generated/macaddr"; +export { Macaddr8 } from "./generated/macaddr8"; +export { Money } from "./generated/money"; +export { Numeric } from "./generated/numeric"; +export { Oid } from "./generated/oid"; +export { Path } from "./generated/path"; +export { PgBrinBloomSummary } from "./generated/pg_brin_bloom_summary"; +export { PgBrinMinmaxMultiSummary } from "./generated/pg_brin_minmax_multi_summary"; +export { PgDependencies } from "./generated/pg_dependencies"; +export { PgLsn } from "./generated/pg_lsn"; +export { PgMcvList } from "./generated/pg_mcv_list"; +export { PgNdistinct } from "./generated/pg_ndistinct"; +export { PgNodeTree } from "./generated/pg_node_tree"; +export { PgSnapshot } from "./generated/pg_snapshot"; +export { Polygon } from "./generated/polygon"; +export { Record } from "./overrides/record"; +export { Refcursor } from "./generated/refcursor"; +export { Regclass } from "./generated/regclass"; +export { Regcollation } from "./generated/regcollation"; +export { Regconfig } from "./generated/regconfig"; +export { Regdictionary } from "./generated/regdictionary"; +export { Regnamespace } from "./generated/regnamespace"; +export { Regoper } from "./generated/regoper"; +export { Regoperator } from "./generated/regoperator"; +export { Regproc } from "./generated/regproc"; +export { Regprocedure } from "./generated/regprocedure"; +export { Regrole } from "./generated/regrole"; +export { Regtype } from "./generated/regtype"; +export { Text } from "./generated/text"; +export { Tid } from "./generated/tid"; +export { Time } from "./generated/time"; +export { Timestamp } from "./generated/timestamp"; +export { Timestamptz } from "./generated/timestamptz"; +export { Timetz } from "./generated/timetz"; +export { Tsquery } from "./generated/tsquery"; +export { Tsvector } from "./generated/tsvector"; +export { TxidSnapshot } from "./generated/txid_snapshot"; +export { Unknown } from "./generated/unknown"; +export { Uuid } from "./generated/uuid"; +export { Varbit } from "./generated/varbit"; +export { Varchar } from "./generated/varchar"; +export { Xid } from "./generated/xid"; +export { Xid8 } from "./generated/xid8"; +export { Xml } from "./generated/xml"; +// [generated-end] diff --git a/src/types/introspect.ts b/src/types/postgres/introspect.ts similarity index 100% rename from src/types/introspect.ts rename to src/types/postgres/introspect.ts diff --git a/src/types/overrides/any.ts b/src/types/postgres/overrides/any.ts similarity index 97% rename from src/types/overrides/any.ts rename to src/types/postgres/overrides/any.ts index 8a9a2f1..47ba885 100644 --- a/src/types/overrides/any.ts +++ b/src/types/postgres/overrides/any.ts @@ -1,10 +1,10 @@ import { Any as Generated } from "../generated/any"; -import { getTypeDef } from "../deserialize"; -import { meta } from "../runtime"; -import type { NullOf, StrictNull, TsTypeOf } from "../runtime"; -import { Column, Param, sql, Sql, TypedParam, Unbound } from "../../builder/sql"; -import { expose } from "../../exoeval/tool"; -import { isPlainData } from "../../util"; +import { getTypeDef } from "../../deserialize"; +import { meta } from "../../runtime"; +import type { NullOf, StrictNull, TsTypeOf } from "../../runtime"; +import { Column, Param, sql, Sql, TypedParam, Unbound } from "../../../builder/sql"; +import { expose } from "../../../exoeval/tool"; +import { isPlainData } from "../../../util"; import * as types from "../index"; type ColumnOpts = { nonNull?: boolean; default?: Sql; generated?: boolean }; diff --git a/src/types/overrides/anyarray.ts b/src/types/postgres/overrides/anyarray.ts similarity index 87% rename from src/types/overrides/anyarray.ts rename to src/types/postgres/overrides/anyarray.ts index ce6c218..06c5d4d 100644 --- a/src/types/overrides/anyarray.ts +++ b/src/types/postgres/overrides/anyarray.ts @@ -1,10 +1,10 @@ import { Anyarray as Generated } from "../generated/anyarray"; import type { Any } from "../index"; import { Int2, Int4, Int8 } from "../index"; -import { meta } from "../runtime"; -import type { Sql } from "../../builder/sql"; -import { sql } from "../../builder/sql"; -import { expose } from "../../exoeval/tool"; +import { meta } from "../../runtime"; +import type { Sql } from "../../../builder/sql"; +import { sql } from "../../../builder/sql"; +import { expose } from "../../../exoeval/tool"; export class Anyarray, N extends number> extends Generated { static __element: Any; diff --git a/src/types/overrides/anycompatiblearray.ts b/src/types/postgres/overrides/anycompatiblearray.ts similarity index 96% rename from src/types/overrides/anycompatiblearray.ts rename to src/types/postgres/overrides/anycompatiblearray.ts index 42ef8ec..b761f87 100644 --- a/src/types/overrides/anycompatiblearray.ts +++ b/src/types/postgres/overrides/anycompatiblearray.ts @@ -1,7 +1,7 @@ -import { meta, type TsTypeOf } from "../runtime"; +import { meta, type TsTypeOf } from "../../runtime"; import { Anycompatiblearray as Generated } from "../generated/anycompatiblearray"; import type { Any } from "../index"; -import { sql } from "../../builder/sql"; +import { sql } from "../../../builder/sql"; export class Anycompatiblearray, N extends number> extends Generated { static __element: Any; diff --git a/src/types/overrides/bool.ts b/src/types/postgres/overrides/bool.ts similarity index 89% rename from src/types/overrides/bool.ts rename to src/types/postgres/overrides/bool.ts index 608d4d0..355176d 100644 --- a/src/types/overrides/bool.ts +++ b/src/types/postgres/overrides/bool.ts @@ -1,6 +1,6 @@ import { Bool as Generated } from "../generated/bool"; -import { Op, UnaryOp, sql } from "../../builder/sql"; -import type { StrictNull, NullOf } from "../runtime"; +import { Op, UnaryOp, sql } from "../../../builder/sql"; +import type { StrictNull, NullOf } from "../../runtime"; export class Bool extends Generated { // Codegen skips `declare deserialize` when an override exists (the override diff --git a/src/types/overrides/record.ts b/src/types/postgres/overrides/record.ts similarity index 93% rename from src/types/overrides/record.ts rename to src/types/postgres/overrides/record.ts index 5487f26..d2c0762 100644 --- a/src/types/overrides/record.ts +++ b/src/types/postgres/overrides/record.ts @@ -1,7 +1,7 @@ import { Record as Generated } from "../generated/record"; -import type { RowType, RowTypeToTsType } from "../../builder/query"; -import { sql } from "../../builder/sql"; -import { deserializeRows } from "../../util"; +import type { RowType, RowTypeToTsType } from "../../../builder/query"; +import { sql } from "../../../builder/sql"; +import { deserializeRows } from "../../../util"; // Pg composite format parser: `(val1,val2,...)` → per-field string, or null // for a pg NULL field. Pg encodes NULL as absence between commas From e33b36fa037528a6b5c612c4b962e47236bb02d1 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 27 May 2026 16:30:23 -0700 Subject: [PATCH 02/33] refactor(types): rename PgFunc/PgOp/PgSrf runtime helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 0.2 of SQLite generalization. Drop the Pg* prefix from runtime expression builders since they aren't dialect-specific (they just wrap the dialect-agnostic Func/Op AST nodes in builder/sql.ts). - runtime.PgFunc → runtime.funcCall (lowercase factory; Func is taken) - runtime.PgOp → runtime.opCall (lowercase factory; Op is taken) - runtime.PgSrf → runtime.Srf (class — no name collision) The PgFunc interface in src/types/postgres/introspect.ts is unchanged — it represents a pg_catalog function row and remains PG-specific. Codegen template and all 77 generated/ files updated via npm run codegen. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/query.ts | 2 +- src/types/postgres/generate.ts | 12 +- src/types/postgres/generated/aclitem.ts | 4 +- src/types/postgres/generated/any.ts | 30 +-- src/types/postgres/generated/anyarray.ts | 68 +++--- src/types/postgres/generated/anycompatible.ts | 2 +- .../postgres/generated/anycompatiblearray.ts | 12 +- src/types/postgres/generated/anyelement.ts | 18 +- src/types/postgres/generated/anyenum.ts | 32 +-- src/types/postgres/generated/anymultirange.ts | 110 ++++----- src/types/postgres/generated/anynonarray.ts | 2 +- src/types/postgres/generated/anyrange.ts | 104 ++++---- src/types/postgres/generated/bit.ts | 78 +++--- src/types/postgres/generated/bool.ts | 40 ++-- src/types/postgres/generated/bpchar.ts | 92 ++++---- src/types/postgres/generated/bytea.ts | 88 +++---- src/types/postgres/generated/char.ts | 32 +-- src/types/postgres/generated/cid.ts | 6 +- src/types/postgres/generated/cidr.ts | 6 +- src/types/postgres/generated/circle.ts | 88 +++---- src/types/postgres/generated/date.ts | 50 ++-- src/types/postgres/generated/float4.ts | 80 +++---- src/types/postgres/generated/float8.ts | 208 ++++++++-------- src/types/postgres/generated/inet.ts | 92 ++++---- src/types/postgres/generated/int2.ts | 112 ++++----- src/types/postgres/generated/int4.ts | 152 ++++++------ src/types/postgres/generated/int8.ts | 154 ++++++------ src/types/postgres/generated/interval.ts | 70 +++--- src/types/postgres/generated/json.ts | 30 +-- src/types/postgres/generated/jsonb.ts | 108 ++++----- src/types/postgres/generated/jsonpath.ts | 2 +- src/types/postgres/generated/macaddr.ts | 40 ++-- src/types/postgres/generated/macaddr8.ts | 42 ++-- src/types/postgres/generated/money.ts | 54 ++--- src/types/postgres/generated/numeric.ts | 154 ++++++------ src/types/postgres/generated/oid.ts | 46 ++-- src/types/postgres/generated/path.ts | 54 ++--- src/types/postgres/generated/pg_lsn.ts | 48 ++-- src/types/postgres/generated/pg_snapshot.ts | 8 +- src/types/postgres/generated/polygon.ts | 64 ++--- src/types/postgres/generated/record.ts | 48 ++-- src/types/postgres/generated/regclass.ts | 4 +- src/types/postgres/generated/regcollation.ts | 2 +- src/types/postgres/generated/regconfig.ts | 18 +- src/types/postgres/generated/regdictionary.ts | 2 +- src/types/postgres/generated/regnamespace.ts | 2 +- src/types/postgres/generated/regoper.ts | 2 +- src/types/postgres/generated/regoperator.ts | 2 +- src/types/postgres/generated/regproc.ts | 2 +- src/types/postgres/generated/regprocedure.ts | 2 +- src/types/postgres/generated/regrole.ts | 2 +- src/types/postgres/generated/regtype.ts | 2 +- src/types/postgres/generated/text.ts | 222 +++++++++--------- src/types/postgres/generated/tid.ts | 34 +-- src/types/postgres/generated/time.ts | 48 ++-- src/types/postgres/generated/timestamp.ts | 58 ++--- src/types/postgres/generated/timestamptz.ts | 58 ++--- src/types/postgres/generated/timetz.ts | 48 ++-- src/types/postgres/generated/tsquery.ts | 60 ++--- src/types/postgres/generated/tsvector.ts | 50 ++-- src/types/postgres/generated/txid_snapshot.ts | 8 +- src/types/postgres/generated/unknown.ts | 2 +- src/types/postgres/generated/uuid.ts | 30 +-- src/types/postgres/generated/varbit.ts | 32 +-- src/types/postgres/generated/varchar.ts | 2 +- src/types/postgres/generated/xid.ts | 10 +- src/types/postgres/generated/xid8.ts | 38 +-- src/types/postgres/generated/xml.ts | 8 +- src/types/runtime.ts | 6 +- 69 files changed, 1598 insertions(+), 1598 deletions(-) diff --git a/src/builder/query.ts b/src/builder/query.ts index 0a790d0..a50a84f 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -124,7 +124,7 @@ export const sortRowColumns = (row: R): R => { // // Two shapes satisfy this structurally: // - Table *classes* via statics (`Users.tsAlias`, `Users.rowType()`, `Users.bind()`) -// - Instance-based sources (Values, PgSrf, QB subqueries) via instance +// - Instance-based sources (Values, Srf, QB subqueries) via instance // fields/methods of the same names. export type Fromable = { readonly tsAlias: A; diff --git a/src/types/postgres/generate.ts b/src/types/postgres/generate.ts index ec3dc2d..9b25f96 100644 --- a/src/types/postgres/generate.ts +++ b/src/types/postgres/generate.ts @@ -429,16 +429,16 @@ const generateTypeFile = ( const cases = funcs.map((fn) => buildMatchCase(fn, allowMap.get(fn) ?? false)); const matchCall = `runtime.match([${inputArgs.join(", ")}], [${cases.join(", ")}])`; const caller = f0.isSrf - ? `new runtime.PgSrf("${f0.name}", [this, ...__rest], [["${f0.name}", __rt]])` + ? `new runtime.Srf("${f0.name}", [this, ...__rest], [["${f0.name}", __rt]])` : f0.isOperator - ? `runtime.PgOp(runtime.sql\`${f0.name}\`, [this, ...__rest] as [unknown, unknown], __rt)` - : `runtime.PgFunc("${f0.name}", [this, ...__rest], __rt)`; + ? `runtime.opCall(runtime.sql\`${f0.name}\`, [this, ...__rest] as [unknown, unknown], __rt)` + : `runtime.funcCall("${f0.name}", [this, ...__rest], __rt)`; return `const [__rt, ...__rest] = ${matchCall}; return ${caller} as any;`; }; // Wrap a bare pg return type for SRFs: `Int4` → `PgSrf<{ name: Int4 }, "name">`. const wrapSrfRet = (f: PgFunc, retType: string): string => - `runtime.PgSrf<{ ${f.name}: ${retType} }, "${f.name}">`; + `runtime.Srf<{ ${f.name}: ${retType} }, "${f.name}">`; // --- Emit methods --- @@ -459,9 +459,9 @@ const generateTypeFile = ( const colEntries = f0.outColumns.map((c) => { const t = typeMap.get(c.typeOid)!; return `${c.name}: types.${t.className}<1>`; }); const colRuntime = f0.outColumns.map((c) => { const t = typeMap.get(c.typeOid)!; return `["${c.name}", types.${t.className}]`; }); const sig = buildSig(f0, true); - const ret = `runtime.PgSrf<{ ${colEntries.join("; ")} }, "${f0.name}">`; + const ret = `runtime.Srf<{ ${colEntries.join("; ")} }, "${f0.name}">`; lines.push(` @expose.unchecked()`); - lines.push(` ${sig}: ${ret} { return new runtime.PgSrf("${f0.name}", [${allArgs}], [${colRuntime.join(", ")}]) as any; }`); + lines.push(` ${sig}: ${ret} { return new runtime.Srf("${f0.name}", [${allArgs}], [${colRuntime.join(", ")}]) as any; }`); continue; } diff --git a/src/types/postgres/generated/aclitem.ts b/src/types/postgres/generated/aclitem.ts index bcb61f9..7691095 100644 --- a/src/types/postgres/generated/aclitem.ts +++ b/src/types/postgres/generated/aclitem.ts @@ -18,7 +18,7 @@ export class Aclitem extends Anynonarray { static __typnameText = "aclitem"; declare deserialize: (raw: string) => string; @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Aclitem, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Aclitem, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Aclitem, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Aclitem, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/any.ts b/src/types/postgres/generated/any.ts index e9265f7..1305b11 100644 --- a/src/types/postgres/generated/any.ts +++ b/src/types/postgres/generated/any.ts @@ -5,33 +5,33 @@ import * as types from "../index"; export class Any { @expose.unchecked() - numNonnulls(): types.Int4<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("num_nonnulls", [this, ...__rest], __rt) as any; } + numNonnulls(): types.Int4<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("num_nonnulls", [this, ...__rest], __rt) as any; } @expose.unchecked() - numNulls(): types.Int4<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("num_nulls", [this, ...__rest], __rt) as any; } + numNulls(): types.Int4<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("num_nulls", [this, ...__rest], __rt) as any; } @expose.unchecked() - count(): types.Int8<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("count", [this, ...__rest], __rt) as any; } + count(): types.Int8<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("count", [this, ...__rest], __rt) as any; } @expose.unchecked() - cumeDist(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("cume_dist", [this, ...__rest], __rt) as any; } + cumeDist(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("cume_dist", [this, ...__rest], __rt) as any; } @expose.unchecked() - denseRank(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("dense_rank", [this, ...__rest], __rt) as any; } + denseRank(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("dense_rank", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonObjectAgg | string>(arg0: M0): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Json]]); return runtime.PgFunc("json_object_agg", [this, ...__rest], __rt) as any; } + jsonObjectAgg | string>(arg0: M0): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Json]]); return runtime.funcCall("json_object_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonObjectAggStrict | string>(arg0: M0): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Json]]); return runtime.PgFunc("json_object_agg_strict", [this, ...__rest], __rt) as any; } + jsonObjectAggStrict | string>(arg0: M0): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Json]]); return runtime.funcCall("json_object_agg_strict", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonObjectAggUnique | string>(arg0: M0): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Json]]); return runtime.PgFunc("json_object_agg_unique", [this, ...__rest], __rt) as any; } + jsonObjectAggUnique | string>(arg0: M0): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Json]]); return runtime.funcCall("json_object_agg_unique", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonObjectAggUniqueStrict | string>(arg0: M0): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Json]]); return runtime.PgFunc("json_object_agg_unique_strict", [this, ...__rest], __rt) as any; } + jsonObjectAggUniqueStrict | string>(arg0: M0): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Json]]); return runtime.funcCall("json_object_agg_unique_strict", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbObjectAgg | string>(arg0: M0): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_object_agg", [this, ...__rest], __rt) as any; } + jsonbObjectAgg | string>(arg0: M0): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_object_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbObjectAggStrict | string>(arg0: M0): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_object_agg_strict", [this, ...__rest], __rt) as any; } + jsonbObjectAggStrict | string>(arg0: M0): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_object_agg_strict", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbObjectAggUnique | string>(arg0: M0): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_object_agg_unique", [this, ...__rest], __rt) as any; } + jsonbObjectAggUnique | string>(arg0: M0): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_object_agg_unique", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbObjectAggUniqueStrict | string>(arg0: M0): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_object_agg_unique_strict", [this, ...__rest], __rt) as any; } + jsonbObjectAggUniqueStrict | string>(arg0: M0): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_object_agg_unique_strict", [this, ...__rest], __rt) as any; } @expose.unchecked() - percentRank(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("percent_rank", [this, ...__rest], __rt) as any; } + percentRank(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("percent_rank", [this, ...__rest], __rt) as any; } @expose.unchecked() - rank(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("rank", [this, ...__rest], __rt) as any; } + rank(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("rank", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/anyarray.ts b/src/types/postgres/generated/anyarray.ts index 4bdeaff..c6b5fbc 100644 --- a/src/types/postgres/generated/anyarray.ts +++ b/src/types/postgres/generated/anyarray.ts @@ -6,69 +6,69 @@ import * as types from "../index"; export class Anyarray, in out N extends number> extends Anycompatiblearray { @expose.unchecked() - arrayDims(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("array_dims", [this, ...__rest], __rt) as any; } + arrayDims(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("array_dims", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayLarger | runtime.TsTypeOf[]>(arg0: M0): types.Anyarray>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("array_larger", [this, ...__rest], __rt) as any; } + arrayLarger | runtime.TsTypeOf[]>(arg0: M0): types.Anyarray>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayLength | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("array_length", [this, ...__rest], __rt) as any; } + arrayLength | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("array_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayLower | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("array_lower", [this, ...__rest], __rt) as any; } + arrayLower | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("array_lower", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayNdims(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("array_ndims", [this, ...__rest], __rt) as any; } + arrayNdims(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("array_ndims", [this, ...__rest], __rt) as any; } @expose.unchecked() - arraySmaller | runtime.TsTypeOf[]>(arg0: M0): types.Anyarray>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("array_smaller", [this, ...__rest], __rt) as any; } + arraySmaller | runtime.TsTypeOf[]>(arg0: M0): types.Anyarray>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayUpper | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("array_upper", [this, ...__rest], __rt) as any; } + arrayUpper | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("array_upper", [this, ...__rest], __rt) as any; } @expose.unchecked() - arraycontained | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("arraycontained", [this, ...__rest], __rt) as any; } + arraycontained | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("arraycontained", [this, ...__rest], __rt) as any; } @expose.unchecked() - arraycontains | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("arraycontains", [this, ...__rest], __rt) as any; } + arraycontains | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("arraycontains", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayoverlap | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("arrayoverlap", [this, ...__rest], __rt) as any; } + arrayoverlap | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("arrayoverlap", [this, ...__rest], __rt) as any; } @expose.unchecked() - cardinality(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("cardinality", [this, ...__rest], __rt) as any; } + cardinality(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("cardinality", [this, ...__rest], __rt) as any; } @expose.unchecked() - trimArray | number>(arg0: M0): types.Anyarray>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("trim_array", [this, ...__rest], __rt) as any; } + trimArray | number>(arg0: M0): types.Anyarray>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("trim_array", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayAgg(): types.Anyarray { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("array_agg", [this, ...__rest], __rt) as any; } + arrayAgg(): types.Anyarray { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("array_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Anyarray { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Anyarray { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Anyarray { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } - generateSubscripts | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): runtime.PgSrf<{ generate_subscripts: types.Int4 | runtime.NullOf>> }, "generate_subscripts">; - generateSubscripts | number>(arg0: M0): runtime.PgSrf<{ generate_subscripts: types.Int4>> }, "generate_subscripts">; + min(): types.Anyarray { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } + generateSubscripts | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): runtime.Srf<{ generate_subscripts: types.Int4 | runtime.NullOf>> }, "generate_subscripts">; + generateSubscripts | number>(arg0: M0): runtime.Srf<{ generate_subscripts: types.Int4>> }, "generate_subscripts">; @expose.unchecked() - generateSubscripts(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return new runtime.PgSrf("generate_subscripts", [this, ...__rest], [["generate_subscripts", __rt]]) as any; } + generateSubscripts(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return new runtime.Srf("generate_subscripts", [this, ...__rest], [["generate_subscripts", __rt]]) as any; } @expose.unchecked() - unnest(): runtime.PgSrf<{ unnest: T }, "unnest"> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return new runtime.PgSrf("unnest", [this, ...__rest], [["unnest", __rt]]) as any; } + unnest(): runtime.Srf<{ unnest: T }, "unnest"> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return new runtime.Srf("unnest", [this, ...__rest], [["unnest", __rt]]) as any; } @expose.unchecked() - ['&&'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&&'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<@'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<@'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyarray, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/anycompatible.ts b/src/types/postgres/generated/anycompatible.ts index 57f2bdb..8c97e92 100644 --- a/src/types/postgres/generated/anycompatible.ts +++ b/src/types/postgres/generated/anycompatible.ts @@ -6,5 +6,5 @@ import * as types from "../index"; export class Anycompatible extends Any { @expose.unchecked() - arrayPrepend, any>>(arg0: M0): types.Anycompatiblearray, 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatiblearray, allowPrimitive: true }], types.Anycompatiblearray]]); return runtime.PgFunc("array_prepend", [this, ...__rest], __rt) as any; } + arrayPrepend, any>>(arg0: M0): types.Anycompatiblearray, 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatiblearray, allowPrimitive: true }], types.Anycompatiblearray]]); return runtime.funcCall("array_prepend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/anycompatiblearray.ts b/src/types/postgres/generated/anycompatiblearray.ts index 13737a9..7c25464 100644 --- a/src/types/postgres/generated/anycompatiblearray.ts +++ b/src/types/postgres/generated/anycompatiblearray.ts @@ -6,19 +6,19 @@ import * as types from "../index"; export class Anycompatiblearray, in out N extends number> extends Anyelement { @expose.unchecked() - arrayAppend>(arg0: M0): types.Anycompatiblearray { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("array_append", [this, ...__rest], __rt) as any; } + arrayAppend>(arg0: M0): types.Anycompatiblearray { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_append", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayCat | runtime.TsTypeOf[]>(arg0: M0): types.Anycompatiblearray { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatiblearray, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("array_cat", [this, ...__rest], __rt) as any; } + arrayCat | runtime.TsTypeOf[]>(arg0: M0): types.Anycompatiblearray { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatiblearray, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_cat", [this, ...__rest], __rt) as any; } arrayPosition, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Int4<1>; arrayPosition>(arg0: M0): types.Int4<1>; @expose.unchecked() - arrayPosition(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Anycompatible, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Anycompatible, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("array_position", [this, ...__rest], __rt) as any; } + arrayPosition(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Anycompatible, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Anycompatible, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("array_position", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayRemove>(arg0: M0): types.Anycompatiblearray { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("array_remove", [this, ...__rest], __rt) as any; } + arrayRemove>(arg0: M0): types.Anycompatiblearray { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_remove", [this, ...__rest], __rt) as any; } @expose.unchecked() - arrayReplace, M1 extends T | runtime.TsTypeOf>(arg0: M0, arg1: M1): types.Anycompatiblearray { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Anycompatible, allowPrimitive: true }, { type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("array_replace", [this, ...__rest], __rt) as any; } + arrayReplace, M1 extends T | runtime.TsTypeOf>(arg0: M0, arg1: M1): types.Anycompatiblearray { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Anycompatible, allowPrimitive: true }, { type: types.Anycompatible, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("array_replace", [this, ...__rest], __rt) as any; } ['||'] | runtime.TsTypeOf[]>(arg0: M0): types.Anycompatiblearray>>; ['||'](arg0: M0): types.Anycompatiblearray>>; @expose.unchecked() - ['||'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatiblearray, allowPrimitive: true }], runtime.pgType(this)], [[{ type: types.Anycompatible }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['||'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anycompatiblearray, allowPrimitive: true }], runtime.pgType(this)], [[{ type: types.Anycompatible }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/anyelement.ts b/src/types/postgres/generated/anyelement.ts index 6dd6ca8..1a4bba4 100644 --- a/src/types/postgres/generated/anyelement.ts +++ b/src/types/postgres/generated/anyelement.ts @@ -6,21 +6,21 @@ import * as types from "../index"; export class Anyelement extends Anycompatible { @expose.unchecked() - anyValueTransfn>(arg0: M0): types.Anyelement>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("any_value_transfn", [this, ...__rest], __rt) as any; } + anyValueTransfn>(arg0: M0): types.Anyelement>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("any_value_transfn", [this, ...__rest], __rt) as any; } @expose.unchecked() - elemContainedByMultirange, any>>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("elem_contained_by_multirange", [this, ...__rest], __rt) as any; } + elemContainedByMultirange, any>>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("elem_contained_by_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - elemContainedByRange, any>>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("elem_contained_by_range", [this, ...__rest], __rt) as any; } + elemContainedByRange, any>>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("elem_contained_by_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - anyValue(): types.Anyelement<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("any_value", [this, ...__rest], __rt) as any; } + anyValue(): types.Anyelement<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("any_value", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonAgg(): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Json]]); return runtime.PgFunc("json_agg", [this, ...__rest], __rt) as any; } + jsonAgg(): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Json]]); return runtime.funcCall("json_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonAggStrict(): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Json]]); return runtime.PgFunc("json_agg_strict", [this, ...__rest], __rt) as any; } + jsonAggStrict(): types.Json<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Json]]); return runtime.funcCall("json_agg_strict", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbAgg(): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Jsonb]]); return runtime.PgFunc("jsonb_agg", [this, ...__rest], __rt) as any; } + jsonbAgg(): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Jsonb]]); return runtime.funcCall("jsonb_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbAggStrict(): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Jsonb]]); return runtime.PgFunc("jsonb_agg_strict", [this, ...__rest], __rt) as any; } + jsonbAggStrict(): types.Jsonb<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Jsonb]]); return runtime.funcCall("jsonb_agg_strict", [this, ...__rest], __rt) as any; } @expose.unchecked() - mode(): types.Anyelement<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("mode", [this, ...__rest], __rt) as any; } + mode(): types.Anyelement<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("mode", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/anyenum.ts b/src/types/postgres/generated/anyenum.ts index e7645e6..f67da9b 100644 --- a/src/types/postgres/generated/anyenum.ts +++ b/src/types/postgres/generated/anyenum.ts @@ -6,35 +6,35 @@ import * as types from "../index"; export class Anyenum extends Anynonarray { @expose.unchecked() - enumLarger>(arg0: M0): types.Anyenum>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("enum_larger", [this, ...__rest], __rt) as any; } + enumLarger>(arg0: M0): types.Anyenum>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("enum_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - enumSmaller>(arg0: M0): types.Anyenum>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("enum_smaller", [this, ...__rest], __rt) as any; } + enumSmaller>(arg0: M0): types.Anyenum>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("enum_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Anyenum<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Anyenum<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Anyenum<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Anyenum<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['<']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<=']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<=']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['=']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['=']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>=']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>=']>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyenum, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/anymultirange.ts b/src/types/postgres/generated/anymultirange.ts index d81002c..eaca5f4 100644 --- a/src/types/postgres/generated/anymultirange.ts +++ b/src/types/postgres/generated/anymultirange.ts @@ -6,130 +6,130 @@ import * as types from "../index"; export class Anymultirange, in out N extends number> extends Anycompatiblemultirange { @expose.unchecked() - isempty(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("isempty", [this, ...__rest], __rt) as any; } + isempty(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("isempty", [this, ...__rest], __rt) as any; } @expose.unchecked() - lower(): T { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return runtime.PgFunc("lower", [this, ...__rest], __rt) as any; } + lower(): T { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return runtime.funcCall("lower", [this, ...__rest], __rt) as any; } @expose.unchecked() - lowerInc(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("lower_inc", [this, ...__rest], __rt) as any; } + lowerInc(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("lower_inc", [this, ...__rest], __rt) as any; } @expose.unchecked() - lowerInf(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("lower_inf", [this, ...__rest], __rt) as any; } + lowerInf(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("lower_inf", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeAdjacentMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_adjacent_multirange", [this, ...__rest], __rt) as any; } + multirangeAdjacentMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_adjacent_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeAdjacentRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_adjacent_range", [this, ...__rest], __rt) as any; } + multirangeAdjacentRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_adjacent_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeAfterMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_after_multirange", [this, ...__rest], __rt) as any; } + multirangeAfterMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_after_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeAfterRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_after_range", [this, ...__rest], __rt) as any; } + multirangeAfterRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_after_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeBeforeMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_before_multirange", [this, ...__rest], __rt) as any; } + multirangeBeforeMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_before_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeBeforeRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_before_range", [this, ...__rest], __rt) as any; } + multirangeBeforeRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_before_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeContainedByMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_contained_by_multirange", [this, ...__rest], __rt) as any; } + multirangeContainedByMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_contained_by_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeContainedByRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_contained_by_range", [this, ...__rest], __rt) as any; } + multirangeContainedByRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_contained_by_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeContainsElem>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_contains_elem", [this, ...__rest], __rt) as any; } + multirangeContainsElem>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_contains_elem", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeContainsMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_contains_multirange", [this, ...__rest], __rt) as any; } + multirangeContainsMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_contains_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeContainsRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_contains_range", [this, ...__rest], __rt) as any; } + multirangeContainsRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_contains_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeIntersectAggTransfn | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("multirange_intersect_agg_transfn", [this, ...__rest], __rt) as any; } + multirangeIntersectAggTransfn | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("multirange_intersect_agg_transfn", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeOverlapsMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_overlaps_multirange", [this, ...__rest], __rt) as any; } + multirangeOverlapsMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_overlaps_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeOverlapsRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_overlaps_range", [this, ...__rest], __rt) as any; } + multirangeOverlapsRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_overlaps_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeOverleftMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_overleft_multirange", [this, ...__rest], __rt) as any; } + multirangeOverleftMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_overleft_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeOverleftRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_overleft_range", [this, ...__rest], __rt) as any; } + multirangeOverleftRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_overleft_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeOverrightMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_overright_multirange", [this, ...__rest], __rt) as any; } + multirangeOverrightMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_overright_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirangeOverrightRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("multirange_overright_range", [this, ...__rest], __rt) as any; } + multirangeOverrightRange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("multirange_overright_range", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeMerge(): types.Anyrange { const [__rt, ...__rest] = runtime.match([], [[[], types.Anyrange]]); return runtime.PgFunc("range_merge", [this, ...__rest], __rt) as any; } + rangeMerge(): types.Anyrange { const [__rt, ...__rest] = runtime.match([], [[[], types.Anyrange]]); return runtime.funcCall("range_merge", [this, ...__rest], __rt) as any; } @expose.unchecked() - upper(): T { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return runtime.PgFunc("upper", [this, ...__rest], __rt) as any; } + upper(): T { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return runtime.funcCall("upper", [this, ...__rest], __rt) as any; } @expose.unchecked() - upperInc(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("upper_inc", [this, ...__rest], __rt) as any; } + upperInc(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("upper_inc", [this, ...__rest], __rt) as any; } @expose.unchecked() - upperInf(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("upper_inf", [this, ...__rest], __rt) as any; } + upperInf(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("upper_inf", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeAgg(): types.Anymultirange { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("range_agg", [this, ...__rest], __rt) as any; } + rangeAgg(): types.Anymultirange { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("range_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeIntersectAgg(): types.Anymultirange { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("range_intersect_agg", [this, ...__rest], __rt) as any; } + rangeIntersectAgg(): types.Anymultirange { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("range_intersect_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - unnest(): runtime.PgSrf<{ unnest: types.Anyrange }, "unnest"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Anyrange]]); return new runtime.PgSrf("unnest", [this, ...__rest], [["unnest", __rt]]) as any; } + unnest(): runtime.Srf<{ unnest: types.Anyrange }, "unnest"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Anyrange]]); return new runtime.Srf("unnest", [this, ...__rest], [["unnest", __rt]]) as any; } ['&&']>(arg0: M0): types.Bool>>; ['&&'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['&&'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&&'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['&<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; ['&<']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['&<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.PgOp(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.opCall(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['&>']>(arg0: M0): types.Bool>>; ['&>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['&>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['*'] | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'] | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - times | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['+'] | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'] | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - plus | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['-'] | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'] | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - minus | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus | runtime.TsTypeOf[]>(arg0: M0): types.Anymultirange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-|-']>(arg0: M0): types.Bool>>; ['-|-'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['-|-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`-|-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-|-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`-|-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; ['<<']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<@']>(arg0: M0): types.Bool>>; ['<@'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<@'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<@'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; ['>>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['@>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; ['@>']>(arg0: M0): types.Bool>>; ['@>'](arg0: M0): types.Bool>>; @expose.unchecked() - ['@>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anyelement }], types.Bool]]); return runtime.PgOp(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool], [[{ type: types.Anyrange }], types.Bool], [[{ type: types.Anyelement }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/anynonarray.ts b/src/types/postgres/generated/anynonarray.ts index f04d2ef..c1cda0f 100644 --- a/src/types/postgres/generated/anynonarray.ts +++ b/src/types/postgres/generated/anynonarray.ts @@ -6,5 +6,5 @@ import * as types from "../index"; export class Anynonarray extends Anycompatiblenonarray { @expose.unchecked() - arrayAgg(): types.Anyarray, 0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Anyarray]]); return runtime.PgFunc("array_agg", [this, ...__rest], __rt) as any; } + arrayAgg(): types.Anyarray, 0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Anyarray]]); return runtime.funcCall("array_agg", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/anyrange.ts b/src/types/postgres/generated/anyrange.ts index a4bbb62..0135444 100644 --- a/src/types/postgres/generated/anyrange.ts +++ b/src/types/postgres/generated/anyrange.ts @@ -6,124 +6,124 @@ import * as types from "../index"; export class Anyrange, in out N extends number> extends Anycompatiblerange { @expose.unchecked() - lower(): T { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return runtime.PgFunc("lower", [this, ...__rest], __rt) as any; } + lower(): T { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return runtime.funcCall("lower", [this, ...__rest], __rt) as any; } @expose.unchecked() - lowerInc(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("lower_inc", [this, ...__rest], __rt) as any; } + lowerInc(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("lower_inc", [this, ...__rest], __rt) as any; } @expose.unchecked() - lowerInf(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("lower_inf", [this, ...__rest], __rt) as any; } + lowerInf(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("lower_inf", [this, ...__rest], __rt) as any; } @expose.unchecked() - multirange(): types.Anymultirange { const [__rt, ...__rest] = runtime.match([], [[[], types.Anymultirange]]); return runtime.PgFunc("multirange", [this, ...__rest], __rt) as any; } + multirange(): types.Anymultirange { const [__rt, ...__rest] = runtime.match([], [[[], types.Anymultirange]]); return runtime.funcCall("multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeAdjacent | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_adjacent", [this, ...__rest], __rt) as any; } + rangeAdjacent | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_adjacent", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeAdjacentMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_adjacent_multirange", [this, ...__rest], __rt) as any; } + rangeAdjacentMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_adjacent_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeAfter | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_after", [this, ...__rest], __rt) as any; } + rangeAfter | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_after", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeAfterMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_after_multirange", [this, ...__rest], __rt) as any; } + rangeAfterMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_after_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeBefore | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_before", [this, ...__rest], __rt) as any; } + rangeBefore | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_before", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeBeforeMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_before_multirange", [this, ...__rest], __rt) as any; } + rangeBeforeMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_before_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeContainedBy | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_contained_by", [this, ...__rest], __rt) as any; } + rangeContainedBy | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_contained_by", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeContainedByMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_contained_by_multirange", [this, ...__rest], __rt) as any; } + rangeContainedByMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_contained_by_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeContainsElem>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_contains_elem", [this, ...__rest], __rt) as any; } + rangeContainsElem>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_contains_elem", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeContainsMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_contains_multirange", [this, ...__rest], __rt) as any; } + rangeContainsMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_contains_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeIntersectAggTransfn | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgFunc("range_intersect_agg_transfn", [this, ...__rest], __rt) as any; } + rangeIntersectAggTransfn | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.funcCall("range_intersect_agg_transfn", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeOverlaps | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_overlaps", [this, ...__rest], __rt) as any; } + rangeOverlaps | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_overlaps", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeOverlapsMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_overlaps_multirange", [this, ...__rest], __rt) as any; } + rangeOverlapsMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_overlaps_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeOverleft | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_overleft", [this, ...__rest], __rt) as any; } + rangeOverleft | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_overleft", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeOverleftMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_overleft_multirange", [this, ...__rest], __rt) as any; } + rangeOverleftMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_overleft_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeOverright | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_overright", [this, ...__rest], __rt) as any; } + rangeOverright | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_overright", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeOverrightMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("range_overright_multirange", [this, ...__rest], __rt) as any; } + rangeOverrightMultirange | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("range_overright_multirange", [this, ...__rest], __rt) as any; } @expose.unchecked() - upper(): T { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return runtime.PgFunc("upper", [this, ...__rest], __rt) as any; } + upper(): T { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgElement(this)]]); return runtime.funcCall("upper", [this, ...__rest], __rt) as any; } @expose.unchecked() - upperInc(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("upper_inc", [this, ...__rest], __rt) as any; } + upperInc(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("upper_inc", [this, ...__rest], __rt) as any; } @expose.unchecked() - upperInf(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("upper_inf", [this, ...__rest], __rt) as any; } + upperInf(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("upper_inf", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeAgg(): types.Anymultirange { const [__rt, ...__rest] = runtime.match([], [[[], types.Anymultirange]]); return runtime.PgFunc("range_agg", [this, ...__rest], __rt) as any; } + rangeAgg(): types.Anymultirange { const [__rt, ...__rest] = runtime.match([], [[[], types.Anymultirange]]); return runtime.funcCall("range_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - rangeIntersectAgg(): types.Anyrange { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.PgFunc("range_intersect_agg", [this, ...__rest], __rt) as any; } + rangeIntersectAgg(): types.Anyrange { const [__rt, ...__rest] = runtime.match([], [[[], runtime.pgType(this)]]); return runtime.funcCall("range_intersect_agg", [this, ...__rest], __rt) as any; } ['&&']>(arg0: M0): types.Bool>>; ['&&'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['&&'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&&'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['&<']>(arg0: M0): types.Bool>>; ['&<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['&<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['&>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; ['&>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['&>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool], [[{ type: types.Anymultirange }], types.Bool]]); return runtime.PgOp(runtime.sql`&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool], [[{ type: types.Anymultirange }], types.Bool]]); return runtime.opCall(runtime.sql`&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['*'] | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'] | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - times | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['+'] | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'] | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - plus | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['-'] | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'] | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - minus | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus | runtime.TsTypeOf[]>(arg0: M0): types.Anyrange>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], runtime.pgType(this)]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-|-']>(arg0: M0): types.Bool>>; ['-|-'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['-|-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`-|-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-|-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`-|-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<<']>(arg0: M0): types.Bool>>; ['<<'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<@'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; ['<@']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<@'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool], [[{ type: types.Anymultirange }], types.Bool]]); return runtime.PgOp(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<@'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool], [[{ type: types.Anymultirange }], types.Bool]]); return runtime.opCall(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | runtime.TsTypeOf[]>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>>']>(arg0: M0): types.Bool>>; ['>>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['@>'](arg0: M0): types.Bool>>; ['@>']>(arg0: M0): types.Bool>>; ['@>'] | runtime.TsTypeOf[]>(arg0: M0): types.Bool>>; @expose.unchecked() - ['@>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement }], types.Bool], [[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement }], types.Bool], [[{ type: types.Anymultirange }], types.Bool], [[{ type: types.Anyrange, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/bit.ts b/src/types/postgres/generated/bit.ts index 937c049..f315c46 100644 --- a/src/types/postgres/generated/bit.ts +++ b/src/types/postgres/generated/bit.ts @@ -18,85 +18,85 @@ export class Bit extends Anynonarray { static __typnameText = "bit"; declare deserialize: (raw: string) => string; @expose.unchecked() - bit | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): types.Bit | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("bit", [this, ...__rest], __rt) as any; } + bit | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): types.Bit | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("bit", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitCount(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("bit_count", [this, ...__rest], __rt) as any; } + bitCount(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("bit_count", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("bit_length", [this, ...__rest], __rt) as any; } + bitLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("bit_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("bit_send", [this, ...__rest], __rt) as any; } + bitSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("bit_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitand | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("bitand", [this, ...__rest], __rt) as any; } + bitand | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("bitand", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitnot(): types.Bit { const [__rt, ...__rest] = runtime.match([], [[[], types.Bit]]); return runtime.PgFunc("bitnot", [this, ...__rest], __rt) as any; } + bitnot(): types.Bit { const [__rt, ...__rest] = runtime.match([], [[[], types.Bit]]); return runtime.funcCall("bitnot", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitor | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("bitor", [this, ...__rest], __rt) as any; } + bitor | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("bitor", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitshiftleft | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("bitshiftleft", [this, ...__rest], __rt) as any; } + bitshiftleft | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("bitshiftleft", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitshiftright | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("bitshiftright", [this, ...__rest], __rt) as any; } + bitshiftright | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("bitshiftright", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitxor | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("bitxor", [this, ...__rest], __rt) as any; } + bitxor | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("bitxor", [this, ...__rest], __rt) as any; } @expose.unchecked() - getBit | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("get_bit", [this, ...__rest], __rt) as any; } + getBit | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("get_bit", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8", [this, ...__rest], __rt) as any; } + int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() - length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("length", [this, ...__rest], __rt) as any; } + length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("length", [this, ...__rest], __rt) as any; } @expose.unchecked() - octetLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("octet_length", [this, ...__rest], __rt) as any; } + octetLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("octet_length", [this, ...__rest], __rt) as any; } overlay | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Bit | runtime.NullOf | runtime.NullOf>>; overlay | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bit | runtime.NullOf>>; @expose.unchecked() - overlay(arg0: unknown, arg1: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Bit, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bit], [[{ type: types.Bit, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("overlay", [this, ...__rest], __rt) as any; } + overlay(arg0: unknown, arg1: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Bit, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bit], [[{ type: types.Bit, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("overlay", [this, ...__rest], __rt) as any; } @expose.unchecked() - position | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("position", [this, ...__rest], __rt) as any; } + position | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("position", [this, ...__rest], __rt) as any; } @expose.unchecked() - setBit | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bit | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("set_bit", [this, ...__rest], __rt) as any; } + setBit | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bit | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("set_bit", [this, ...__rest], __rt) as any; } substring | number>(arg0: M0): types.Bit>>; substring | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bit | runtime.NullOf>>; @expose.unchecked() - substring(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("substring", [this, ...__rest], __rt) as any; } + substring(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("substring", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitAnd(): types.Bit<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bit]]); return runtime.PgFunc("bit_and", [this, ...__rest], __rt) as any; } + bitAnd(): types.Bit<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bit]]); return runtime.funcCall("bit_and", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitOr(): types.Bit<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bit]]); return runtime.PgFunc("bit_or", [this, ...__rest], __rt) as any; } + bitOr(): types.Bit<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bit]]); return runtime.funcCall("bit_or", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitXor(): types.Bit<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bit]]); return runtime.PgFunc("bit_xor", [this, ...__rest], __rt) as any; } + bitXor(): types.Bit<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bit]]); return runtime.funcCall("bit_xor", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['#'] | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.PgOp(runtime.sql`#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['#'] | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.opCall(runtime.sql`#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&'] | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.PgOp(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&'] | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.opCall(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<'] | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'] | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>>'] | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'] | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|'] | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.PgOp(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|'] | string>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bit, allowPrimitive: true }], types.Bit]]); return runtime.opCall(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/bool.ts b/src/types/postgres/generated/bool.ts index b01ae75..091c95c 100644 --- a/src/types/postgres/generated/bool.ts +++ b/src/types/postgres/generated/bool.ts @@ -17,43 +17,43 @@ export class Bool extends Anynonarray { static __typname = runtime.sql`bool`; static __typnameText = "bool"; @expose.unchecked() - boolandStatefunc | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("booland_statefunc", [this, ...__rest], __rt) as any; } + boolandStatefunc | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("booland_statefunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - boolorStatefunc | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("boolor_statefunc", [this, ...__rest], __rt) as any; } + boolorStatefunc | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("boolor_statefunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - boolsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("boolsend", [this, ...__rest], __rt) as any; } + boolsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("boolsend", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("text", [this, ...__rest], __rt) as any; } + text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("text", [this, ...__rest], __rt) as any; } @expose.unchecked() - boolAnd(): types.Bool<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("bool_and", [this, ...__rest], __rt) as any; } + boolAnd(): types.Bool<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("bool_and", [this, ...__rest], __rt) as any; } @expose.unchecked() - boolOr(): types.Bool<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("bool_or", [this, ...__rest], __rt) as any; } + boolOr(): types.Bool<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("bool_or", [this, ...__rest], __rt) as any; } @expose.unchecked() - every(): types.Bool<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("every", [this, ...__rest], __rt) as any; } + every(): types.Bool<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("every", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['<'] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | boolean>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/bpchar.ts b/src/types/postgres/generated/bpchar.ts index 1f3ea00..2362758 100644 --- a/src/types/postgres/generated/bpchar.ts +++ b/src/types/postgres/generated/bpchar.ts @@ -18,95 +18,95 @@ export class Bpchar extends Anynonarray { static __typnameText = "bpchar"; declare deserialize: (raw: string) => string; @expose.unchecked() - bpchar | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): types.Bpchar | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Bpchar]]); return runtime.PgFunc("bpchar", [this, ...__rest], __rt) as any; } + bpchar | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): types.Bpchar | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Bpchar]]); return runtime.funcCall("bpchar", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharLarger | string>(arg0: M0): types.Bpchar>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bpchar]]); return runtime.PgFunc("bpchar_larger", [this, ...__rest], __rt) as any; } + bpcharLarger | string>(arg0: M0): types.Bpchar>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bpchar]]); return runtime.funcCall("bpchar_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharPatternGe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpchar_pattern_ge", [this, ...__rest], __rt) as any; } + bpcharPatternGe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpchar_pattern_ge", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharPatternGt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpchar_pattern_gt", [this, ...__rest], __rt) as any; } + bpcharPatternGt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpchar_pattern_gt", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharPatternLe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpchar_pattern_le", [this, ...__rest], __rt) as any; } + bpcharPatternLe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpchar_pattern_le", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharPatternLt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpchar_pattern_lt", [this, ...__rest], __rt) as any; } + bpcharPatternLt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpchar_pattern_lt", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharSmaller | string>(arg0: M0): types.Bpchar>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bpchar]]); return runtime.PgFunc("bpchar_smaller", [this, ...__rest], __rt) as any; } + bpcharSmaller | string>(arg0: M0): types.Bpchar>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bpchar]]); return runtime.funcCall("bpchar_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpchariclike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpchariclike", [this, ...__rest], __rt) as any; } + bpchariclike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpchariclike", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharicnlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpcharicnlike", [this, ...__rest], __rt) as any; } + bpcharicnlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpcharicnlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharicregexeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpcharicregexeq", [this, ...__rest], __rt) as any; } + bpcharicregexeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpcharicregexeq", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharicregexne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpcharicregexne", [this, ...__rest], __rt) as any; } + bpcharicregexne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpcharicregexne", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpcharlike", [this, ...__rest], __rt) as any; } + bpcharlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpcharlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharnlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpcharnlike", [this, ...__rest], __rt) as any; } + bpcharnlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpcharnlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharregexeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpcharregexeq", [this, ...__rest], __rt) as any; } + bpcharregexeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpcharregexeq", [this, ...__rest], __rt) as any; } @expose.unchecked() - bpcharregexne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bpcharregexne", [this, ...__rest], __rt) as any; } + bpcharregexne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bpcharregexne", [this, ...__rest], __rt) as any; } @expose.unchecked() - charLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("char_length", [this, ...__rest], __rt) as any; } + charLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("char_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - characterLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("character_length", [this, ...__rest], __rt) as any; } + characterLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("character_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("length", [this, ...__rest], __rt) as any; } + length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("length", [this, ...__rest], __rt) as any; } @expose.unchecked() - octetLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("octet_length", [this, ...__rest], __rt) as any; } + octetLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("octet_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("text", [this, ...__rest], __rt) as any; } + text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("text", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Bpchar<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bpchar]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Bpchar<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bpchar]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Bpchar<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bpchar]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Bpchar<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Bpchar]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['!~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['!~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['!~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['!~~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~<=~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~<=~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~<=~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~<=~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~<~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~<~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~<~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~<~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~>=~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~>=~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~>=~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~>=~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~>~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~>~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~>~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bpchar, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~>~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/bytea.ts b/src/types/postgres/generated/bytea.ts index a712018..ae8b580 100644 --- a/src/types/postgres/generated/bytea.ts +++ b/src/types/postgres/generated/bytea.ts @@ -18,97 +18,97 @@ export class Bytea extends Anynonarray { static __typnameText = "bytea"; declare deserialize: (raw: string) => string; @expose.unchecked() - bitCount(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("bit_count", [this, ...__rest], __rt) as any; } + bitCount(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("bit_count", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("bit_length", [this, ...__rest], __rt) as any; } + bitLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("bit_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - btrim | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("btrim", [this, ...__rest], __rt) as any; } + btrim | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("btrim", [this, ...__rest], __rt) as any; } @expose.unchecked() - byteacat | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("byteacat", [this, ...__rest], __rt) as any; } + byteacat | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("byteacat", [this, ...__rest], __rt) as any; } @expose.unchecked() - bytealike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("bytealike", [this, ...__rest], __rt) as any; } + bytealike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("bytealike", [this, ...__rest], __rt) as any; } @expose.unchecked() - byteanlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("byteanlike", [this, ...__rest], __rt) as any; } + byteanlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("byteanlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - byteasend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("byteasend", [this, ...__rest], __rt) as any; } + byteasend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("byteasend", [this, ...__rest], __rt) as any; } @expose.unchecked() - encode | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("encode", [this, ...__rest], __rt) as any; } + encode | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("encode", [this, ...__rest], __rt) as any; } @expose.unchecked() - getBit | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("get_bit", [this, ...__rest], __rt) as any; } + getBit | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("get_bit", [this, ...__rest], __rt) as any; } @expose.unchecked() - getByte | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("get_byte", [this, ...__rest], __rt) as any; } + getByte | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("get_byte", [this, ...__rest], __rt) as any; } @expose.unchecked() - length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("length", [this, ...__rest], __rt) as any; } + length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("length", [this, ...__rest], __rt) as any; } @expose.unchecked() - like | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("like", [this, ...__rest], __rt) as any; } + like | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("like", [this, ...__rest], __rt) as any; } @expose.unchecked() - likeEscape | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("like_escape", [this, ...__rest], __rt) as any; } + likeEscape | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("like_escape", [this, ...__rest], __rt) as any; } @expose.unchecked() - ltrim | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("ltrim", [this, ...__rest], __rt) as any; } + ltrim | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("ltrim", [this, ...__rest], __rt) as any; } @expose.unchecked() - md5(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("md5", [this, ...__rest], __rt) as any; } + md5(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("md5", [this, ...__rest], __rt) as any; } @expose.unchecked() - notlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("notlike", [this, ...__rest], __rt) as any; } + notlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("notlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - octetLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("octet_length", [this, ...__rest], __rt) as any; } + octetLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("octet_length", [this, ...__rest], __rt) as any; } overlay | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Bytea | runtime.NullOf | runtime.NullOf>>; overlay | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bytea | runtime.NullOf>>; @expose.unchecked() - overlay(arg0: unknown, arg1: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Bytea, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea], [[{ type: types.Bytea, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("overlay", [this, ...__rest], __rt) as any; } + overlay(arg0: unknown, arg1: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Bytea, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea], [[{ type: types.Bytea, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("overlay", [this, ...__rest], __rt) as any; } @expose.unchecked() - position | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("position", [this, ...__rest], __rt) as any; } + position | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("position", [this, ...__rest], __rt) as any; } @expose.unchecked() - rtrim | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("rtrim", [this, ...__rest], __rt) as any; } + rtrim | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("rtrim", [this, ...__rest], __rt) as any; } @expose.unchecked() - setBit | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bytea | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int8, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("set_bit", [this, ...__rest], __rt) as any; } + setBit | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bytea | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int8, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("set_bit", [this, ...__rest], __rt) as any; } @expose.unchecked() - setByte | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bytea | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("set_byte", [this, ...__rest], __rt) as any; } + setByte | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bytea | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("set_byte", [this, ...__rest], __rt) as any; } @expose.unchecked() - sha224(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("sha224", [this, ...__rest], __rt) as any; } + sha224(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("sha224", [this, ...__rest], __rt) as any; } @expose.unchecked() - sha256(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("sha256", [this, ...__rest], __rt) as any; } + sha256(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("sha256", [this, ...__rest], __rt) as any; } @expose.unchecked() - sha384(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("sha384", [this, ...__rest], __rt) as any; } + sha384(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("sha384", [this, ...__rest], __rt) as any; } @expose.unchecked() - sha512(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("sha512", [this, ...__rest], __rt) as any; } + sha512(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("sha512", [this, ...__rest], __rt) as any; } substr | number>(arg0: M0): types.Bytea>>; substr | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bytea | runtime.NullOf>>; @expose.unchecked() - substr(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Bytea], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("substr", [this, ...__rest], __rt) as any; } + substr(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Bytea], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("substr", [this, ...__rest], __rt) as any; } substring | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Bytea | runtime.NullOf>>; substring | number>(arg0: M0): types.Bytea>>; @expose.unchecked() - substring(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea], [[{ type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("substring", [this, ...__rest], __rt) as any; } + substring(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Bytea], [[{ type: types.Int4, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("substring", [this, ...__rest], __rt) as any; } @expose.unchecked() - stringAgg | string>(arg0: M0): types.Bytea<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("string_agg", [this, ...__rest], __rt) as any; } + stringAgg | string>(arg0: M0): types.Bytea<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("string_agg", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['!~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['||'] | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.PgOp(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['||'] | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bytea]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Bytea, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/char.ts b/src/types/postgres/generated/char.ts index f88da79..4a9b267 100644 --- a/src/types/postgres/generated/char.ts +++ b/src/types/postgres/generated/char.ts @@ -18,35 +18,35 @@ export class Char extends Anynonarray { static __typnameText = "char"; declare deserialize: (raw: string) => string; @expose.unchecked() - bpchar(): types.Bpchar { const [__rt, ...__rest] = runtime.match([], [[[], types.Bpchar]]); return runtime.PgFunc("bpchar", [this, ...__rest], __rt) as any; } + bpchar(): types.Bpchar { const [__rt, ...__rest] = runtime.match([], [[[], types.Bpchar]]); return runtime.funcCall("bpchar", [this, ...__rest], __rt) as any; } @expose.unchecked() - charsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("charsend", [this, ...__rest], __rt) as any; } + charsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("charsend", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("text", [this, ...__rest], __rt) as any; } + text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("text", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/cid.ts b/src/types/postgres/generated/cid.ts index 3f093ba..d5cb86d 100644 --- a/src/types/postgres/generated/cid.ts +++ b/src/types/postgres/generated/cid.ts @@ -18,9 +18,9 @@ export class Cid extends Anynonarray { static __typnameText = "cid"; declare deserialize: (raw: string) => string; @expose.unchecked() - cidsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("cidsend", [this, ...__rest], __rt) as any; } + cidsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("cidsend", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Cid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Cid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Cid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Cid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/cidr.ts b/src/types/postgres/generated/cidr.ts index 9bf3bd4..96d5198 100644 --- a/src/types/postgres/generated/cidr.ts +++ b/src/types/postgres/generated/cidr.ts @@ -18,9 +18,9 @@ export class Cidr extends Anynonarray { static __typnameText = "cidr"; declare deserialize: (raw: string) => string; @expose.unchecked() - abbrev(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("abbrev", [this, ...__rest], __rt) as any; } + abbrev(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("abbrev", [this, ...__rest], __rt) as any; } @expose.unchecked() - cidrSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("cidr_send", [this, ...__rest], __rt) as any; } + cidrSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("cidr_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - setMasklen | number>(arg0: M0): types.Cidr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Cidr]]); return runtime.PgFunc("set_masklen", [this, ...__rest], __rt) as any; } + setMasklen | number>(arg0: M0): types.Cidr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Cidr]]); return runtime.funcCall("set_masklen", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/circle.ts b/src/types/postgres/generated/circle.ts index 48f561e..02a9178 100644 --- a/src/types/postgres/generated/circle.ts +++ b/src/types/postgres/generated/circle.ts @@ -18,93 +18,93 @@ export class Circle extends Anynonarray { static __typnameText = "circle"; declare deserialize: (raw: string) => string; @expose.unchecked() - area(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("area", [this, ...__rest], __rt) as any; } + area(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("area", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleAbove | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_above", [this, ...__rest], __rt) as any; } + circleAbove | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_above", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleBelow | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_below", [this, ...__rest], __rt) as any; } + circleBelow | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_below", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleContain | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_contain", [this, ...__rest], __rt) as any; } + circleContain | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_contain", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleContained | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_contained", [this, ...__rest], __rt) as any; } + circleContained | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_contained", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleDistance | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("circle_distance", [this, ...__rest], __rt) as any; } + circleDistance | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("circle_distance", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleLeft | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_left", [this, ...__rest], __rt) as any; } + circleLeft | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_left", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleOverabove | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_overabove", [this, ...__rest], __rt) as any; } + circleOverabove | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_overabove", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleOverbelow | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_overbelow", [this, ...__rest], __rt) as any; } + circleOverbelow | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_overbelow", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleOverlap | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_overlap", [this, ...__rest], __rt) as any; } + circleOverlap | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_overlap", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleOverleft | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_overleft", [this, ...__rest], __rt) as any; } + circleOverleft | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_overleft", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleOverright | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_overright", [this, ...__rest], __rt) as any; } + circleOverright | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_overright", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleRight | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_right", [this, ...__rest], __rt) as any; } + circleRight | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_right", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleSame | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("circle_same", [this, ...__rest], __rt) as any; } + circleSame | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("circle_same", [this, ...__rest], __rt) as any; } @expose.unchecked() - circleSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("circle_send", [this, ...__rest], __rt) as any; } + circleSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("circle_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - diameter(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("diameter", [this, ...__rest], __rt) as any; } + diameter(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("diameter", [this, ...__rest], __rt) as any; } @expose.unchecked() - distCpoly | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("dist_cpoly", [this, ...__rest], __rt) as any; } + distCpoly | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("dist_cpoly", [this, ...__rest], __rt) as any; } @expose.unchecked() - polygon(): types.Polygon { const [__rt, ...__rest] = runtime.match([], [[[], types.Polygon]]); return runtime.PgFunc("polygon", [this, ...__rest], __rt) as any; } + polygon(): types.Polygon { const [__rt, ...__rest] = runtime.match([], [[[], types.Polygon]]); return runtime.funcCall("polygon", [this, ...__rest], __rt) as any; } @expose.unchecked() - radius(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("radius", [this, ...__rest], __rt) as any; } + radius(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("radius", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['&&'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&&'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&<|'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&<|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&<|'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&<|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<->']>(arg0: M0): types.Float8>>; ['<->'] | string>(arg0: M0): types.Float8>>; @expose.unchecked() - ['<->'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon }], types.Float8], [[{ type: types.Circle, allowPrimitive: true }], types.Float8]]); return runtime.PgOp(runtime.sql`<->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<->'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon }], types.Float8], [[{ type: types.Circle, allowPrimitive: true }], types.Float8]]); return runtime.opCall(runtime.sql`<->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<|'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<<|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<|'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<<|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|&>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`|&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|&>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`|&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`|>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`|>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/date.ts b/src/types/postgres/generated/date.ts index f1a4900..0774779 100644 --- a/src/types/postgres/generated/date.ts +++ b/src/types/postgres/generated/date.ts @@ -18,105 +18,105 @@ export class Date extends Anynonarray { static __typnameText = "date"; declare deserialize: (raw: string) => string; @expose.unchecked() - dateLarger | string>(arg0: M0): types.Date>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Date]]); return runtime.PgFunc("date_larger", [this, ...__rest], __rt) as any; } + dateLarger | string>(arg0: M0): types.Date>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Date]]); return runtime.funcCall("date_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - dateSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("date_send", [this, ...__rest], __rt) as any; } + dateSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("date_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - dateSmaller | string>(arg0: M0): types.Date>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Date]]); return runtime.PgFunc("date_smaller", [this, ...__rest], __rt) as any; } + dateSmaller | string>(arg0: M0): types.Date>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Date]]); return runtime.funcCall("date_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - daterangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("daterange_subdiff", [this, ...__rest], __rt) as any; } + daterangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("daterange_subdiff", [this, ...__rest], __rt) as any; } @expose.unchecked() - isfinite(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("isfinite", [this, ...__rest], __rt) as any; } + isfinite(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("isfinite", [this, ...__rest], __rt) as any; } timestamp(): types.Timestamp; timestamp | string>(arg0: M0): types.Timestamp>>; @expose.unchecked() - timestamp(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[], types.Timestamp], [[{ type: types.Time, allowPrimitive: true }], types.Timestamp]]); return runtime.PgFunc("timestamp", [this, ...__rest], __rt) as any; } + timestamp(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[], types.Timestamp], [[{ type: types.Time, allowPrimitive: true }], types.Timestamp]]); return runtime.funcCall("timestamp", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestamptz | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Timestamptz]]); return runtime.PgFunc("timestamptz", [this, ...__rest], __rt) as any; } + timestamptz | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Timestamptz]]); return runtime.funcCall("timestamptz", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Date<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Date]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Date<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Date]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Date<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Date]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Date<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Date]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } ['+'] | number>(arg0: M0): types.Date>>; ['+']>(arg0: M0): types.Timestamptz>>; ['+']>(arg0: M0): types.Timestamp>>; ['+']>(arg0: M0): types.Timestamp>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Date], [[{ type: types.Timetz }], types.Timestamptz], [[{ type: types.Time }], types.Timestamp], [[{ type: types.Interval }], types.Timestamp]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Date], [[{ type: types.Timetz }], types.Timestamptz], [[{ type: types.Time }], types.Timestamp], [[{ type: types.Interval }], types.Timestamp]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus | number>(arg0: M0): types.Date>>; plus>(arg0: M0): types.Timestamptz>>; plus>(arg0: M0): types.Timestamp>>; plus>(arg0: M0): types.Timestamp>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Date], [[{ type: types.Timetz }], types.Timestamptz], [[{ type: types.Time }], types.Timestamp], [[{ type: types.Interval }], types.Timestamp]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Date], [[{ type: types.Timetz }], types.Timestamptz], [[{ type: types.Time }], types.Timestamp], [[{ type: types.Interval }], types.Timestamp]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-']>(arg0: M0): types.Timestamp>>; ['-'] | string>(arg0: M0): types.Int4>>; ['-'] | number>(arg0: M0): types.Date>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamp], [[{ type: types.Date, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Date]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamp], [[{ type: types.Date, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Date]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus>(arg0: M0): types.Timestamp>>; minus | string>(arg0: M0): types.Int4>>; minus | number>(arg0: M0): types.Date>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamp], [[{ type: types.Date, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Date]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamp], [[{ type: types.Date, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Date]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<'] | string>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lt | string>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; @expose.unchecked() - lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<=']>(arg0: M0): types.Bool>>; ['<=']>(arg0: M0): types.Bool>>; ['<='] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lte>(arg0: M0): types.Bool>>; lte>(arg0: M0): types.Bool>>; lte | string>(arg0: M0): types.Bool>>; @expose.unchecked() - lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<>'] | string>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | string>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['='] | string>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq | string>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>']>(arg0: M0): types.Bool>>; ['>'] | string>(arg0: M0): types.Bool>>; ['>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gt>(arg0: M0): types.Bool>>; gt | string>(arg0: M0): types.Bool>>; gt>(arg0: M0): types.Bool>>; @expose.unchecked() - gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>='] | string>(arg0: M0): types.Bool>>; ['>=']>(arg0: M0): types.Bool>>; ['>=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gte | string>(arg0: M0): types.Bool>>; gte>(arg0: M0): types.Bool>>; gte>(arg0: M0): types.Bool>>; @expose.unchecked() - gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/float4.ts b/src/types/postgres/generated/float4.ts index 4bf7bad..31fcafd 100644 --- a/src/types/postgres/generated/float4.ts +++ b/src/types/postgres/generated/float4.ts @@ -18,125 +18,125 @@ export class Float4 extends Anynonarray { static __typnameText = "float4"; declare deserialize: (raw: string) => number; @expose.unchecked() - abs(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("abs", [this, ...__rest], __rt) as any; } + abs(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4Abs(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("float4abs", [this, ...__rest], __rt) as any; } + float4Abs(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("float4abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4Larger | number>(arg0: M0): types.Float4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgFunc("float4larger", [this, ...__rest], __rt) as any; } + float4Larger | number>(arg0: M0): types.Float4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.funcCall("float4larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("float4send", [this, ...__rest], __rt) as any; } + float4Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("float4send", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4Smaller | number>(arg0: M0): types.Float4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgFunc("float4smaller", [this, ...__rest], __rt) as any; } + float4Smaller | number>(arg0: M0): types.Float4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.funcCall("float4smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("float8", [this, ...__rest], __rt) as any; } + float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("float8", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("int2", [this, ...__rest], __rt) as any; } + int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("int2", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8", [this, ...__rest], __rt) as any; } + int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() - numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric", [this, ...__rest], __rt) as any; } + numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric", [this, ...__rest], __rt) as any; } @expose.unchecked() - avg(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("avg", [this, ...__rest], __rt) as any; } + avg(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("avg", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Float4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Float4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Float4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Float4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddev(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("stddev", [this, ...__rest], __rt) as any; } + stddev(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("stddev", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevPop(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("stddev_pop", [this, ...__rest], __rt) as any; } + stddevPop(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("stddev_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevSamp(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("stddev_samp", [this, ...__rest], __rt) as any; } + stddevSamp(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("stddev_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - sum(): types.Float4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("sum", [this, ...__rest], __rt) as any; } + sum(): types.Float4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - varPop(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("var_pop", [this, ...__rest], __rt) as any; } + varPop(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("var_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - varSamp(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("var_samp", [this, ...__rest], __rt) as any; } + varSamp(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("var_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - variance(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("variance", [this, ...__rest], __rt) as any; } + variance(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("variance", [this, ...__rest], __rt) as any; } ['*'] | string>(arg0: M0): types.Money>>; ['*']>(arg0: M0): types.Float8>>; ['*'] | number>(arg0: M0): types.Float4>>; @expose.unchecked() - ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money], [[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money], [[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } times | string>(arg0: M0): types.Money>>; times>(arg0: M0): types.Float8>>; times | number>(arg0: M0): types.Float4>>; @expose.unchecked() - times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money], [[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money], [[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['+']>(arg0: M0): types.Float8>>; ['+'] | number>(arg0: M0): types.Float4>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus>(arg0: M0): types.Float8>>; plus | number>(arg0: M0): types.Float4>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-']>(arg0: M0): types.Float8>>; ['-'] | number>(arg0: M0): types.Float4>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus>(arg0: M0): types.Float8>>; minus | number>(arg0: M0): types.Float4>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['/']>(arg0: M0): types.Float8>>; ['/'] | number>(arg0: M0): types.Float4>>; @expose.unchecked() - ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } divide>(arg0: M0): types.Float8>>; divide | number>(arg0: M0): types.Float4>>; @expose.unchecked() - divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Float8], [[{ type: types.Float4, allowPrimitive: true }], types.Float4]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<']>(arg0: M0): types.Bool>>; ['<'] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lt>(arg0: M0): types.Bool>>; lt | number>(arg0: M0): types.Bool>>; @expose.unchecked() - lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<='] | number>(arg0: M0): types.Bool>>; ['<=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lte | number>(arg0: M0): types.Bool>>; lte>(arg0: M0): types.Bool>>; @expose.unchecked() - lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<>'] | number>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | number>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['='] | number>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq | number>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4, allowPrimitive: true }], types.Bool], [[{ type: types.Float8 }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>']>(arg0: M0): types.Bool>>; ['>'] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gt>(arg0: M0): types.Bool>>; gt | number>(arg0: M0): types.Bool>>; @expose.unchecked() - gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>=']>(arg0: M0): types.Bool>>; ['>='] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gte>(arg0: M0): types.Bool>>; gte | number>(arg0: M0): types.Bool>>; @expose.unchecked() - gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8 }], types.Bool], [[{ type: types.Float4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/float8.ts b/src/types/postgres/generated/float8.ts index 48c9dbc..2465744 100644 --- a/src/types/postgres/generated/float8.ts +++ b/src/types/postgres/generated/float8.ts @@ -18,257 +18,257 @@ export class Float8 extends Anynonarray { static __typnameText = "float8"; declare deserialize: (raw: string) => number; @expose.unchecked() - abs(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("abs", [this, ...__rest], __rt) as any; } + abs(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - acos(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("acos", [this, ...__rest], __rt) as any; } + acos(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("acos", [this, ...__rest], __rt) as any; } @expose.unchecked() - acosd(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("acosd", [this, ...__rest], __rt) as any; } + acosd(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("acosd", [this, ...__rest], __rt) as any; } @expose.unchecked() - acosh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("acosh", [this, ...__rest], __rt) as any; } + acosh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("acosh", [this, ...__rest], __rt) as any; } @expose.unchecked() - asin(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("asin", [this, ...__rest], __rt) as any; } + asin(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("asin", [this, ...__rest], __rt) as any; } @expose.unchecked() - asind(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("asind", [this, ...__rest], __rt) as any; } + asind(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("asind", [this, ...__rest], __rt) as any; } @expose.unchecked() - asinh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("asinh", [this, ...__rest], __rt) as any; } + asinh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("asinh", [this, ...__rest], __rt) as any; } @expose.unchecked() - atan(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("atan", [this, ...__rest], __rt) as any; } + atan(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("atan", [this, ...__rest], __rt) as any; } @expose.unchecked() - atan2 | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("atan2", [this, ...__rest], __rt) as any; } + atan2 | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("atan2", [this, ...__rest], __rt) as any; } @expose.unchecked() - atan2D | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("atan2d", [this, ...__rest], __rt) as any; } + atan2D | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("atan2d", [this, ...__rest], __rt) as any; } @expose.unchecked() - atand(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("atand", [this, ...__rest], __rt) as any; } + atand(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("atand", [this, ...__rest], __rt) as any; } @expose.unchecked() - atanh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("atanh", [this, ...__rest], __rt) as any; } + atanh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("atanh", [this, ...__rest], __rt) as any; } @expose.unchecked() - cbrt(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("cbrt", [this, ...__rest], __rt) as any; } + cbrt(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("cbrt", [this, ...__rest], __rt) as any; } @expose.unchecked() - ceil(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("ceil", [this, ...__rest], __rt) as any; } + ceil(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("ceil", [this, ...__rest], __rt) as any; } @expose.unchecked() - ceiling(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("ceiling", [this, ...__rest], __rt) as any; } + ceiling(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("ceiling", [this, ...__rest], __rt) as any; } @expose.unchecked() - cos(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("cos", [this, ...__rest], __rt) as any; } + cos(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("cos", [this, ...__rest], __rt) as any; } @expose.unchecked() - cosd(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("cosd", [this, ...__rest], __rt) as any; } + cosd(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("cosd", [this, ...__rest], __rt) as any; } @expose.unchecked() - cosh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("cosh", [this, ...__rest], __rt) as any; } + cosh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("cosh", [this, ...__rest], __rt) as any; } @expose.unchecked() - cot(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("cot", [this, ...__rest], __rt) as any; } + cot(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("cot", [this, ...__rest], __rt) as any; } @expose.unchecked() - cotd(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("cotd", [this, ...__rest], __rt) as any; } + cotd(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("cotd", [this, ...__rest], __rt) as any; } @expose.unchecked() - dcbrt(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("dcbrt", [this, ...__rest], __rt) as any; } + dcbrt(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("dcbrt", [this, ...__rest], __rt) as any; } @expose.unchecked() - degrees(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("degrees", [this, ...__rest], __rt) as any; } + degrees(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("degrees", [this, ...__rest], __rt) as any; } @expose.unchecked() - dexp(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("dexp", [this, ...__rest], __rt) as any; } + dexp(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("dexp", [this, ...__rest], __rt) as any; } @expose.unchecked() - dlog1(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("dlog1", [this, ...__rest], __rt) as any; } + dlog1(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("dlog1", [this, ...__rest], __rt) as any; } @expose.unchecked() - dlog10(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("dlog10", [this, ...__rest], __rt) as any; } + dlog10(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("dlog10", [this, ...__rest], __rt) as any; } @expose.unchecked() - dround(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("dround", [this, ...__rest], __rt) as any; } + dround(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("dround", [this, ...__rest], __rt) as any; } @expose.unchecked() - dsqrt(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("dsqrt", [this, ...__rest], __rt) as any; } + dsqrt(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("dsqrt", [this, ...__rest], __rt) as any; } @expose.unchecked() - dtrunc(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("dtrunc", [this, ...__rest], __rt) as any; } + dtrunc(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("dtrunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - erf(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("erf", [this, ...__rest], __rt) as any; } + erf(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("erf", [this, ...__rest], __rt) as any; } @expose.unchecked() - erfc(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("erfc", [this, ...__rest], __rt) as any; } + erfc(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("erfc", [this, ...__rest], __rt) as any; } @expose.unchecked() - exp(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("exp", [this, ...__rest], __rt) as any; } + exp(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("exp", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("float4", [this, ...__rest], __rt) as any; } + float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("float4", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8Abs(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("float8abs", [this, ...__rest], __rt) as any; } + float8Abs(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("float8abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8Larger | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("float8larger", [this, ...__rest], __rt) as any; } + float8Larger | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("float8larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("float8send", [this, ...__rest], __rt) as any; } + float8Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("float8send", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8Smaller | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("float8smaller", [this, ...__rest], __rt) as any; } + float8Smaller | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("float8smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - floor(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("floor", [this, ...__rest], __rt) as any; } + floor(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("floor", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("int2", [this, ...__rest], __rt) as any; } + int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("int2", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8", [this, ...__rest], __rt) as any; } + int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() - ln(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("ln", [this, ...__rest], __rt) as any; } + ln(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("ln", [this, ...__rest], __rt) as any; } @expose.unchecked() - log(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("log", [this, ...__rest], __rt) as any; } + log(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("log", [this, ...__rest], __rt) as any; } @expose.unchecked() - log10(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("log10", [this, ...__rest], __rt) as any; } + log10(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("log10", [this, ...__rest], __rt) as any; } @expose.unchecked() - numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric", [this, ...__rest], __rt) as any; } + numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric", [this, ...__rest], __rt) as any; } @expose.unchecked() - pow | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("pow", [this, ...__rest], __rt) as any; } + pow | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("pow", [this, ...__rest], __rt) as any; } @expose.unchecked() - power | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("power", [this, ...__rest], __rt) as any; } + power | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("power", [this, ...__rest], __rt) as any; } @expose.unchecked() - radians(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("radians", [this, ...__rest], __rt) as any; } + radians(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("radians", [this, ...__rest], __rt) as any; } @expose.unchecked() - round(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("round", [this, ...__rest], __rt) as any; } + round(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("round", [this, ...__rest], __rt) as any; } @expose.unchecked() - sign(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("sign", [this, ...__rest], __rt) as any; } + sign(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("sign", [this, ...__rest], __rt) as any; } @expose.unchecked() - sin(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("sin", [this, ...__rest], __rt) as any; } + sin(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("sin", [this, ...__rest], __rt) as any; } @expose.unchecked() - sind(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("sind", [this, ...__rest], __rt) as any; } + sind(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("sind", [this, ...__rest], __rt) as any; } @expose.unchecked() - sinh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("sinh", [this, ...__rest], __rt) as any; } + sinh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("sinh", [this, ...__rest], __rt) as any; } @expose.unchecked() - sqrt(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("sqrt", [this, ...__rest], __rt) as any; } + sqrt(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("sqrt", [this, ...__rest], __rt) as any; } @expose.unchecked() - tan(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("tan", [this, ...__rest], __rt) as any; } + tan(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("tan", [this, ...__rest], __rt) as any; } @expose.unchecked() - tand(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("tand", [this, ...__rest], __rt) as any; } + tand(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("tand", [this, ...__rest], __rt) as any; } @expose.unchecked() - tanh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("tanh", [this, ...__rest], __rt) as any; } + tanh(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("tanh", [this, ...__rest], __rt) as any; } @expose.unchecked() - toTimestamp(): types.Timestamptz { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamptz]]); return runtime.PgFunc("to_timestamp", [this, ...__rest], __rt) as any; } + toTimestamp(): types.Timestamptz { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamptz]]); return runtime.funcCall("to_timestamp", [this, ...__rest], __rt) as any; } @expose.unchecked() - trunc(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("trunc", [this, ...__rest], __rt) as any; } + trunc(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("trunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - widthBucket | number, M1 extends types.Float8 | number, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Int4 | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Float8, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("width_bucket", [this, ...__rest], __rt) as any; } + widthBucket | number, M1 extends types.Float8 | number, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Int4 | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Float8, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("width_bucket", [this, ...__rest], __rt) as any; } @expose.unchecked() - avg(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("avg", [this, ...__rest], __rt) as any; } + avg(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("avg", [this, ...__rest], __rt) as any; } @expose.unchecked() - corr | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("corr", [this, ...__rest], __rt) as any; } + corr | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("corr", [this, ...__rest], __rt) as any; } @expose.unchecked() - covarPop | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("covar_pop", [this, ...__rest], __rt) as any; } + covarPop | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("covar_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - covarSamp | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("covar_samp", [this, ...__rest], __rt) as any; } + covarSamp | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("covar_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } percentileCont | string>(arg0: M0): types.Interval<0 | 1>; percentileCont | number>(arg0: M0): types.Float8<0 | 1>; @expose.unchecked() - percentileCont(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("percentile_cont", [this, ...__rest], __rt) as any; } + percentileCont(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("percentile_cont", [this, ...__rest], __rt) as any; } @expose.unchecked() - percentileDisc>(arg0: M0): types.Anyelement<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement, allowPrimitive: true }], types.Anyelement]]); return runtime.PgFunc("percentile_disc", [this, ...__rest], __rt) as any; } + percentileDisc>(arg0: M0): types.Anyelement<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anyelement, allowPrimitive: true }], types.Anyelement]]); return runtime.funcCall("percentile_disc", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrAvgx | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("regr_avgx", [this, ...__rest], __rt) as any; } + regrAvgx | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("regr_avgx", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrAvgy | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("regr_avgy", [this, ...__rest], __rt) as any; } + regrAvgy | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("regr_avgy", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrCount | number>(arg0: M0): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("regr_count", [this, ...__rest], __rt) as any; } + regrCount | number>(arg0: M0): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("regr_count", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrIntercept | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("regr_intercept", [this, ...__rest], __rt) as any; } + regrIntercept | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("regr_intercept", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrR2 | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("regr_r2", [this, ...__rest], __rt) as any; } + regrR2 | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("regr_r2", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrSlope | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("regr_slope", [this, ...__rest], __rt) as any; } + regrSlope | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("regr_slope", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrSxx | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("regr_sxx", [this, ...__rest], __rt) as any; } + regrSxx | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("regr_sxx", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrSxy | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("regr_sxy", [this, ...__rest], __rt) as any; } + regrSxy | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("regr_sxy", [this, ...__rest], __rt) as any; } @expose.unchecked() - regrSyy | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("regr_syy", [this, ...__rest], __rt) as any; } + regrSyy | number>(arg0: M0): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("regr_syy", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddev(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("stddev", [this, ...__rest], __rt) as any; } + stddev(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("stddev", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevPop(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("stddev_pop", [this, ...__rest], __rt) as any; } + stddevPop(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("stddev_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevSamp(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("stddev_samp", [this, ...__rest], __rt) as any; } + stddevSamp(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("stddev_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - sum(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("sum", [this, ...__rest], __rt) as any; } + sum(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - varPop(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("var_pop", [this, ...__rest], __rt) as any; } + varPop(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("var_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - varSamp(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("var_samp", [this, ...__rest], __rt) as any; } + varSamp(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("var_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - variance(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("variance", [this, ...__rest], __rt) as any; } + variance(): types.Float8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("variance", [this, ...__rest], __rt) as any; } ['*']>(arg0: M0): types.Money>>; ['*'] | number>(arg0: M0): types.Float8>>; ['*']>(arg0: M0): types.Interval>>; ['*']>(arg0: M0): types.Float8>>; @expose.unchecked() - ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money }], types.Money], [[{ type: types.Float8, allowPrimitive: true }], types.Float8], [[{ type: types.Interval }], types.Interval], [[{ type: types.Float4 }], types.Float8]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money }], types.Money], [[{ type: types.Float8, allowPrimitive: true }], types.Float8], [[{ type: types.Interval }], types.Interval], [[{ type: types.Float4 }], types.Float8]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } times>(arg0: M0): types.Money>>; times | number>(arg0: M0): types.Float8>>; times>(arg0: M0): types.Interval>>; times>(arg0: M0): types.Float8>>; @expose.unchecked() - times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money }], types.Money], [[{ type: types.Float8, allowPrimitive: true }], types.Float8], [[{ type: types.Interval }], types.Interval], [[{ type: types.Float4 }], types.Float8]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money }], types.Money], [[{ type: types.Float8, allowPrimitive: true }], types.Float8], [[{ type: types.Interval }], types.Interval], [[{ type: types.Float4 }], types.Float8]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['+']>(arg0: M0): types.Float8>>; ['+'] | number>(arg0: M0): types.Float8>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Float8], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Float8], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus>(arg0: M0): types.Float8>>; plus | number>(arg0: M0): types.Float8>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Float8], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Float8], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-'] | number>(arg0: M0): types.Float8>>; ['-']>(arg0: M0): types.Float8>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8], [[{ type: types.Float4 }], types.Float8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8], [[{ type: types.Float4 }], types.Float8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus | number>(arg0: M0): types.Float8>>; minus>(arg0: M0): types.Float8>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8], [[{ type: types.Float4 }], types.Float8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8], [[{ type: types.Float4 }], types.Float8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['/']>(arg0: M0): types.Float8>>; ['/'] | number>(arg0: M0): types.Float8>>; @expose.unchecked() - ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Float8], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Float8], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } divide>(arg0: M0): types.Float8>>; divide | number>(arg0: M0): types.Float8>>; @expose.unchecked() - divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Float8], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Float8], [[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<']>(arg0: M0): types.Bool>>; ['<'] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lt>(arg0: M0): types.Bool>>; lt | number>(arg0: M0): types.Bool>>; @expose.unchecked() - lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<=']>(arg0: M0): types.Bool>>; ['<='] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lte>(arg0: M0): types.Bool>>; lte | number>(arg0: M0): types.Bool>>; @expose.unchecked() - lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<>'] | number>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Bool], [[{ type: types.Float4 }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Bool], [[{ type: types.Float4 }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | number>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Bool], [[{ type: types.Float4 }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Bool], [[{ type: types.Float4 }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['='] | number>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Bool], [[{ type: types.Float4 }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Bool], [[{ type: types.Float4 }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq | number>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Bool], [[{ type: types.Float4 }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Bool], [[{ type: types.Float4 }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>']>(arg0: M0): types.Bool>>; ['>'] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gt>(arg0: M0): types.Bool>>; gt | number>(arg0: M0): types.Bool>>; @expose.unchecked() - gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>=']>(arg0: M0): types.Bool>>; ['>='] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gte>(arg0: M0): types.Bool>>; gte | number>(arg0: M0): types.Bool>>; @expose.unchecked() - gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Bool], [[{ type: types.Float8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['^'] | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.PgOp(runtime.sql`^`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['^'] | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Float8]]); return runtime.opCall(runtime.sql`^`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/inet.ts b/src/types/postgres/generated/inet.ts index 03ba265..cc116c2 100644 --- a/src/types/postgres/generated/inet.ts +++ b/src/types/postgres/generated/inet.ts @@ -18,99 +18,99 @@ export class Inet extends Anynonarray { static __typnameText = "inet"; declare deserialize: (raw: string) => string; @expose.unchecked() - abbrev(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("abbrev", [this, ...__rest], __rt) as any; } + abbrev(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("abbrev", [this, ...__rest], __rt) as any; } @expose.unchecked() - broadcast(): types.Inet { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.PgFunc("broadcast", [this, ...__rest], __rt) as any; } + broadcast(): types.Inet { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.funcCall("broadcast", [this, ...__rest], __rt) as any; } @expose.unchecked() - cidr(): types.Cidr { const [__rt, ...__rest] = runtime.match([], [[[], types.Cidr]]); return runtime.PgFunc("cidr", [this, ...__rest], __rt) as any; } + cidr(): types.Cidr { const [__rt, ...__rest] = runtime.match([], [[[], types.Cidr]]); return runtime.funcCall("cidr", [this, ...__rest], __rt) as any; } @expose.unchecked() - family(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("family", [this, ...__rest], __rt) as any; } + family(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("family", [this, ...__rest], __rt) as any; } @expose.unchecked() - host(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("host", [this, ...__rest], __rt) as any; } + host(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("host", [this, ...__rest], __rt) as any; } @expose.unchecked() - hostmask(): types.Inet { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.PgFunc("hostmask", [this, ...__rest], __rt) as any; } + hostmask(): types.Inet { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.funcCall("hostmask", [this, ...__rest], __rt) as any; } @expose.unchecked() - inetSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("inet_send", [this, ...__rest], __rt) as any; } + inetSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("inet_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - inetand | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.PgFunc("inetand", [this, ...__rest], __rt) as any; } + inetand | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.funcCall("inetand", [this, ...__rest], __rt) as any; } @expose.unchecked() - inetnot(): types.Inet { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.PgFunc("inetnot", [this, ...__rest], __rt) as any; } + inetnot(): types.Inet { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.funcCall("inetnot", [this, ...__rest], __rt) as any; } @expose.unchecked() - inetor | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.PgFunc("inetor", [this, ...__rest], __rt) as any; } + inetor | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.funcCall("inetor", [this, ...__rest], __rt) as any; } @expose.unchecked() - masklen(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("masklen", [this, ...__rest], __rt) as any; } + masklen(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("masklen", [this, ...__rest], __rt) as any; } @expose.unchecked() - netmask(): types.Inet { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.PgFunc("netmask", [this, ...__rest], __rt) as any; } + netmask(): types.Inet { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.funcCall("netmask", [this, ...__rest], __rt) as any; } @expose.unchecked() - network(): types.Cidr { const [__rt, ...__rest] = runtime.match([], [[[], types.Cidr]]); return runtime.PgFunc("network", [this, ...__rest], __rt) as any; } + network(): types.Cidr { const [__rt, ...__rest] = runtime.match([], [[[], types.Cidr]]); return runtime.funcCall("network", [this, ...__rest], __rt) as any; } @expose.unchecked() - networkLarger | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.PgFunc("network_larger", [this, ...__rest], __rt) as any; } + networkLarger | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.funcCall("network_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - networkOverlap | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("network_overlap", [this, ...__rest], __rt) as any; } + networkOverlap | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("network_overlap", [this, ...__rest], __rt) as any; } @expose.unchecked() - networkSmaller | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.PgFunc("network_smaller", [this, ...__rest], __rt) as any; } + networkSmaller | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.funcCall("network_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - networkSub | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("network_sub", [this, ...__rest], __rt) as any; } + networkSub | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("network_sub", [this, ...__rest], __rt) as any; } @expose.unchecked() - networkSubeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("network_subeq", [this, ...__rest], __rt) as any; } + networkSubeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("network_subeq", [this, ...__rest], __rt) as any; } @expose.unchecked() - networkSup | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("network_sup", [this, ...__rest], __rt) as any; } + networkSup | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("network_sup", [this, ...__rest], __rt) as any; } @expose.unchecked() - setMasklen | number>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Inet]]); return runtime.PgFunc("set_masklen", [this, ...__rest], __rt) as any; } + setMasklen | number>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Inet]]); return runtime.funcCall("set_masklen", [this, ...__rest], __rt) as any; } @expose.unchecked() - text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("text", [this, ...__rest], __rt) as any; } + text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("text", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Inet<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Inet<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Inet<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Inet<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Inet]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['&'] | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.PgOp(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&'] | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.opCall(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&&'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&&'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['+'] | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Inet]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'] | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Inet]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - plus | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Inet]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Inet]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-']>(arg0: M0): types.Inet>>; ['-'] | string>(arg0: M0): types.Int8>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Inet], [[{ type: types.Inet, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Inet], [[{ type: types.Inet, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus>(arg0: M0): types.Inet>>; minus | string>(arg0: M0): types.Int8>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Inet], [[{ type: types.Inet, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Inet], [[{ type: types.Inet, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|'] | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.PgOp(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|'] | string>(arg0: M0): types.Inet>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet, allowPrimitive: true }], types.Inet]]); return runtime.opCall(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/int2.ts b/src/types/postgres/generated/int2.ts index 0354c1c..bcec918 100644 --- a/src/types/postgres/generated/int2.ts +++ b/src/types/postgres/generated/int2.ts @@ -18,177 +18,177 @@ export class Int2 extends Anynonarray { static __typnameText = "int2"; declare deserialize: (raw: string) => number; @expose.unchecked() - abs(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("abs", [this, ...__rest], __rt) as any; } + abs(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("float4", [this, ...__rest], __rt) as any; } + float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("float4", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("float8", [this, ...__rest], __rt) as any; } + float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("float8", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Abs(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("int2abs", [this, ...__rest], __rt) as any; } + int2Abs(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("int2abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2And | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgFunc("int2and", [this, ...__rest], __rt) as any; } + int2And | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.funcCall("int2and", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Larger | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgFunc("int2larger", [this, ...__rest], __rt) as any; } + int2Larger | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.funcCall("int2larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Not(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("int2not", [this, ...__rest], __rt) as any; } + int2Not(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("int2not", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Or | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgFunc("int2or", [this, ...__rest], __rt) as any; } + int2Or | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.funcCall("int2or", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("int2send", [this, ...__rest], __rt) as any; } + int2Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("int2send", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Shl | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int2]]); return runtime.PgFunc("int2shl", [this, ...__rest], __rt) as any; } + int2Shl | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int2]]); return runtime.funcCall("int2shl", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Shr | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int2]]); return runtime.PgFunc("int2shr", [this, ...__rest], __rt) as any; } + int2Shr | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int2]]); return runtime.funcCall("int2shr", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Smaller | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgFunc("int2smaller", [this, ...__rest], __rt) as any; } + int2Smaller | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.funcCall("int2smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Xor | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgFunc("int2xor", [this, ...__rest], __rt) as any; } + int2Xor | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.funcCall("int2xor", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8", [this, ...__rest], __rt) as any; } + int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() - mod | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgFunc("mod", [this, ...__rest], __rt) as any; } + mod | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.funcCall("mod", [this, ...__rest], __rt) as any; } @expose.unchecked() - numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric", [this, ...__rest], __rt) as any; } + numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric", [this, ...__rest], __rt) as any; } @expose.unchecked() - avg(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("avg", [this, ...__rest], __rt) as any; } + avg(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("avg", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitAnd(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("bit_and", [this, ...__rest], __rt) as any; } + bitAnd(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("bit_and", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitOr(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("bit_or", [this, ...__rest], __rt) as any; } + bitOr(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("bit_or", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitXor(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("bit_xor", [this, ...__rest], __rt) as any; } + bitXor(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("bit_xor", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Int2<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddev(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev", [this, ...__rest], __rt) as any; } + stddev(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev_pop", [this, ...__rest], __rt) as any; } + stddevPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev_samp", [this, ...__rest], __rt) as any; } + stddevSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - sum(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("sum", [this, ...__rest], __rt) as any; } + sum(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - varPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("var_pop", [this, ...__rest], __rt) as any; } + varPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("var_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - varSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("var_samp", [this, ...__rest], __rt) as any; } + varSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("var_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - variance(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("variance", [this, ...__rest], __rt) as any; } + variance(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("variance", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['#'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgOp(runtime.sql`#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['#'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.opCall(runtime.sql`#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['%'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgOp(runtime.sql`%`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['%'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.opCall(runtime.sql`%`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgOp(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.opCall(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['*'] | number>(arg0: M0): types.Int2>>; ['*']>(arg0: M0): types.Money>>; ['*']>(arg0: M0): types.Int4>>; ['*']>(arg0: M0): types.Int8>>; @expose.unchecked() - ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Money }], types.Money], [[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8 }], types.Int8]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Money }], types.Money], [[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8 }], types.Int8]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } times | number>(arg0: M0): types.Int2>>; times>(arg0: M0): types.Money>>; times>(arg0: M0): types.Int4>>; times>(arg0: M0): types.Int8>>; @expose.unchecked() - times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Money }], types.Money], [[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8 }], types.Int8]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Money }], types.Money], [[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8 }], types.Int8]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['+'] | string>(arg0: M0): types.Int8>>; ['+'] | number>(arg0: M0): types.Int2>>; ['+']>(arg0: M0): types.Int4>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Int4 }], types.Int4]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Int4 }], types.Int4]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus | string>(arg0: M0): types.Int8>>; plus | number>(arg0: M0): types.Int2>>; plus>(arg0: M0): types.Int4>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Int4 }], types.Int4]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Int4 }], types.Int4]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-'] | number>(arg0: M0): types.Int2>>; ['-']>(arg0: M0): types.Int4>>; ['-'] | string>(arg0: M0): types.Int8>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus | number>(arg0: M0): types.Int2>>; minus>(arg0: M0): types.Int4>>; minus | string>(arg0: M0): types.Int8>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2], [[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['/']>(arg0: M0): types.Int4>>; ['/'] | string>(arg0: M0): types.Int8>>; ['/'] | number>(arg0: M0): types.Int2>>; @expose.unchecked() - ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } divide>(arg0: M0): types.Int4>>; divide | string>(arg0: M0): types.Int8>>; divide | number>(arg0: M0): types.Int2>>; @expose.unchecked() - divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<'] | string>(arg0: M0): types.Bool>>; ['<'] | number>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lt | string>(arg0: M0): types.Bool>>; lt | number>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; @expose.unchecked() - lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int2]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int2]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<=']>(arg0: M0): types.Bool>>; ['<='] | number>(arg0: M0): types.Bool>>; ['<='] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lte>(arg0: M0): types.Bool>>; lte | number>(arg0: M0): types.Bool>>; lte | string>(arg0: M0): types.Bool>>; @expose.unchecked() - lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<>'] | number>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; ['<>'] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | number>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; ne | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['='] | string>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; ['='] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq | string>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; eq | number>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>'] | number>(arg0: M0): types.Bool>>; ['>'] | string>(arg0: M0): types.Bool>>; ['>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gt | number>(arg0: M0): types.Bool>>; gt | string>(arg0: M0): types.Bool>>; gt>(arg0: M0): types.Bool>>; @expose.unchecked() - gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>='] | string>(arg0: M0): types.Bool>>; ['>=']>(arg0: M0): types.Bool>>; ['>='] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gte | string>(arg0: M0): types.Bool>>; gte>(arg0: M0): types.Bool>>; gte | number>(arg0: M0): types.Bool>>; @expose.unchecked() - gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>>'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int2]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int2]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.PgOp(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|'] | number>(arg0: M0): types.Int2>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int2]]); return runtime.opCall(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/int4.ts b/src/types/postgres/generated/int4.ts index 9a014e1..164b2ee 100644 --- a/src/types/postgres/generated/int4.ts +++ b/src/types/postgres/generated/int4.ts @@ -18,217 +18,217 @@ export class Int4 extends Anynonarray { static __typnameText = "int4"; declare deserialize: (raw: string) => number; @expose.unchecked() - abs(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("abs", [this, ...__rest], __rt) as any; } + abs(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - bit | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("bit", [this, ...__rest], __rt) as any; } + bit | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("bit", [this, ...__rest], __rt) as any; } @expose.unchecked() - bool(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("bool", [this, ...__rest], __rt) as any; } + bool(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("bool", [this, ...__rest], __rt) as any; } @expose.unchecked() - char(): types.Char { const [__rt, ...__rest] = runtime.match([], [[[], types.Char]]); return runtime.PgFunc("char", [this, ...__rest], __rt) as any; } + char(): types.Char { const [__rt, ...__rest] = runtime.match([], [[[], types.Char]]); return runtime.funcCall("char", [this, ...__rest], __rt) as any; } @expose.unchecked() - chr(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("chr", [this, ...__rest], __rt) as any; } + chr(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("chr", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("float4", [this, ...__rest], __rt) as any; } + float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("float4", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("float8", [this, ...__rest], __rt) as any; } + float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("float8", [this, ...__rest], __rt) as any; } @expose.unchecked() - gcd | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("gcd", [this, ...__rest], __rt) as any; } + gcd | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("gcd", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("int2", [this, ...__rest], __rt) as any; } + int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("int2", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Abs(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4abs", [this, ...__rest], __rt) as any; } + int4Abs(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4And | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("int4and", [this, ...__rest], __rt) as any; } + int4And | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("int4and", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Inc(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4inc", [this, ...__rest], __rt) as any; } + int4Inc(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4inc", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Larger | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("int4larger", [this, ...__rest], __rt) as any; } + int4Larger | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("int4larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Not(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4not", [this, ...__rest], __rt) as any; } + int4Not(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4not", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Or | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("int4or", [this, ...__rest], __rt) as any; } + int4Or | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("int4or", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4RangeSubdiff | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("int4range_subdiff", [this, ...__rest], __rt) as any; } + int4RangeSubdiff | number>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("int4range_subdiff", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("int4send", [this, ...__rest], __rt) as any; } + int4Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("int4send", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Shl | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("int4shl", [this, ...__rest], __rt) as any; } + int4Shl | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("int4shl", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Shr | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("int4shr", [this, ...__rest], __rt) as any; } + int4Shr | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("int4shr", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Smaller | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("int4smaller", [this, ...__rest], __rt) as any; } + int4Smaller | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("int4smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Xor | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("int4xor", [this, ...__rest], __rt) as any; } + int4Xor | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("int4xor", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8", [this, ...__rest], __rt) as any; } + int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() - lcm | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("lcm", [this, ...__rest], __rt) as any; } + lcm | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("lcm", [this, ...__rest], __rt) as any; } @expose.unchecked() - makeDate | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Date | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Date]]); return runtime.PgFunc("make_date", [this, ...__rest], __rt) as any; } + makeDate | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Date | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Date]]); return runtime.funcCall("make_date", [this, ...__rest], __rt) as any; } @expose.unchecked() - makeInterval | number, M1 extends types.Int4 | number, M2 extends types.Int4 | number, M3 extends types.Int4 | number, M4 extends types.Int4 | number, M5 extends types.Float8 | number>(arg0: M0, arg1: M1, arg2: M2, arg3: M3, arg4: M4, arg5: M5): types.Interval | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4, arg5], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.PgFunc("make_interval", [this, ...__rest], __rt) as any; } + makeInterval | number, M1 extends types.Int4 | number, M2 extends types.Int4 | number, M3 extends types.Int4 | number, M4 extends types.Int4 | number, M5 extends types.Float8 | number>(arg0: M0, arg1: M1, arg2: M2, arg3: M3, arg4: M4, arg5: M5): types.Interval | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4, arg5], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.funcCall("make_interval", [this, ...__rest], __rt) as any; } @expose.unchecked() - makeTime | number, M1 extends types.Float8 | number>(arg0: M0, arg1: M1): types.Time | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }], types.Time]]); return runtime.PgFunc("make_time", [this, ...__rest], __rt) as any; } + makeTime | number, M1 extends types.Float8 | number>(arg0: M0, arg1: M1): types.Time | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }], types.Time]]); return runtime.funcCall("make_time", [this, ...__rest], __rt) as any; } @expose.unchecked() - makeTimestamp | number, M1 extends types.Int4 | number, M2 extends types.Int4 | number, M3 extends types.Int4 | number, M4 extends types.Float8 | number>(arg0: M0, arg1: M1, arg2: M2, arg3: M3, arg4: M4): types.Timestamp | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }], types.Timestamp]]); return runtime.PgFunc("make_timestamp", [this, ...__rest], __rt) as any; } + makeTimestamp | number, M1 extends types.Int4 | number, M2 extends types.Int4 | number, M3 extends types.Int4 | number, M4 extends types.Float8 | number>(arg0: M0, arg1: M1, arg2: M2, arg3: M3, arg4: M4): types.Timestamp | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }], types.Timestamp]]); return runtime.funcCall("make_timestamp", [this, ...__rest], __rt) as any; } @expose.unchecked() - mod | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("mod", [this, ...__rest], __rt) as any; } + mod | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("mod", [this, ...__rest], __rt) as any; } @expose.unchecked() - numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric", [this, ...__rest], __rt) as any; } + numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgEncodingMaxLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("pg_encoding_max_length", [this, ...__rest], __rt) as any; } + pgEncodingMaxLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("pg_encoding_max_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - polygon | string>(arg0: M0): types.Polygon>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Polygon]]); return runtime.PgFunc("polygon", [this, ...__rest], __rt) as any; } + polygon | string>(arg0: M0): types.Polygon>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Polygon]]); return runtime.funcCall("polygon", [this, ...__rest], __rt) as any; } @expose.unchecked() - toBin(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("to_bin", [this, ...__rest], __rt) as any; } + toBin(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("to_bin", [this, ...__rest], __rt) as any; } @expose.unchecked() - toHex(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("to_hex", [this, ...__rest], __rt) as any; } + toHex(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("to_hex", [this, ...__rest], __rt) as any; } @expose.unchecked() - toOct(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("to_oct", [this, ...__rest], __rt) as any; } + toOct(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("to_oct", [this, ...__rest], __rt) as any; } @expose.unchecked() - avg(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("avg", [this, ...__rest], __rt) as any; } + avg(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("avg", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitAnd(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("bit_and", [this, ...__rest], __rt) as any; } + bitAnd(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("bit_and", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitOr(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("bit_or", [this, ...__rest], __rt) as any; } + bitOr(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("bit_or", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitXor(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("bit_xor", [this, ...__rest], __rt) as any; } + bitXor(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("bit_xor", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Int4<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddev(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev", [this, ...__rest], __rt) as any; } + stddev(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev_pop", [this, ...__rest], __rt) as any; } + stddevPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev_samp", [this, ...__rest], __rt) as any; } + stddevSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - sum(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("sum", [this, ...__rest], __rt) as any; } + sum(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - varPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("var_pop", [this, ...__rest], __rt) as any; } + varPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("var_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - varSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("var_samp", [this, ...__rest], __rt) as any; } + varSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("var_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - variance(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("variance", [this, ...__rest], __rt) as any; } - generateSeries | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): runtime.PgSrf<{ generate_series: types.Int4 | runtime.NullOf>> }, "generate_series">; - generateSeries | number>(arg0: M0): runtime.PgSrf<{ generate_series: types.Int4>> }, "generate_series">; + variance(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("variance", [this, ...__rest], __rt) as any; } + generateSeries | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): runtime.Srf<{ generate_series: types.Int4 | runtime.NullOf>> }, "generate_series">; + generateSeries | number>(arg0: M0): runtime.Srf<{ generate_series: types.Int4>> }, "generate_series">; @expose.unchecked() - generateSeries(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return new runtime.PgSrf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } + generateSeries(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return new runtime.Srf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } @expose.unchecked() - ['#'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgOp(runtime.sql`#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['#'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.opCall(runtime.sql`#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['%'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgOp(runtime.sql`%`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['%'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.opCall(runtime.sql`%`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgOp(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.opCall(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['*']>(arg0: M0): types.Int8>>; ['*']>(arg0: M0): types.Int4>>; ['*']>(arg0: M0): types.Money>>; ['*'] | number>(arg0: M0): types.Int4>>; @expose.unchecked() - ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Int8], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Money }], types.Money], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Int8], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Money }], types.Money], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } times>(arg0: M0): types.Int8>>; times>(arg0: M0): types.Int4>>; times>(arg0: M0): types.Money>>; times | number>(arg0: M0): types.Int4>>; @expose.unchecked() - times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Int8], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Money }], types.Money], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Int8], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Money }], types.Money], [[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['+']>(arg0: M0): types.Date>>; ['+'] | number>(arg0: M0): types.Int4>>; ['+']>(arg0: M0): types.Int4>>; ['+']>(arg0: M0): types.Int8>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Date], [[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Int8 }], types.Int8]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Date], [[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Int8 }], types.Int8]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus>(arg0: M0): types.Date>>; plus | number>(arg0: M0): types.Int4>>; plus>(arg0: M0): types.Int4>>; plus>(arg0: M0): types.Int8>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Date], [[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Int8 }], types.Int8]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Date], [[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Int8 }], types.Int8]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-'] | number>(arg0: M0): types.Int4>>; ['-']>(arg0: M0): types.Int4>>; ['-'] | string>(arg0: M0): types.Int8>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus | number>(arg0: M0): types.Int4>>; minus>(arg0: M0): types.Int4>>; minus | string>(arg0: M0): types.Int8>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int2 }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['/']>(arg0: M0): types.Int4>>; ['/'] | number>(arg0: M0): types.Int4>>; ['/'] | string>(arg0: M0): types.Int8>>; @expose.unchecked() - ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } divide>(arg0: M0): types.Int4>>; divide | number>(arg0: M0): types.Int4>>; divide | string>(arg0: M0): types.Int8>>; @expose.unchecked() - divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Int4], [[{ type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<'] | string>(arg0: M0): types.Bool>>; ['<'] | number>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lt | string>(arg0: M0): types.Bool>>; lt | number>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; @expose.unchecked() - lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<='] | string>(arg0: M0): types.Bool>>; ['<=']>(arg0: M0): types.Bool>>; ['<='] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lte | string>(arg0: M0): types.Bool>>; lte>(arg0: M0): types.Bool>>; lte | number>(arg0: M0): types.Bool>>; @expose.unchecked() - lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<>'] | string>(arg0: M0): types.Bool>>; ['<>'] | number>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | string>(arg0: M0): types.Bool>>; ne | number>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['=']>(arg0: M0): types.Bool>>; ['='] | number>(arg0: M0): types.Bool>>; ['='] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq>(arg0: M0): types.Bool>>; eq | number>(arg0: M0): types.Bool>>; eq | string>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>']>(arg0: M0): types.Bool>>; ['>'] | number>(arg0: M0): types.Bool>>; ['>'] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gt>(arg0: M0): types.Bool>>; gt | number>(arg0: M0): types.Bool>>; gt | string>(arg0: M0): types.Bool>>; @expose.unchecked() - gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>=']>(arg0: M0): types.Bool>>; ['>='] | string>(arg0: M0): types.Bool>>; ['>='] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gte>(arg0: M0): types.Bool>>; gte | string>(arg0: M0): types.Bool>>; gte | number>(arg0: M0): types.Bool>>; @expose.unchecked() - gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>>'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgOp(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|'] | number>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.opCall(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/int8.ts b/src/types/postgres/generated/int8.ts index 6f8e0b5..779534e 100644 --- a/src/types/postgres/generated/int8.ts +++ b/src/types/postgres/generated/int8.ts @@ -18,219 +18,219 @@ export class Int8 extends Anynonarray { static __typnameText = "int8"; declare deserialize: (raw: string) => string; @expose.unchecked() - abs(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("abs", [this, ...__rest], __rt) as any; } + abs(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - bit | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.PgFunc("bit", [this, ...__rest], __rt) as any; } + bit | number>(arg0: M0): types.Bit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Bit]]); return runtime.funcCall("bit", [this, ...__rest], __rt) as any; } @expose.unchecked() - factorial(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("factorial", [this, ...__rest], __rt) as any; } + factorial(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("factorial", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("float4", [this, ...__rest], __rt) as any; } + float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("float4", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("float8", [this, ...__rest], __rt) as any; } + float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("float8", [this, ...__rest], __rt) as any; } @expose.unchecked() - gcd | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("gcd", [this, ...__rest], __rt) as any; } + gcd | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("gcd", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("int2", [this, ...__rest], __rt) as any; } + int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("int2", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2Sum | number>(arg0: M0): types.Int8<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int2_sum", [this, ...__rest], __rt) as any; } + int2Sum | number>(arg0: M0): types.Int8<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int2_sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4Sum | number>(arg0: M0): types.Int8<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int4_sum", [this, ...__rest], __rt) as any; } + int4Sum | number>(arg0: M0): types.Int8<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int4_sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Abs(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8abs", [this, ...__rest], __rt) as any; } + int8Abs(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8And | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8and", [this, ...__rest], __rt) as any; } + int8And | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8and", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Dec(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8dec", [this, ...__rest], __rt) as any; } + int8Dec(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8dec", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8DecAny | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8dec_any", [this, ...__rest], __rt) as any; } + int8DecAny | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8dec_any", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Inc(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8inc", [this, ...__rest], __rt) as any; } + int8Inc(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8inc", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8IncAny | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8inc_any", [this, ...__rest], __rt) as any; } + int8IncAny | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Any, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8inc_any", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8IncFloat8Float8 | number, M1 extends types.Float8 | number>(arg0: M0, arg1: M1): types.Int8 | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Float8, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8inc_float8_float8", [this, ...__rest], __rt) as any; } + int8IncFloat8Float8 | number, M1 extends types.Float8 | number>(arg0: M0, arg1: M1): types.Int8 | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Float8, allowPrimitive: true }, { type: types.Float8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8inc_float8_float8", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Larger | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8larger", [this, ...__rest], __rt) as any; } + int8Larger | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Not(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8not", [this, ...__rest], __rt) as any; } + int8Not(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8not", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Or | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8or", [this, ...__rest], __rt) as any; } + int8Or | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8or", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8RangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("int8range_subdiff", [this, ...__rest], __rt) as any; } + int8RangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("int8range_subdiff", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("int8send", [this, ...__rest], __rt) as any; } + int8Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("int8send", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Shl | number>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8shl", [this, ...__rest], __rt) as any; } + int8Shl | number>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8shl", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Shr | number>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8shr", [this, ...__rest], __rt) as any; } + int8Shr | number>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8shr", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Smaller | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8smaller", [this, ...__rest], __rt) as any; } + int8Smaller | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Xor | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("int8xor", [this, ...__rest], __rt) as any; } + int8Xor | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("int8xor", [this, ...__rest], __rt) as any; } @expose.unchecked() - lcm | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("lcm", [this, ...__rest], __rt) as any; } + lcm | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("lcm", [this, ...__rest], __rt) as any; } @expose.unchecked() - mod | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgFunc("mod", [this, ...__rest], __rt) as any; } + mod | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.funcCall("mod", [this, ...__rest], __rt) as any; } @expose.unchecked() - numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric", [this, ...__rest], __rt) as any; } + numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric", [this, ...__rest], __rt) as any; } @expose.unchecked() - oid(): types.Oid { const [__rt, ...__rest] = runtime.match([], [[[], types.Oid]]); return runtime.PgFunc("oid", [this, ...__rest], __rt) as any; } + oid(): types.Oid { const [__rt, ...__rest] = runtime.match([], [[[], types.Oid]]); return runtime.funcCall("oid", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgSizePretty(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("pg_size_pretty", [this, ...__rest], __rt) as any; } + pgSizePretty(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("pg_size_pretty", [this, ...__rest], __rt) as any; } @expose.unchecked() - toBin(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("to_bin", [this, ...__rest], __rt) as any; } + toBin(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("to_bin", [this, ...__rest], __rt) as any; } @expose.unchecked() - toHex(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("to_hex", [this, ...__rest], __rt) as any; } + toHex(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("to_hex", [this, ...__rest], __rt) as any; } @expose.unchecked() - toOct(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("to_oct", [this, ...__rest], __rt) as any; } + toOct(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("to_oct", [this, ...__rest], __rt) as any; } @expose.unchecked() - txidVisibleInSnapshot | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.TxidSnapshot, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("txid_visible_in_snapshot", [this, ...__rest], __rt) as any; } + txidVisibleInSnapshot | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.TxidSnapshot, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("txid_visible_in_snapshot", [this, ...__rest], __rt) as any; } @expose.unchecked() - avg(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("avg", [this, ...__rest], __rt) as any; } + avg(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("avg", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitAnd(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("bit_and", [this, ...__rest], __rt) as any; } + bitAnd(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("bit_and", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitOr(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("bit_or", [this, ...__rest], __rt) as any; } + bitOr(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("bit_or", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitXor(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("bit_xor", [this, ...__rest], __rt) as any; } + bitXor(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("bit_xor", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Int8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddev(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev", [this, ...__rest], __rt) as any; } + stddev(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev_pop", [this, ...__rest], __rt) as any; } + stddevPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev_samp", [this, ...__rest], __rt) as any; } + stddevSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - sum(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("sum", [this, ...__rest], __rt) as any; } + sum(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - varPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("var_pop", [this, ...__rest], __rt) as any; } + varPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("var_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - varSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("var_samp", [this, ...__rest], __rt) as any; } + varSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("var_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - variance(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("variance", [this, ...__rest], __rt) as any; } - generateSeries | string, M1 extends types.Int8 | string>(arg0: M0, arg1: M1): runtime.PgSrf<{ generate_series: types.Int8 | runtime.NullOf>> }, "generate_series">; - generateSeries | string>(arg0: M0): runtime.PgSrf<{ generate_series: types.Int8>> }, "generate_series">; + variance(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("variance", [this, ...__rest], __rt) as any; } + generateSeries | string, M1 extends types.Int8 | string>(arg0: M0, arg1: M1): runtime.Srf<{ generate_series: types.Int8 | runtime.NullOf>> }, "generate_series">; + generateSeries | string>(arg0: M0): runtime.Srf<{ generate_series: types.Int8>> }, "generate_series">; @expose.unchecked() - generateSeries(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int8, allowPrimitive: true }, { type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return new runtime.PgSrf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } + generateSeries(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int8, allowPrimitive: true }, { type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return new runtime.Srf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } @expose.unchecked() - ['#'] | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['#'] | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['%'] | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`%`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['%'] | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`%`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&'] | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&'] | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['*']>(arg0: M0): types.Money>>; ['*']>(arg0: M0): types.Int8>>; ['*'] | string>(arg0: M0): types.Int8>>; ['*']>(arg0: M0): types.Int8>>; @expose.unchecked() - ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money }], types.Money], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2 }], types.Int8]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money }], types.Money], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2 }], types.Int8]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } times>(arg0: M0): types.Money>>; times>(arg0: M0): types.Int8>>; times | string>(arg0: M0): types.Int8>>; times>(arg0: M0): types.Int8>>; @expose.unchecked() - times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money }], types.Money], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2 }], types.Int8]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money }], types.Money], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int2 }], types.Int8]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['+']>(arg0: M0): types.Inet>>; ['+']>(arg0: M0): types.Int8>>; ['+']>(arg0: M0): types.Int8>>; ['+'] | string>(arg0: M0): types.Int8>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet }], types.Inet], [[{ type: types.Int2 }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet }], types.Inet], [[{ type: types.Int2 }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus>(arg0: M0): types.Inet>>; plus>(arg0: M0): types.Int8>>; plus>(arg0: M0): types.Int8>>; plus | string>(arg0: M0): types.Int8>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet }], types.Inet], [[{ type: types.Int2 }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Inet }], types.Inet], [[{ type: types.Int2 }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-'] | string>(arg0: M0): types.Int8>>; ['-']>(arg0: M0): types.Int8>>; ['-']>(arg0: M0): types.Int8>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int2 }], types.Int8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int2 }], types.Int8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus | string>(arg0: M0): types.Int8>>; minus>(arg0: M0): types.Int8>>; minus>(arg0: M0): types.Int8>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int2 }], types.Int8]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int2 }], types.Int8]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['/']>(arg0: M0): types.Int8>>; ['/']>(arg0: M0): types.Int8>>; ['/'] | string>(arg0: M0): types.Int8>>; @expose.unchecked() - ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } divide>(arg0: M0): types.Int8>>; divide>(arg0: M0): types.Int8>>; divide | string>(arg0: M0): types.Int8>>; @expose.unchecked() - divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Int8], [[{ type: types.Int4 }], types.Int8], [[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<']>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; ['<'] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lt>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; lt | string>(arg0: M0): types.Bool>>; @expose.unchecked() - lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<'] | number>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'] | number>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<=']>(arg0: M0): types.Bool>>; ['<='] | string>(arg0: M0): types.Bool>>; ['<=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lte>(arg0: M0): types.Bool>>; lte | string>(arg0: M0): types.Bool>>; lte>(arg0: M0): types.Bool>>; @expose.unchecked() - lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<>'] | string>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | string>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int2 }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['=']>(arg0: M0): types.Bool>>; ['='] | string>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq>(arg0: M0): types.Bool>>; eq | string>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>']>(arg0: M0): types.Bool>>; ['>'] | string>(arg0: M0): types.Bool>>; ['>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gt>(arg0: M0): types.Bool>>; gt | string>(arg0: M0): types.Bool>>; gt>(arg0: M0): types.Bool>>; @expose.unchecked() - gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool], [[{ type: types.Int4 }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>=']>(arg0: M0): types.Bool>>; ['>=']>(arg0: M0): types.Bool>>; ['>='] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gte>(arg0: M0): types.Bool>>; gte>(arg0: M0): types.Bool>>; gte | string>(arg0: M0): types.Bool>>; @expose.unchecked() - gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int2 }], types.Bool], [[{ type: types.Int4 }], types.Bool], [[{ type: types.Int8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>>'] | number>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'] | number>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|'] | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.PgOp(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|'] | string>(arg0: M0): types.Int8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Int8]]); return runtime.opCall(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/interval.ts b/src/types/postgres/generated/interval.ts index 123c0ea..db70112 100644 --- a/src/types/postgres/generated/interval.ts +++ b/src/types/postgres/generated/interval.ts @@ -20,42 +20,42 @@ export class Interval extends Anynonarray { dateBin, M1 extends types.Timestamp>(arg0: M0, arg1: M1): types.Timestamp | runtime.NullOf>>; dateBin, M1 extends types.Timestamptz>(arg0: M0, arg1: M1): types.Timestamptz | runtime.NullOf>>; @expose.unchecked() - dateBin(arg0: unknown, arg1: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Timestamp }, { type: types.Timestamp }], types.Timestamp], [[{ type: types.Timestamptz }, { type: types.Timestamptz }], types.Timestamptz]]); return runtime.PgFunc("date_bin", [this, ...__rest], __rt) as any; } + dateBin(arg0: unknown, arg1: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Timestamp }, { type: types.Timestamp }], types.Timestamp], [[{ type: types.Timestamptz }, { type: types.Timestamptz }], types.Timestamptz]]); return runtime.funcCall("date_bin", [this, ...__rest], __rt) as any; } @expose.unchecked() - interval | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Interval]]); return runtime.PgFunc("interval", [this, ...__rest], __rt) as any; } + interval | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Interval]]); return runtime.funcCall("interval", [this, ...__rest], __rt) as any; } @expose.unchecked() - intervalLarger | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.PgFunc("interval_larger", [this, ...__rest], __rt) as any; } + intervalLarger | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.funcCall("interval_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - intervalSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("interval_send", [this, ...__rest], __rt) as any; } + intervalSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("interval_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - intervalSmaller | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.PgFunc("interval_smaller", [this, ...__rest], __rt) as any; } + intervalSmaller | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.funcCall("interval_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - isfinite(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("isfinite", [this, ...__rest], __rt) as any; } + isfinite(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("isfinite", [this, ...__rest], __rt) as any; } @expose.unchecked() - justifyDays(): types.Interval { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.PgFunc("justify_days", [this, ...__rest], __rt) as any; } + justifyDays(): types.Interval { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.funcCall("justify_days", [this, ...__rest], __rt) as any; } @expose.unchecked() - justifyHours(): types.Interval { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.PgFunc("justify_hours", [this, ...__rest], __rt) as any; } + justifyHours(): types.Interval { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.funcCall("justify_hours", [this, ...__rest], __rt) as any; } @expose.unchecked() - justifyInterval(): types.Interval { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.PgFunc("justify_interval", [this, ...__rest], __rt) as any; } + justifyInterval(): types.Interval { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.funcCall("justify_interval", [this, ...__rest], __rt) as any; } @expose.unchecked() - time(): types.Time { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.PgFunc("time", [this, ...__rest], __rt) as any; } + time(): types.Time { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.funcCall("time", [this, ...__rest], __rt) as any; } timezone>(arg0: M0): types.Timestamp>>; timezone>(arg0: M0): types.Timestamptz>>; timezone>(arg0: M0): types.Timetz>>; @expose.unchecked() - timezone(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Timestamp], [[{ type: types.Timestamp }], types.Timestamptz], [[{ type: types.Timetz }], types.Timetz]]); return runtime.PgFunc("timezone", [this, ...__rest], __rt) as any; } + timezone(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Timestamp], [[{ type: types.Timestamp }], types.Timestamptz], [[{ type: types.Timetz }], types.Timetz]]); return runtime.funcCall("timezone", [this, ...__rest], __rt) as any; } @expose.unchecked() - avg(): types.Interval<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.PgFunc("avg", [this, ...__rest], __rt) as any; } + avg(): types.Interval<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.funcCall("avg", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Interval<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Interval<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Interval<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Interval<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - sum(): types.Interval<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.PgFunc("sum", [this, ...__rest], __rt) as any; } + sum(): types.Interval<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.funcCall("sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['*'] | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'] | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - times | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['+']>(arg0: M0): types.Timestamp>>; ['+']>(arg0: M0): types.Timetz>>; ['+']>(arg0: M0): types.Timestamp>>; @@ -63,7 +63,7 @@ export class Interval extends Anynonarray { ['+']>(arg0: M0): types.Time>>; ['+'] | string>(arg0: M0): types.Interval>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Timestamp], [[{ type: types.Timetz }], types.Timetz], [[{ type: types.Timestamp }], types.Timestamp], [[{ type: types.Timestamptz }], types.Timestamptz], [[{ type: types.Time }], types.Time], [[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Timestamp], [[{ type: types.Timetz }], types.Timetz], [[{ type: types.Timestamp }], types.Timestamp], [[{ type: types.Timestamptz }], types.Timestamptz], [[{ type: types.Time }], types.Time], [[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus>(arg0: M0): types.Timestamp>>; plus>(arg0: M0): types.Timetz>>; plus>(arg0: M0): types.Timestamp>>; @@ -71,37 +71,37 @@ export class Interval extends Anynonarray { plus>(arg0: M0): types.Time>>; plus | string>(arg0: M0): types.Interval>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Timestamp], [[{ type: types.Timetz }], types.Timetz], [[{ type: types.Timestamp }], types.Timestamp], [[{ type: types.Timestamptz }], types.Timestamptz], [[{ type: types.Time }], types.Time], [[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Timestamp], [[{ type: types.Timetz }], types.Timetz], [[{ type: types.Timestamp }], types.Timestamp], [[{ type: types.Timestamptz }], types.Timestamptz], [[{ type: types.Time }], types.Time], [[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['-'] | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'] | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - minus | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['/'] | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['/'] | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - divide | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + divide | number>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float8, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/json.ts b/src/types/postgres/generated/json.ts index 5202908..5a003b5 100644 --- a/src/types/postgres/generated/json.ts +++ b/src/types/postgres/generated/json.ts @@ -18,37 +18,37 @@ export class Json extends Anynonarray { static __typnameText = "json"; declare deserialize: (raw: string) => string; @expose.unchecked() - jsonArrayElement | number>(arg0: M0): types.Json>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Json]]); return runtime.PgFunc("json_array_element", [this, ...__rest], __rt) as any; } + jsonArrayElement | number>(arg0: M0): types.Json>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Json]]); return runtime.funcCall("json_array_element", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonArrayElementText | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("json_array_element_text", [this, ...__rest], __rt) as any; } + jsonArrayElementText | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("json_array_element_text", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonArrayLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("json_array_length", [this, ...__rest], __rt) as any; } + jsonArrayLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("json_array_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonObjectField | string>(arg0: M0): types.Json>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Json]]); return runtime.PgFunc("json_object_field", [this, ...__rest], __rt) as any; } + jsonObjectField | string>(arg0: M0): types.Json>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Json]]); return runtime.funcCall("json_object_field", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonObjectFieldText | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("json_object_field_text", [this, ...__rest], __rt) as any; } + jsonObjectFieldText | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("json_object_field_text", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("json_send", [this, ...__rest], __rt) as any; } + jsonSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("json_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonStripNulls(): types.Json { const [__rt, ...__rest] = runtime.match([], [[[], types.Json]]); return runtime.PgFunc("json_strip_nulls", [this, ...__rest], __rt) as any; } + jsonStripNulls(): types.Json { const [__rt, ...__rest] = runtime.match([], [[[], types.Json]]); return runtime.funcCall("json_strip_nulls", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonTypeof(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("json_typeof", [this, ...__rest], __rt) as any; } + jsonTypeof(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("json_typeof", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonArrayElements(): runtime.PgSrf<{ value: types.Json<1> }, "json_array_elements"> { return new runtime.PgSrf("json_array_elements", [this], [["value", types.Json]]) as any; } + jsonArrayElements(): runtime.Srf<{ value: types.Json<1> }, "json_array_elements"> { return new runtime.Srf("json_array_elements", [this], [["value", types.Json]]) as any; } @expose.unchecked() - jsonArrayElementsText(): runtime.PgSrf<{ value: types.Text<1> }, "json_array_elements_text"> { return new runtime.PgSrf("json_array_elements_text", [this], [["value", types.Text]]) as any; } + jsonArrayElementsText(): runtime.Srf<{ value: types.Text<1> }, "json_array_elements_text"> { return new runtime.Srf("json_array_elements_text", [this], [["value", types.Text]]) as any; } @expose.unchecked() - jsonEach(): runtime.PgSrf<{ key: types.Text<1>; value: types.Json<1> }, "json_each"> { return new runtime.PgSrf("json_each", [this], [["key", types.Text], ["value", types.Json]]) as any; } + jsonEach(): runtime.Srf<{ key: types.Text<1>; value: types.Json<1> }, "json_each"> { return new runtime.Srf("json_each", [this], [["key", types.Text], ["value", types.Json]]) as any; } @expose.unchecked() - jsonEachText(): runtime.PgSrf<{ key: types.Text<1>; value: types.Text<1> }, "json_each_text"> { return new runtime.PgSrf("json_each_text", [this], [["key", types.Text], ["value", types.Text]]) as any; } + jsonEachText(): runtime.Srf<{ key: types.Text<1>; value: types.Text<1> }, "json_each_text"> { return new runtime.Srf("json_each_text", [this], [["key", types.Text], ["value", types.Text]]) as any; } @expose.unchecked() - jsonObjectKeys(): runtime.PgSrf<{ json_object_keys: types.Text }, "json_object_keys"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return new runtime.PgSrf("json_object_keys", [this, ...__rest], [["json_object_keys", __rt]]) as any; } + jsonObjectKeys(): runtime.Srf<{ json_object_keys: types.Text }, "json_object_keys"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return new runtime.Srf("json_object_keys", [this, ...__rest], [["json_object_keys", __rt]]) as any; } ['->'] | string>(arg0: M0): types.Json>>; ['->'] | number>(arg0: M0): types.Json>>; @expose.unchecked() - ['->'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Json], [[{ type: types.Int4, allowPrimitive: true }], types.Json]]); return runtime.PgOp(runtime.sql`->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['->'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Json], [[{ type: types.Int4, allowPrimitive: true }], types.Json]]); return runtime.opCall(runtime.sql`->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['->>'] | number>(arg0: M0): types.Text>>; ['->>'] | string>(arg0: M0): types.Text>>; @expose.unchecked() - ['->>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgOp(runtime.sql`->>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['->>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.opCall(runtime.sql`->>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/jsonb.ts b/src/types/postgres/generated/jsonb.ts index 086cc00..549a04d 100644 --- a/src/types/postgres/generated/jsonb.ts +++ b/src/types/postgres/generated/jsonb.ts @@ -18,119 +18,119 @@ export class Jsonb extends Anynonarray { static __typnameText = "jsonb"; declare deserialize: (raw: string) => string; @expose.unchecked() - bool(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("bool", [this, ...__rest], __rt) as any; } + bool(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("bool", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("float4", [this, ...__rest], __rt) as any; } + float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("float4", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("float8", [this, ...__rest], __rt) as any; } + float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("float8", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("int2", [this, ...__rest], __rt) as any; } + int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("int2", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8", [this, ...__rest], __rt) as any; } + int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbArrayElement | number>(arg0: M0): types.Jsonb>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_array_element", [this, ...__rest], __rt) as any; } + jsonbArrayElement | number>(arg0: M0): types.Jsonb>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_array_element", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbArrayElementText | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("jsonb_array_element_text", [this, ...__rest], __rt) as any; } + jsonbArrayElementText | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("jsonb_array_element_text", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbArrayLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("jsonb_array_length", [this, ...__rest], __rt) as any; } + jsonbArrayLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("jsonb_array_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbConcat | string>(arg0: M0): types.Jsonb>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_concat", [this, ...__rest], __rt) as any; } + jsonbConcat | string>(arg0: M0): types.Jsonb>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_concat", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbContained | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("jsonb_contained", [this, ...__rest], __rt) as any; } + jsonbContained | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("jsonb_contained", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbContains | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("jsonb_contains", [this, ...__rest], __rt) as any; } + jsonbContains | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("jsonb_contains", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbExists | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("jsonb_exists", [this, ...__rest], __rt) as any; } + jsonbExists | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("jsonb_exists", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbObjectField | string>(arg0: M0): types.Jsonb>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_object_field", [this, ...__rest], __rt) as any; } + jsonbObjectField | string>(arg0: M0): types.Jsonb>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_object_field", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbObjectFieldText | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("jsonb_object_field_text", [this, ...__rest], __rt) as any; } + jsonbObjectFieldText | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("jsonb_object_field_text", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbPathExists | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Bool | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("jsonb_path_exists", [this, ...__rest], __rt) as any; } + jsonbPathExists | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Bool | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("jsonb_path_exists", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbPathExistsOpr | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonpath, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("jsonb_path_exists_opr", [this, ...__rest], __rt) as any; } + jsonbPathExistsOpr | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonpath, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("jsonb_path_exists_opr", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbPathMatch | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Bool | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("jsonb_path_match", [this, ...__rest], __rt) as any; } + jsonbPathMatch | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Bool | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("jsonb_path_match", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbPathMatchOpr | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonpath, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("jsonb_path_match_opr", [this, ...__rest], __rt) as any; } + jsonbPathMatchOpr | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonpath, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("jsonb_path_match_opr", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbPathQueryArray | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Jsonb | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_path_query_array", [this, ...__rest], __rt) as any; } + jsonbPathQueryArray | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Jsonb | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_path_query_array", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbPathQueryFirst | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Jsonb | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Jsonb]]); return runtime.PgFunc("jsonb_path_query_first", [this, ...__rest], __rt) as any; } + jsonbPathQueryFirst | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Jsonb | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Jsonb]]); return runtime.funcCall("jsonb_path_query_first", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbPretty(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("jsonb_pretty", [this, ...__rest], __rt) as any; } + jsonbPretty(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("jsonb_pretty", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("jsonb_send", [this, ...__rest], __rt) as any; } + jsonbSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("jsonb_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbStripNulls(): types.Jsonb { const [__rt, ...__rest] = runtime.match([], [[[], types.Jsonb]]); return runtime.PgFunc("jsonb_strip_nulls", [this, ...__rest], __rt) as any; } + jsonbStripNulls(): types.Jsonb { const [__rt, ...__rest] = runtime.match([], [[[], types.Jsonb]]); return runtime.funcCall("jsonb_strip_nulls", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbTypeof(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("jsonb_typeof", [this, ...__rest], __rt) as any; } + jsonbTypeof(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("jsonb_typeof", [this, ...__rest], __rt) as any; } @expose.unchecked() - numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric", [this, ...__rest], __rt) as any; } + numeric(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbArrayElements(): runtime.PgSrf<{ value: types.Jsonb<1> }, "jsonb_array_elements"> { return new runtime.PgSrf("jsonb_array_elements", [this], [["value", types.Jsonb]]) as any; } + jsonbArrayElements(): runtime.Srf<{ value: types.Jsonb<1> }, "jsonb_array_elements"> { return new runtime.Srf("jsonb_array_elements", [this], [["value", types.Jsonb]]) as any; } @expose.unchecked() - jsonbArrayElementsText(): runtime.PgSrf<{ value: types.Text<1> }, "jsonb_array_elements_text"> { return new runtime.PgSrf("jsonb_array_elements_text", [this], [["value", types.Text]]) as any; } + jsonbArrayElementsText(): runtime.Srf<{ value: types.Text<1> }, "jsonb_array_elements_text"> { return new runtime.Srf("jsonb_array_elements_text", [this], [["value", types.Text]]) as any; } @expose.unchecked() - jsonbEach(): runtime.PgSrf<{ key: types.Text<1>; value: types.Jsonb<1> }, "jsonb_each"> { return new runtime.PgSrf("jsonb_each", [this], [["key", types.Text], ["value", types.Jsonb]]) as any; } + jsonbEach(): runtime.Srf<{ key: types.Text<1>; value: types.Jsonb<1> }, "jsonb_each"> { return new runtime.Srf("jsonb_each", [this], [["key", types.Text], ["value", types.Jsonb]]) as any; } @expose.unchecked() - jsonbEachText(): runtime.PgSrf<{ key: types.Text<1>; value: types.Text<1> }, "jsonb_each_text"> { return new runtime.PgSrf("jsonb_each_text", [this], [["key", types.Text], ["value", types.Text]]) as any; } + jsonbEachText(): runtime.Srf<{ key: types.Text<1>; value: types.Text<1> }, "jsonb_each_text"> { return new runtime.Srf("jsonb_each_text", [this], [["key", types.Text], ["value", types.Text]]) as any; } @expose.unchecked() - jsonbObjectKeys(): runtime.PgSrf<{ jsonb_object_keys: types.Text }, "jsonb_object_keys"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return new runtime.PgSrf("jsonb_object_keys", [this, ...__rest], [["jsonb_object_keys", __rt]]) as any; } + jsonbObjectKeys(): runtime.Srf<{ jsonb_object_keys: types.Text }, "jsonb_object_keys"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return new runtime.Srf("jsonb_object_keys", [this, ...__rest], [["jsonb_object_keys", __rt]]) as any; } @expose.unchecked() - jsonbPathQuery | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): runtime.PgSrf<{ jsonb_path_query: types.Jsonb | runtime.NullOf | runtime.NullOf>> }, "jsonb_path_query"> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Jsonb]]); return new runtime.PgSrf("jsonb_path_query", [this, ...__rest], [["jsonb_path_query", __rt]]) as any; } + jsonbPathQuery | string, M1 extends types.Jsonb | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): runtime.Srf<{ jsonb_path_query: types.Jsonb | runtime.NullOf | runtime.NullOf>> }, "jsonb_path_query"> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Jsonpath, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Jsonb]]); return new runtime.Srf("jsonb_path_query", [this, ...__rest], [["jsonb_path_query", __rt]]) as any; } ['-'] | number>(arg0: M0): types.Jsonb>>; ['-'] | string>(arg0: M0): types.Jsonb>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Jsonb], [[{ type: types.Text, allowPrimitive: true }], types.Jsonb]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Jsonb], [[{ type: types.Text, allowPrimitive: true }], types.Jsonb]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus | number>(arg0: M0): types.Jsonb>>; minus | string>(arg0: M0): types.Jsonb>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Jsonb], [[{ type: types.Text, allowPrimitive: true }], types.Jsonb]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Jsonb], [[{ type: types.Text, allowPrimitive: true }], types.Jsonb]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['->'] | number>(arg0: M0): types.Jsonb>>; ['->'] | string>(arg0: M0): types.Jsonb>>; @expose.unchecked() - ['->'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Jsonb], [[{ type: types.Text, allowPrimitive: true }], types.Jsonb]]); return runtime.PgOp(runtime.sql`->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['->'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Jsonb], [[{ type: types.Text, allowPrimitive: true }], types.Jsonb]]); return runtime.opCall(runtime.sql`->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['->>'] | string>(arg0: M0): types.Text>>; ['->>'] | number>(arg0: M0): types.Text>>; @expose.unchecked() - ['->>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgOp(runtime.sql`->>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['->>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.opCall(runtime.sql`->>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['?'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`?`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['?'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`?`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@?'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonpath, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@?`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@?'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonpath, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@?`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonpath, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonpath, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['||'] | string>(arg0: M0): types.Jsonb>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Jsonb]]); return runtime.PgOp(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['||'] | string>(arg0: M0): types.Jsonb>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Jsonb, allowPrimitive: true }], types.Jsonb]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/jsonpath.ts b/src/types/postgres/generated/jsonpath.ts index 2014134..79c65c3 100644 --- a/src/types/postgres/generated/jsonpath.ts +++ b/src/types/postgres/generated/jsonpath.ts @@ -18,5 +18,5 @@ export class Jsonpath extends Anynonarray { static __typnameText = "jsonpath"; declare deserialize: (raw: string) => string; @expose.unchecked() - jsonpathSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("jsonpath_send", [this, ...__rest], __rt) as any; } + jsonpathSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("jsonpath_send", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/macaddr.ts b/src/types/postgres/generated/macaddr.ts index 97ccf31..6966920 100644 --- a/src/types/postgres/generated/macaddr.ts +++ b/src/types/postgres/generated/macaddr.ts @@ -18,43 +18,43 @@ export class Macaddr extends Anynonarray { static __typnameText = "macaddr"; declare deserialize: (raw: string) => string; @expose.unchecked() - macaddr8(): types.Macaddr8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr8]]); return runtime.PgFunc("macaddr8", [this, ...__rest], __rt) as any; } + macaddr8(): types.Macaddr8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr8]]); return runtime.funcCall("macaddr8", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddrAnd | string>(arg0: M0): types.Macaddr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Macaddr]]); return runtime.PgFunc("macaddr_and", [this, ...__rest], __rt) as any; } + macaddrAnd | string>(arg0: M0): types.Macaddr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Macaddr]]); return runtime.funcCall("macaddr_and", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddrNot(): types.Macaddr { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr]]); return runtime.PgFunc("macaddr_not", [this, ...__rest], __rt) as any; } + macaddrNot(): types.Macaddr { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr]]); return runtime.funcCall("macaddr_not", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddrOr | string>(arg0: M0): types.Macaddr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Macaddr]]); return runtime.PgFunc("macaddr_or", [this, ...__rest], __rt) as any; } + macaddrOr | string>(arg0: M0): types.Macaddr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Macaddr]]); return runtime.funcCall("macaddr_or", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddrSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("macaddr_send", [this, ...__rest], __rt) as any; } + macaddrSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("macaddr_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - trunc(): types.Macaddr { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr]]); return runtime.PgFunc("trunc", [this, ...__rest], __rt) as any; } + trunc(): types.Macaddr { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr]]); return runtime.funcCall("trunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['&'] | string>(arg0: M0): types.Macaddr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Macaddr]]); return runtime.PgOp(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&'] | string>(arg0: M0): types.Macaddr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Macaddr]]); return runtime.opCall(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|'] | string>(arg0: M0): types.Macaddr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Macaddr]]); return runtime.PgOp(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|'] | string>(arg0: M0): types.Macaddr>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr, allowPrimitive: true }], types.Macaddr]]); return runtime.opCall(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/macaddr8.ts b/src/types/postgres/generated/macaddr8.ts index 7add578..09a6545 100644 --- a/src/types/postgres/generated/macaddr8.ts +++ b/src/types/postgres/generated/macaddr8.ts @@ -18,45 +18,45 @@ export class Macaddr8 extends Anynonarray { static __typnameText = "macaddr8"; declare deserialize: (raw: string) => string; @expose.unchecked() - macaddr(): types.Macaddr { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr]]); return runtime.PgFunc("macaddr", [this, ...__rest], __rt) as any; } + macaddr(): types.Macaddr { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr]]); return runtime.funcCall("macaddr", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddr8And | string>(arg0: M0): types.Macaddr8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Macaddr8]]); return runtime.PgFunc("macaddr8_and", [this, ...__rest], __rt) as any; } + macaddr8And | string>(arg0: M0): types.Macaddr8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Macaddr8]]); return runtime.funcCall("macaddr8_and", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddr8Not(): types.Macaddr8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr8]]); return runtime.PgFunc("macaddr8_not", [this, ...__rest], __rt) as any; } + macaddr8Not(): types.Macaddr8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr8]]); return runtime.funcCall("macaddr8_not", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddr8Or | string>(arg0: M0): types.Macaddr8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Macaddr8]]); return runtime.PgFunc("macaddr8_or", [this, ...__rest], __rt) as any; } + macaddr8Or | string>(arg0: M0): types.Macaddr8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Macaddr8]]); return runtime.funcCall("macaddr8_or", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddr8Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("macaddr8_send", [this, ...__rest], __rt) as any; } + macaddr8Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("macaddr8_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - macaddr8Set7Bit(): types.Macaddr8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr8]]); return runtime.PgFunc("macaddr8_set7bit", [this, ...__rest], __rt) as any; } + macaddr8Set7Bit(): types.Macaddr8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr8]]); return runtime.funcCall("macaddr8_set7bit", [this, ...__rest], __rt) as any; } @expose.unchecked() - trunc(): types.Macaddr8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr8]]); return runtime.PgFunc("trunc", [this, ...__rest], __rt) as any; } + trunc(): types.Macaddr8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Macaddr8]]); return runtime.funcCall("trunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['&'] | string>(arg0: M0): types.Macaddr8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Macaddr8]]); return runtime.PgOp(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&'] | string>(arg0: M0): types.Macaddr8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Macaddr8]]); return runtime.opCall(runtime.sql`&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|'] | string>(arg0: M0): types.Macaddr8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Macaddr8]]); return runtime.PgOp(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|'] | string>(arg0: M0): types.Macaddr8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Macaddr8, allowPrimitive: true }], types.Macaddr8]]); return runtime.opCall(runtime.sql`|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/money.ts b/src/types/postgres/generated/money.ts index f6402f5..93294f2 100644 --- a/src/types/postgres/generated/money.ts +++ b/src/types/postgres/generated/money.ts @@ -18,41 +18,41 @@ export class Money extends Anynonarray { static __typnameText = "money"; declare deserialize: (raw: string) => string; @expose.unchecked() - cashSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("cash_send", [this, ...__rest], __rt) as any; } + cashSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("cash_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - cashWords(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("cash_words", [this, ...__rest], __rt) as any; } + cashWords(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("cash_words", [this, ...__rest], __rt) as any; } @expose.unchecked() - cashlarger | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.PgFunc("cashlarger", [this, ...__rest], __rt) as any; } + cashlarger | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.funcCall("cashlarger", [this, ...__rest], __rt) as any; } @expose.unchecked() - cashsmaller | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.PgFunc("cashsmaller", [this, ...__rest], __rt) as any; } + cashsmaller | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.funcCall("cashsmaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Money<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Money]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Money<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Money]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Money<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Money]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Money<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Money]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - sum(): types.Money<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Money]]); return runtime.PgFunc("sum", [this, ...__rest], __rt) as any; } + sum(): types.Money<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Money]]); return runtime.funcCall("sum", [this, ...__rest], __rt) as any; } ['*']>(arg0: M0): types.Money>>; ['*']>(arg0: M0): types.Money>>; ['*']>(arg0: M0): types.Money>>; ['*'] | string>(arg0: M0): types.Money>>; ['*']>(arg0: M0): types.Money>>; @expose.unchecked() - ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Money], [[{ type: types.Int2 }], types.Money], [[{ type: types.Int4 }], types.Money], [[{ type: types.Int8, allowPrimitive: true }], types.Money], [[{ type: types.Float8 }], types.Money]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Money], [[{ type: types.Int2 }], types.Money], [[{ type: types.Int4 }], types.Money], [[{ type: types.Int8, allowPrimitive: true }], types.Money], [[{ type: types.Float8 }], types.Money]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } times>(arg0: M0): types.Money>>; times>(arg0: M0): types.Money>>; times>(arg0: M0): types.Money>>; times | string>(arg0: M0): types.Money>>; times>(arg0: M0): types.Money>>; @expose.unchecked() - times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Money], [[{ type: types.Int2 }], types.Money], [[{ type: types.Int4 }], types.Money], [[{ type: types.Int8, allowPrimitive: true }], types.Money], [[{ type: types.Float8 }], types.Money]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Float4 }], types.Money], [[{ type: types.Int2 }], types.Money], [[{ type: types.Int4 }], types.Money], [[{ type: types.Int8, allowPrimitive: true }], types.Money], [[{ type: types.Float8 }], types.Money]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['+'] | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'] | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - plus | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['-'] | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'] | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - minus | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus | string>(arg0: M0): types.Money>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Money]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['/']>(arg0: M0): types.Money>>; ['/']>(arg0: M0): types.Money>>; ['/']>(arg0: M0): types.Money>>; @@ -60,7 +60,7 @@ export class Money extends Anynonarray { ['/']>(arg0: M0): types.Money>>; ['/']>(arg0: M0): types.Money>>; @expose.unchecked() - ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Money], [[{ type: types.Int4 }], types.Money], [[{ type: types.Int2 }], types.Money], [[{ type: types.Money, allowPrimitive: true }], types.Float8], [[{ type: types.Float4 }], types.Money], [[{ type: types.Float8 }], types.Money]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['/'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Money], [[{ type: types.Int4 }], types.Money], [[{ type: types.Int2 }], types.Money], [[{ type: types.Money, allowPrimitive: true }], types.Float8], [[{ type: types.Float4 }], types.Money], [[{ type: types.Float8 }], types.Money]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } divide>(arg0: M0): types.Money>>; divide>(arg0: M0): types.Money>>; divide>(arg0: M0): types.Money>>; @@ -68,29 +68,29 @@ export class Money extends Anynonarray { divide>(arg0: M0): types.Money>>; divide>(arg0: M0): types.Money>>; @expose.unchecked() - divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Money], [[{ type: types.Int4 }], types.Money], [[{ type: types.Int2 }], types.Money], [[{ type: types.Money, allowPrimitive: true }], types.Float8], [[{ type: types.Float4 }], types.Money], [[{ type: types.Float8 }], types.Money]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + divide(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8 }], types.Money], [[{ type: types.Int4 }], types.Money], [[{ type: types.Int2 }], types.Money], [[{ type: types.Money, allowPrimitive: true }], types.Float8], [[{ type: types.Float4 }], types.Money], [[{ type: types.Float8 }], types.Money]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Money, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/numeric.ts b/src/types/postgres/generated/numeric.ts index 8222c36..b505ab9 100644 --- a/src/types/postgres/generated/numeric.ts +++ b/src/types/postgres/generated/numeric.ts @@ -18,165 +18,165 @@ export class Numeric extends Anynonarray { static __typnameText = "numeric"; declare deserialize: (raw: string) => string; @expose.unchecked() - abs(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("abs", [this, ...__rest], __rt) as any; } + abs(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - ceil(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("ceil", [this, ...__rest], __rt) as any; } + ceil(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("ceil", [this, ...__rest], __rt) as any; } @expose.unchecked() - ceiling(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("ceiling", [this, ...__rest], __rt) as any; } + ceiling(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("ceiling", [this, ...__rest], __rt) as any; } @expose.unchecked() - div | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("div", [this, ...__rest], __rt) as any; } + div | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("div", [this, ...__rest], __rt) as any; } @expose.unchecked() - exp(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("exp", [this, ...__rest], __rt) as any; } + exp(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("exp", [this, ...__rest], __rt) as any; } @expose.unchecked() - float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.PgFunc("float4", [this, ...__rest], __rt) as any; } + float4(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("float4", [this, ...__rest], __rt) as any; } @expose.unchecked() - float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("float8", [this, ...__rest], __rt) as any; } + float8(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("float8", [this, ...__rest], __rt) as any; } @expose.unchecked() - floor(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("floor", [this, ...__rest], __rt) as any; } + floor(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("floor", [this, ...__rest], __rt) as any; } @expose.unchecked() - gcd | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("gcd", [this, ...__rest], __rt) as any; } + gcd | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("gcd", [this, ...__rest], __rt) as any; } @expose.unchecked() - int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("int2", [this, ...__rest], __rt) as any; } + int2(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("int2", [this, ...__rest], __rt) as any; } @expose.unchecked() - int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("int4", [this, ...__rest], __rt) as any; } + int4(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("int4", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8", [this, ...__rest], __rt) as any; } + int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() - int8Sum | string>(arg0: M0): types.Numeric<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("int8_sum", [this, ...__rest], __rt) as any; } + int8Sum | string>(arg0: M0): types.Numeric<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("int8_sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - lcm | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("lcm", [this, ...__rest], __rt) as any; } + lcm | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("lcm", [this, ...__rest], __rt) as any; } @expose.unchecked() - ln(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("ln", [this, ...__rest], __rt) as any; } + ln(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("ln", [this, ...__rest], __rt) as any; } log(): types.Numeric; log | string>(arg0: M0): types.Numeric>>; @expose.unchecked() - log(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[], types.Numeric], [[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("log", [this, ...__rest], __rt) as any; } + log(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[], types.Numeric], [[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("log", [this, ...__rest], __rt) as any; } @expose.unchecked() - log10(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("log10", [this, ...__rest], __rt) as any; } + log10(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("log10", [this, ...__rest], __rt) as any; } @expose.unchecked() - minScale(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("min_scale", [this, ...__rest], __rt) as any; } + minScale(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("min_scale", [this, ...__rest], __rt) as any; } @expose.unchecked() - mod | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("mod", [this, ...__rest], __rt) as any; } + mod | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("mod", [this, ...__rest], __rt) as any; } @expose.unchecked() - numeric | number>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("numeric", [this, ...__rest], __rt) as any; } + numeric | number>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("numeric", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericAbs(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric_abs", [this, ...__rest], __rt) as any; } + numericAbs(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric_abs", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericDivTrunc | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("numeric_div_trunc", [this, ...__rest], __rt) as any; } + numericDivTrunc | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("numeric_div_trunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericExp(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric_exp", [this, ...__rest], __rt) as any; } + numericExp(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric_exp", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericInc(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric_inc", [this, ...__rest], __rt) as any; } + numericInc(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric_inc", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericLarger | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("numeric_larger", [this, ...__rest], __rt) as any; } + numericLarger | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("numeric_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericLn(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric_ln", [this, ...__rest], __rt) as any; } + numericLn(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric_ln", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericLog | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("numeric_log", [this, ...__rest], __rt) as any; } + numericLog | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("numeric_log", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("numeric_send", [this, ...__rest], __rt) as any; } + numericSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("numeric_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericSmaller | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("numeric_smaller", [this, ...__rest], __rt) as any; } + numericSmaller | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("numeric_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - numericSqrt(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("numeric_sqrt", [this, ...__rest], __rt) as any; } + numericSqrt(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("numeric_sqrt", [this, ...__rest], __rt) as any; } @expose.unchecked() - numrangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("numrange_subdiff", [this, ...__rest], __rt) as any; } + numrangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("numrange_subdiff", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgLsn(): types.PgLsn { const [__rt, ...__rest] = runtime.match([], [[[], types.PgLsn]]); return runtime.PgFunc("pg_lsn", [this, ...__rest], __rt) as any; } + pgLsn(): types.PgLsn { const [__rt, ...__rest] = runtime.match([], [[[], types.PgLsn]]); return runtime.funcCall("pg_lsn", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgSizePretty(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("pg_size_pretty", [this, ...__rest], __rt) as any; } + pgSizePretty(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("pg_size_pretty", [this, ...__rest], __rt) as any; } @expose.unchecked() - pow | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("pow", [this, ...__rest], __rt) as any; } + pow | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("pow", [this, ...__rest], __rt) as any; } @expose.unchecked() - power | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("power", [this, ...__rest], __rt) as any; } + power | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("power", [this, ...__rest], __rt) as any; } round | number>(arg0: M0): types.Numeric>>; round(): types.Numeric; @expose.unchecked() - round(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Numeric], [[], types.Numeric]]); return runtime.PgFunc("round", [this, ...__rest], __rt) as any; } + round(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Numeric], [[], types.Numeric]]); return runtime.funcCall("round", [this, ...__rest], __rt) as any; } @expose.unchecked() - scale(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("scale", [this, ...__rest], __rt) as any; } + scale(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("scale", [this, ...__rest], __rt) as any; } @expose.unchecked() - sign(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("sign", [this, ...__rest], __rt) as any; } + sign(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("sign", [this, ...__rest], __rt) as any; } @expose.unchecked() - sqrt(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("sqrt", [this, ...__rest], __rt) as any; } + sqrt(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("sqrt", [this, ...__rest], __rt) as any; } @expose.unchecked() - trimScale(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("trim_scale", [this, ...__rest], __rt) as any; } + trimScale(): types.Numeric { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("trim_scale", [this, ...__rest], __rt) as any; } trunc(): types.Numeric; trunc | number>(arg0: M0): types.Numeric>>; @expose.unchecked() - trunc(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[], types.Numeric], [[{ type: types.Int4, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("trunc", [this, ...__rest], __rt) as any; } + trunc(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[], types.Numeric], [[{ type: types.Int4, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("trunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - widthBucket | string, M1 extends types.Numeric | string, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Int4 | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Numeric, allowPrimitive: true }, { type: types.Numeric, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("width_bucket", [this, ...__rest], __rt) as any; } + widthBucket | string, M1 extends types.Numeric | string, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Int4 | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Numeric, allowPrimitive: true }, { type: types.Numeric, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("width_bucket", [this, ...__rest], __rt) as any; } @expose.unchecked() - avg(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("avg", [this, ...__rest], __rt) as any; } + avg(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("avg", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddev(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev", [this, ...__rest], __rt) as any; } + stddev(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev_pop", [this, ...__rest], __rt) as any; } + stddevPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - stddevSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("stddev_samp", [this, ...__rest], __rt) as any; } + stddevSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("stddev_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - sum(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("sum", [this, ...__rest], __rt) as any; } + sum(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("sum", [this, ...__rest], __rt) as any; } @expose.unchecked() - varPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("var_pop", [this, ...__rest], __rt) as any; } + varPop(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("var_pop", [this, ...__rest], __rt) as any; } @expose.unchecked() - varSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("var_samp", [this, ...__rest], __rt) as any; } + varSamp(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("var_samp", [this, ...__rest], __rt) as any; } @expose.unchecked() - variance(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.PgFunc("variance", [this, ...__rest], __rt) as any; } - generateSeries | string, M1 extends types.Numeric | string>(arg0: M0, arg1: M1): runtime.PgSrf<{ generate_series: types.Numeric | runtime.NullOf>> }, "generate_series">; - generateSeries | string>(arg0: M0): runtime.PgSrf<{ generate_series: types.Numeric>> }, "generate_series">; + variance(): types.Numeric<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Numeric]]); return runtime.funcCall("variance", [this, ...__rest], __rt) as any; } + generateSeries | string, M1 extends types.Numeric | string>(arg0: M0, arg1: M1): runtime.Srf<{ generate_series: types.Numeric | runtime.NullOf>> }, "generate_series">; + generateSeries | string>(arg0: M0): runtime.Srf<{ generate_series: types.Numeric>> }, "generate_series">; @expose.unchecked() - generateSeries(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Numeric, allowPrimitive: true }, { type: types.Numeric, allowPrimitive: true }], types.Numeric], [[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return new runtime.PgSrf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } + generateSeries(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Numeric, allowPrimitive: true }, { type: types.Numeric, allowPrimitive: true }], types.Numeric], [[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return new runtime.Srf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } @expose.unchecked() - ['%'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`%`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['%'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`%`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['*'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - times | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + times | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['+'] | string>(arg0: M0): types.Numeric>>; ['+']>(arg0: M0): types.PgLsn>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric], [[{ type: types.PgLsn }], types.PgLsn]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric], [[{ type: types.PgLsn }], types.PgLsn]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus | string>(arg0: M0): types.Numeric>>; plus>(arg0: M0): types.PgLsn>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric], [[{ type: types.PgLsn }], types.PgLsn]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric], [[{ type: types.PgLsn }], types.PgLsn]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['-'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - minus | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['/'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['/'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - divide | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + divide | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`/`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['^'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`^`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['^'] | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`^`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/oid.ts b/src/types/postgres/generated/oid.ts index 3e27526..f2cb696 100644 --- a/src/types/postgres/generated/oid.ts +++ b/src/types/postgres/generated/oid.ts @@ -18,49 +18,49 @@ export class Oid extends Anynonarray { static __typnameText = "oid"; declare deserialize: (raw: string) => number; @expose.unchecked() - int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("int8", [this, ...__rest], __rt) as any; } + int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() - makeaclitem | number, M1 extends types.Text | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Aclitem | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Oid, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Aclitem]]); return runtime.PgFunc("makeaclitem", [this, ...__rest], __rt) as any; } + makeaclitem | number, M1 extends types.Text | string, M2 extends types.Bool | boolean>(arg0: M0, arg1: M1, arg2: M2): types.Aclitem | runtime.NullOf | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Oid, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Aclitem]]); return runtime.funcCall("makeaclitem", [this, ...__rest], __rt) as any; } @expose.unchecked() - oidlarger | number>(arg0: M0): types.Oid>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Oid]]); return runtime.PgFunc("oidlarger", [this, ...__rest], __rt) as any; } + oidlarger | number>(arg0: M0): types.Oid>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Oid]]); return runtime.funcCall("oidlarger", [this, ...__rest], __rt) as any; } @expose.unchecked() - oidsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("oidsend", [this, ...__rest], __rt) as any; } + oidsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("oidsend", [this, ...__rest], __rt) as any; } @expose.unchecked() - oidsmaller | number>(arg0: M0): types.Oid>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Oid]]); return runtime.PgFunc("oidsmaller", [this, ...__rest], __rt) as any; } + oidsmaller | number>(arg0: M0): types.Oid>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Oid]]); return runtime.funcCall("oidsmaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgIndexamProgressPhasename | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("pg_indexam_progress_phasename", [this, ...__rest], __rt) as any; } + pgIndexamProgressPhasename | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int8, allowPrimitive: true }], types.Text]]); return runtime.funcCall("pg_indexam_progress_phasename", [this, ...__rest], __rt) as any; } @expose.unchecked() - satisfiesHashPartition | number, M1 extends types.Int4 | number, M2 extends types.Any | string>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Any, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("satisfies_hash_partition", [this, ...__rest], __rt) as any; } + satisfiesHashPartition | number, M1 extends types.Int4 | number, M2 extends types.Any | string>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Any, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("satisfies_hash_partition", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Oid<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Oid]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Oid<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Oid]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Oid<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Oid]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Oid<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Oid]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsParse | string>(arg0: M0): runtime.PgSrf<{ tokid: types.Int4<1>; token: types.Text<1> }, "ts_parse"> { return new runtime.PgSrf("ts_parse", [this, arg0], [["tokid", types.Int4], ["token", types.Text]]) as any; } + tsParse | string>(arg0: M0): runtime.Srf<{ tokid: types.Int4<1>; token: types.Text<1> }, "ts_parse"> { return new runtime.Srf("ts_parse", [this, arg0], [["tokid", types.Int4], ["token", types.Text]]) as any; } @expose.unchecked() - tsTokenType(): runtime.PgSrf<{ tokid: types.Int4<1>; alias: types.Text<1>; description: types.Text<1> }, "ts_token_type"> { return new runtime.PgSrf("ts_token_type", [this], [["tokid", types.Int4], ["alias", types.Text], ["description", types.Text]]) as any; } + tsTokenType(): runtime.Srf<{ tokid: types.Int4<1>; alias: types.Text<1>; description: types.Text<1> }, "ts_token_type"> { return new runtime.Srf("ts_token_type", [this], [["tokid", types.Int4], ["alias", types.Text], ["description", types.Text]]) as any; } @expose.unchecked() - ['<'] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | number>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Oid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/path.ts b/src/types/postgres/generated/path.ts index 4865caa..0a70560 100644 --- a/src/types/postgres/generated/path.ts +++ b/src/types/postgres/generated/path.ts @@ -18,57 +18,57 @@ export class Path extends Anynonarray { static __typnameText = "path"; declare deserialize: (raw: string) => string; @expose.unchecked() - area(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("area", [this, ...__rest], __rt) as any; } + area(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("area", [this, ...__rest], __rt) as any; } @expose.unchecked() - isclosed(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("isclosed", [this, ...__rest], __rt) as any; } + isclosed(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("isclosed", [this, ...__rest], __rt) as any; } @expose.unchecked() - isopen(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("isopen", [this, ...__rest], __rt) as any; } + isopen(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("isopen", [this, ...__rest], __rt) as any; } @expose.unchecked() - length(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("length", [this, ...__rest], __rt) as any; } + length(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("length", [this, ...__rest], __rt) as any; } @expose.unchecked() - npoints(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("npoints", [this, ...__rest], __rt) as any; } + npoints(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("npoints", [this, ...__rest], __rt) as any; } @expose.unchecked() - pathDistance | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("path_distance", [this, ...__rest], __rt) as any; } + pathDistance | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("path_distance", [this, ...__rest], __rt) as any; } @expose.unchecked() - pathInter | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("path_inter", [this, ...__rest], __rt) as any; } + pathInter | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("path_inter", [this, ...__rest], __rt) as any; } @expose.unchecked() - pathLength(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.PgFunc("path_length", [this, ...__rest], __rt) as any; } + pathLength(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("path_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - pathNpoints(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("path_npoints", [this, ...__rest], __rt) as any; } + pathNpoints(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("path_npoints", [this, ...__rest], __rt) as any; } @expose.unchecked() - pathSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("path_send", [this, ...__rest], __rt) as any; } + pathSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("path_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - pclose(): types.Path { const [__rt, ...__rest] = runtime.match([], [[[], types.Path]]); return runtime.PgFunc("pclose", [this, ...__rest], __rt) as any; } + pclose(): types.Path { const [__rt, ...__rest] = runtime.match([], [[[], types.Path]]); return runtime.funcCall("pclose", [this, ...__rest], __rt) as any; } @expose.unchecked() - polygon(): types.Polygon { const [__rt, ...__rest] = runtime.match([], [[[], types.Polygon]]); return runtime.PgFunc("polygon", [this, ...__rest], __rt) as any; } + polygon(): types.Polygon { const [__rt, ...__rest] = runtime.match([], [[[], types.Polygon]]); return runtime.funcCall("polygon", [this, ...__rest], __rt) as any; } @expose.unchecked() - popen(): types.Path { const [__rt, ...__rest] = runtime.match([], [[[], types.Path]]); return runtime.PgFunc("popen", [this, ...__rest], __rt) as any; } + popen(): types.Path { const [__rt, ...__rest] = runtime.match([], [[[], types.Path]]); return runtime.funcCall("popen", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['+'] | string>(arg0: M0): types.Path>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Path]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'] | string>(arg0: M0): types.Path>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Path]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - plus | string>(arg0: M0): types.Path>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Path]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus | string>(arg0: M0): types.Path>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Path]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<->'] | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Float8]]); return runtime.PgOp(runtime.sql`<->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<->'] | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Float8]]); return runtime.opCall(runtime.sql`<->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['?#'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`?#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['?#'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Path, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`?#`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/pg_lsn.ts b/src/types/postgres/generated/pg_lsn.ts index 499a3ae..51a6aea 100644 --- a/src/types/postgres/generated/pg_lsn.ts +++ b/src/types/postgres/generated/pg_lsn.ts @@ -18,55 +18,55 @@ export class PgLsn extends Anynonarray { static __typnameText = "pg_lsn"; declare deserialize: (raw: string) => string; @expose.unchecked() - pgLsnLarger | string>(arg0: M0): types.PgLsn>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.PgLsn]]); return runtime.PgFunc("pg_lsn_larger", [this, ...__rest], __rt) as any; } + pgLsnLarger | string>(arg0: M0): types.PgLsn>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.PgLsn]]); return runtime.funcCall("pg_lsn_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgLsnSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("pg_lsn_send", [this, ...__rest], __rt) as any; } + pgLsnSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("pg_lsn_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgLsnSmaller | string>(arg0: M0): types.PgLsn>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.PgLsn]]); return runtime.PgFunc("pg_lsn_smaller", [this, ...__rest], __rt) as any; } + pgLsnSmaller | string>(arg0: M0): types.PgLsn>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.PgLsn]]); return runtime.funcCall("pg_lsn_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgWalLsnDiff | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Numeric]]); return runtime.PgFunc("pg_wal_lsn_diff", [this, ...__rest], __rt) as any; } + pgWalLsnDiff | string>(arg0: M0): types.Numeric>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Numeric]]); return runtime.funcCall("pg_wal_lsn_diff", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgWalfileName(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("pg_walfile_name", [this, ...__rest], __rt) as any; } + pgWalfileName(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("pg_walfile_name", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgWalfileNameOffset(): types.Record { const [__rt, ...__rest] = runtime.match([], [[[], types.Record]]); return runtime.PgFunc("pg_walfile_name_offset", [this, ...__rest], __rt) as any; } + pgWalfileNameOffset(): types.Record { const [__rt, ...__rest] = runtime.match([], [[[], types.Record]]); return runtime.funcCall("pg_walfile_name_offset", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.PgLsn<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.PgLsn]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.PgLsn<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.PgLsn]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.PgLsn<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.PgLsn]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.PgLsn<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.PgLsn]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['+'] | string>(arg0: M0): types.PgLsn>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.PgLsn]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'] | string>(arg0: M0): types.PgLsn>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.PgLsn]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - plus | string>(arg0: M0): types.PgLsn>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.PgLsn]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus | string>(arg0: M0): types.PgLsn>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric, allowPrimitive: true }], types.PgLsn]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-']>(arg0: M0): types.PgLsn>>; ['-'] | string>(arg0: M0): types.Numeric>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric }], types.PgLsn], [[{ type: types.PgLsn, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric }], types.PgLsn], [[{ type: types.PgLsn, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus>(arg0: M0): types.PgLsn>>; minus | string>(arg0: M0): types.Numeric>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric }], types.PgLsn], [[{ type: types.PgLsn, allowPrimitive: true }], types.Numeric]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Numeric }], types.PgLsn], [[{ type: types.PgLsn, allowPrimitive: true }], types.Numeric]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgLsn, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/pg_snapshot.ts b/src/types/postgres/generated/pg_snapshot.ts index fc71015..6d97929 100644 --- a/src/types/postgres/generated/pg_snapshot.ts +++ b/src/types/postgres/generated/pg_snapshot.ts @@ -18,11 +18,11 @@ export class PgSnapshot extends Anynonarray { static __typnameText = "pg_snapshot"; declare deserialize: (raw: string) => string; @expose.unchecked() - pgSnapshotSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("pg_snapshot_send", [this, ...__rest], __rt) as any; } + pgSnapshotSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("pg_snapshot_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgSnapshotXmax(): types.Xid8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return runtime.PgFunc("pg_snapshot_xmax", [this, ...__rest], __rt) as any; } + pgSnapshotXmax(): types.Xid8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return runtime.funcCall("pg_snapshot_xmax", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgSnapshotXmin(): types.Xid8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return runtime.PgFunc("pg_snapshot_xmin", [this, ...__rest], __rt) as any; } + pgSnapshotXmin(): types.Xid8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return runtime.funcCall("pg_snapshot_xmin", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgSnapshotXip(): runtime.PgSrf<{ pg_snapshot_xip: types.Xid8 }, "pg_snapshot_xip"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return new runtime.PgSrf("pg_snapshot_xip", [this, ...__rest], [["pg_snapshot_xip", __rt]]) as any; } + pgSnapshotXip(): runtime.Srf<{ pg_snapshot_xip: types.Xid8 }, "pg_snapshot_xip"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return new runtime.Srf("pg_snapshot_xip", [this, ...__rest], [["pg_snapshot_xip", __rt]]) as any; } } diff --git a/src/types/postgres/generated/polygon.ts b/src/types/postgres/generated/polygon.ts index 754c2a3..7b59fd3 100644 --- a/src/types/postgres/generated/polygon.ts +++ b/src/types/postgres/generated/polygon.ts @@ -18,69 +18,69 @@ export class Polygon extends Anynonarray { static __typnameText = "polygon"; declare deserialize: (raw: string) => string; @expose.unchecked() - circle(): types.Circle { const [__rt, ...__rest] = runtime.match([], [[[], types.Circle]]); return runtime.PgFunc("circle", [this, ...__rest], __rt) as any; } + circle(): types.Circle { const [__rt, ...__rest] = runtime.match([], [[[], types.Circle]]); return runtime.funcCall("circle", [this, ...__rest], __rt) as any; } @expose.unchecked() - distPolyc | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("dist_polyc", [this, ...__rest], __rt) as any; } + distPolyc | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("dist_polyc", [this, ...__rest], __rt) as any; } @expose.unchecked() - npoints(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("npoints", [this, ...__rest], __rt) as any; } + npoints(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("npoints", [this, ...__rest], __rt) as any; } @expose.unchecked() - path(): types.Path { const [__rt, ...__rest] = runtime.match([], [[[], types.Path]]); return runtime.PgFunc("path", [this, ...__rest], __rt) as any; } + path(): types.Path { const [__rt, ...__rest] = runtime.match([], [[[], types.Path]]); return runtime.funcCall("path", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyAbove | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_above", [this, ...__rest], __rt) as any; } + polyAbove | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_above", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyBelow | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_below", [this, ...__rest], __rt) as any; } + polyBelow | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_below", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyContain | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_contain", [this, ...__rest], __rt) as any; } + polyContain | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_contain", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyContained | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_contained", [this, ...__rest], __rt) as any; } + polyContained | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_contained", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyDistance | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("poly_distance", [this, ...__rest], __rt) as any; } + polyDistance | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("poly_distance", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyLeft | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_left", [this, ...__rest], __rt) as any; } + polyLeft | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_left", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyNpoints(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("poly_npoints", [this, ...__rest], __rt) as any; } + polyNpoints(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("poly_npoints", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyOverabove | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_overabove", [this, ...__rest], __rt) as any; } + polyOverabove | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_overabove", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyOverbelow | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_overbelow", [this, ...__rest], __rt) as any; } + polyOverbelow | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_overbelow", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyOverlap | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_overlap", [this, ...__rest], __rt) as any; } + polyOverlap | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_overlap", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyOverleft | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_overleft", [this, ...__rest], __rt) as any; } + polyOverleft | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_overleft", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyOverright | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_overright", [this, ...__rest], __rt) as any; } + polyOverright | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_overright", [this, ...__rest], __rt) as any; } @expose.unchecked() - polyRight | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_right", [this, ...__rest], __rt) as any; } + polyRight | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_right", [this, ...__rest], __rt) as any; } @expose.unchecked() - polySame | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("poly_same", [this, ...__rest], __rt) as any; } + polySame | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("poly_same", [this, ...__rest], __rt) as any; } @expose.unchecked() - polySend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("poly_send", [this, ...__rest], __rt) as any; } + polySend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("poly_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['&&'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&&'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&<|'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&<|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&<|'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&<|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['&>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<->']>(arg0: M0): types.Float8>>; ['<->'] | string>(arg0: M0): types.Float8>>; @expose.unchecked() - ['<->'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle }], types.Float8], [[{ type: types.Polygon, allowPrimitive: true }], types.Float8]]); return runtime.PgOp(runtime.sql`<->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<->'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Circle }], types.Float8], [[{ type: types.Polygon, allowPrimitive: true }], types.Float8]]); return runtime.opCall(runtime.sql`<->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<<|'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<<|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<<|'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<<|`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|&>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`|&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|&>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`|&>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['|>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`|>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['|>>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`|>>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Polygon, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/record.ts b/src/types/postgres/generated/record.ts index 62a1151..9d902aa 100644 --- a/src/types/postgres/generated/record.ts +++ b/src/types/postgres/generated/record.ts @@ -17,51 +17,51 @@ export class Record extends Anynonarray { static __typname = runtime.sql`record`; static __typnameText = "record"; @expose.unchecked() - recordImageEq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("record_image_eq", [this, ...__rest], __rt) as any; } + recordImageEq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("record_image_eq", [this, ...__rest], __rt) as any; } @expose.unchecked() - recordImageGe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("record_image_ge", [this, ...__rest], __rt) as any; } + recordImageGe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("record_image_ge", [this, ...__rest], __rt) as any; } @expose.unchecked() - recordImageGt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("record_image_gt", [this, ...__rest], __rt) as any; } + recordImageGt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("record_image_gt", [this, ...__rest], __rt) as any; } @expose.unchecked() - recordImageLe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("record_image_le", [this, ...__rest], __rt) as any; } + recordImageLe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("record_image_le", [this, ...__rest], __rt) as any; } @expose.unchecked() - recordImageLt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("record_image_lt", [this, ...__rest], __rt) as any; } + recordImageLt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("record_image_lt", [this, ...__rest], __rt) as any; } @expose.unchecked() - recordImageNe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("record_image_ne", [this, ...__rest], __rt) as any; } + recordImageNe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("record_image_ne", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['*<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`*<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`*<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['*<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`*<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`*<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['*<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`*<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`*<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['*='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`*=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`*=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['*>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`*>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`*>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['*>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`*>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['*>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`*>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Record, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/regclass.ts b/src/types/postgres/generated/regclass.ts index 38e31ea..bf14c6d 100644 --- a/src/types/postgres/generated/regclass.ts +++ b/src/types/postgres/generated/regclass.ts @@ -18,7 +18,7 @@ export class Regclass extends Anynonarray { static __typnameText = "regclass"; declare deserialize: (raw: string) => string; @expose.unchecked() - pgPartitionRoot(): types.Regclass { const [__rt, ...__rest] = runtime.match([], [[[], types.Regclass]]); return runtime.PgFunc("pg_partition_root", [this, ...__rest], __rt) as any; } + pgPartitionRoot(): types.Regclass { const [__rt, ...__rest] = runtime.match([], [[[], types.Regclass]]); return runtime.funcCall("pg_partition_root", [this, ...__rest], __rt) as any; } @expose.unchecked() - regclasssend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regclasssend", [this, ...__rest], __rt) as any; } + regclasssend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regclasssend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regcollation.ts b/src/types/postgres/generated/regcollation.ts index 6f9e11e..e9ddb9e 100644 --- a/src/types/postgres/generated/regcollation.ts +++ b/src/types/postgres/generated/regcollation.ts @@ -18,5 +18,5 @@ export class Regcollation extends Anynonarray { static __typnameText = "regcollation"; declare deserialize: (raw: string) => string; @expose.unchecked() - regcollationsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regcollationsend", [this, ...__rest], __rt) as any; } + regcollationsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regcollationsend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regconfig.ts b/src/types/postgres/generated/regconfig.ts index 6e5a948..8151d18 100644 --- a/src/types/postgres/generated/regconfig.ts +++ b/src/types/postgres/generated/regconfig.ts @@ -18,22 +18,22 @@ export class Regconfig extends Anynonarray { static __typnameText = "regconfig"; declare deserialize: (raw: string) => string; @expose.unchecked() - jsonToTsvector | string, M1 extends types.Jsonb | string>(arg0: M0, arg1: M1): types.Tsvector | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Json, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }], types.Tsvector]]); return runtime.PgFunc("json_to_tsvector", [this, ...__rest], __rt) as any; } + jsonToTsvector | string, M1 extends types.Jsonb | string>(arg0: M0, arg1: M1): types.Tsvector | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Json, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }], types.Tsvector]]); return runtime.funcCall("json_to_tsvector", [this, ...__rest], __rt) as any; } @expose.unchecked() - jsonbToTsvector | string, M1 extends types.Jsonb | string>(arg0: M0, arg1: M1): types.Tsvector | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Jsonb, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }], types.Tsvector]]); return runtime.PgFunc("jsonb_to_tsvector", [this, ...__rest], __rt) as any; } + jsonbToTsvector | string, M1 extends types.Jsonb | string>(arg0: M0, arg1: M1): types.Tsvector | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Jsonb, allowPrimitive: true }, { type: types.Jsonb, allowPrimitive: true }], types.Tsvector]]); return runtime.funcCall("jsonb_to_tsvector", [this, ...__rest], __rt) as any; } @expose.unchecked() - phrasetoTsquery | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsquery]]); return runtime.PgFunc("phraseto_tsquery", [this, ...__rest], __rt) as any; } + phrasetoTsquery | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsquery]]); return runtime.funcCall("phraseto_tsquery", [this, ...__rest], __rt) as any; } @expose.unchecked() - plaintoTsquery | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsquery]]); return runtime.PgFunc("plainto_tsquery", [this, ...__rest], __rt) as any; } + plaintoTsquery | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsquery]]); return runtime.funcCall("plainto_tsquery", [this, ...__rest], __rt) as any; } @expose.unchecked() - regconfigsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regconfigsend", [this, ...__rest], __rt) as any; } + regconfigsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regconfigsend", [this, ...__rest], __rt) as any; } @expose.unchecked() - toTsquery | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsquery]]); return runtime.PgFunc("to_tsquery", [this, ...__rest], __rt) as any; } + toTsquery | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsquery]]); return runtime.funcCall("to_tsquery", [this, ...__rest], __rt) as any; } toTsvector>(arg0: M0): types.Tsvector>>; toTsvector>(arg0: M0): types.Tsvector>>; toTsvector>(arg0: M0): types.Tsvector>>; @expose.unchecked() - toTsvector(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text }], types.Tsvector], [[{ type: types.Jsonb }], types.Tsvector], [[{ type: types.Json }], types.Tsvector]]); return runtime.PgFunc("to_tsvector", [this, ...__rest], __rt) as any; } + toTsvector(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text }], types.Tsvector], [[{ type: types.Jsonb }], types.Tsvector], [[{ type: types.Json }], types.Tsvector]]); return runtime.funcCall("to_tsvector", [this, ...__rest], __rt) as any; } tsHeadline, M1 extends types.Tsquery>(arg0: M0, arg1: M1): types.Json | runtime.NullOf>>; tsHeadline, M1 extends types.Tsquery, M2 extends types.Text>(arg0: M0, arg1: M1, arg2: M2): types.Text | runtime.NullOf | runtime.NullOf>>; tsHeadline, M1 extends types.Tsquery>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; @@ -41,7 +41,7 @@ export class Regconfig extends Anynonarray { tsHeadline, M1 extends types.Tsquery>(arg0: M0, arg1: M1): types.Jsonb | runtime.NullOf>>; tsHeadline, M1 extends types.Tsquery, M2 extends types.Text>(arg0: M0, arg1: M1, arg2: M2): types.Jsonb | runtime.NullOf | runtime.NullOf>>; @expose.unchecked() - tsHeadline(arg0: unknown, arg1: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Json }, { type: types.Tsquery }], types.Json], [[{ type: types.Text }, { type: types.Tsquery }, { type: types.Text }], types.Text], [[{ type: types.Text }, { type: types.Tsquery }], types.Text], [[{ type: types.Json }, { type: types.Tsquery }, { type: types.Text }], types.Json], [[{ type: types.Jsonb }, { type: types.Tsquery }], types.Jsonb], [[{ type: types.Jsonb }, { type: types.Tsquery }, { type: types.Text }], types.Jsonb]]); return runtime.PgFunc("ts_headline", [this, ...__rest], __rt) as any; } + tsHeadline(arg0: unknown, arg1: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Json }, { type: types.Tsquery }], types.Json], [[{ type: types.Text }, { type: types.Tsquery }, { type: types.Text }], types.Text], [[{ type: types.Text }, { type: types.Tsquery }], types.Text], [[{ type: types.Json }, { type: types.Tsquery }, { type: types.Text }], types.Json], [[{ type: types.Jsonb }, { type: types.Tsquery }], types.Jsonb], [[{ type: types.Jsonb }, { type: types.Tsquery }, { type: types.Text }], types.Jsonb]]); return runtime.funcCall("ts_headline", [this, ...__rest], __rt) as any; } @expose.unchecked() - websearchToTsquery | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsquery]]); return runtime.PgFunc("websearch_to_tsquery", [this, ...__rest], __rt) as any; } + websearchToTsquery | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsquery]]); return runtime.funcCall("websearch_to_tsquery", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regdictionary.ts b/src/types/postgres/generated/regdictionary.ts index 65c78ea..2cec60c 100644 --- a/src/types/postgres/generated/regdictionary.ts +++ b/src/types/postgres/generated/regdictionary.ts @@ -18,5 +18,5 @@ export class Regdictionary extends Anynonarray { static __typnameText = "regdictionary"; declare deserialize: (raw: string) => string; @expose.unchecked() - regdictionarysend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regdictionarysend", [this, ...__rest], __rt) as any; } + regdictionarysend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regdictionarysend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regnamespace.ts b/src/types/postgres/generated/regnamespace.ts index f72cd5e..335a575 100644 --- a/src/types/postgres/generated/regnamespace.ts +++ b/src/types/postgres/generated/regnamespace.ts @@ -18,5 +18,5 @@ export class Regnamespace extends Anynonarray { static __typnameText = "regnamespace"; declare deserialize: (raw: string) => string; @expose.unchecked() - regnamespacesend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regnamespacesend", [this, ...__rest], __rt) as any; } + regnamespacesend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regnamespacesend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regoper.ts b/src/types/postgres/generated/regoper.ts index b1cf05b..38db9f1 100644 --- a/src/types/postgres/generated/regoper.ts +++ b/src/types/postgres/generated/regoper.ts @@ -18,5 +18,5 @@ export class Regoper extends Anynonarray { static __typnameText = "regoper"; declare deserialize: (raw: string) => string; @expose.unchecked() - regopersend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regopersend", [this, ...__rest], __rt) as any; } + regopersend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regopersend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regoperator.ts b/src/types/postgres/generated/regoperator.ts index 74224e7..b03ec32 100644 --- a/src/types/postgres/generated/regoperator.ts +++ b/src/types/postgres/generated/regoperator.ts @@ -18,5 +18,5 @@ export class Regoperator extends Anynonarray { static __typnameText = "regoperator"; declare deserialize: (raw: string) => string; @expose.unchecked() - regoperatorsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regoperatorsend", [this, ...__rest], __rt) as any; } + regoperatorsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regoperatorsend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regproc.ts b/src/types/postgres/generated/regproc.ts index 2b65d2b..7b5d275 100644 --- a/src/types/postgres/generated/regproc.ts +++ b/src/types/postgres/generated/regproc.ts @@ -18,5 +18,5 @@ export class Regproc extends Anynonarray { static __typnameText = "regproc"; declare deserialize: (raw: string) => string; @expose.unchecked() - regprocsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regprocsend", [this, ...__rest], __rt) as any; } + regprocsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regprocsend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regprocedure.ts b/src/types/postgres/generated/regprocedure.ts index fff11ef..c3ba15a 100644 --- a/src/types/postgres/generated/regprocedure.ts +++ b/src/types/postgres/generated/regprocedure.ts @@ -18,5 +18,5 @@ export class Regprocedure extends Anynonarray { static __typnameText = "regprocedure"; declare deserialize: (raw: string) => string; @expose.unchecked() - regproceduresend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regproceduresend", [this, ...__rest], __rt) as any; } + regproceduresend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regproceduresend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regrole.ts b/src/types/postgres/generated/regrole.ts index 3ee5c29..00a6a56 100644 --- a/src/types/postgres/generated/regrole.ts +++ b/src/types/postgres/generated/regrole.ts @@ -18,5 +18,5 @@ export class Regrole extends Anynonarray { static __typnameText = "regrole"; declare deserialize: (raw: string) => string; @expose.unchecked() - regrolesend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regrolesend", [this, ...__rest], __rt) as any; } + regrolesend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regrolesend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/regtype.ts b/src/types/postgres/generated/regtype.ts index fca7d80..f82c0a8 100644 --- a/src/types/postgres/generated/regtype.ts +++ b/src/types/postgres/generated/regtype.ts @@ -18,5 +18,5 @@ export class Regtype extends Anynonarray { static __typnameText = "regtype"; declare deserialize: (raw: string) => string; @expose.unchecked() - regtypesend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("regtypesend", [this, ...__rest], __rt) as any; } + regtypesend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("regtypesend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/text.ts b/src/types/postgres/generated/text.ts index 69faa5c..654f890 100644 --- a/src/types/postgres/generated/text.ts +++ b/src/types/postgres/generated/text.ts @@ -18,89 +18,89 @@ export class Text extends Anynonarray { static __typnameText = "text"; declare deserialize: (raw: string) => string; @expose.unchecked() - ascii(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("ascii", [this, ...__rest], __rt) as any; } + ascii(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("ascii", [this, ...__rest], __rt) as any; } @expose.unchecked() - bitLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("bit_length", [this, ...__rest], __rt) as any; } + bitLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("bit_length", [this, ...__rest], __rt) as any; } btrim(): types.Text; btrim | string>(arg0: M0): types.Text>>; @expose.unchecked() - btrim(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("btrim", [this, ...__rest], __rt) as any; } + btrim(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("btrim", [this, ...__rest], __rt) as any; } @expose.unchecked() - char(): types.Char { const [__rt, ...__rest] = runtime.match([], [[[], types.Char]]); return runtime.PgFunc("char", [this, ...__rest], __rt) as any; } + char(): types.Char { const [__rt, ...__rest] = runtime.match([], [[[], types.Char]]); return runtime.funcCall("char", [this, ...__rest], __rt) as any; } @expose.unchecked() - charLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("char_length", [this, ...__rest], __rt) as any; } + charLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("char_length", [this, ...__rest], __rt) as any; } @expose.unchecked() - characterLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("character_length", [this, ...__rest], __rt) as any; } + characterLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("character_length", [this, ...__rest], __rt) as any; } datePart>(arg0: M0): types.Float8>>; datePart>(arg0: M0): types.Float8>>; datePart>(arg0: M0): types.Float8>>; datePart>(arg0: M0): types.Float8>>; datePart>(arg0: M0): types.Float8>>; @expose.unchecked() - datePart(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Float8], [[{ type: types.Date }], types.Float8], [[{ type: types.Time }], types.Float8], [[{ type: types.Timetz }], types.Float8], [[{ type: types.Interval }], types.Float8]]); return runtime.PgFunc("date_part", [this, ...__rest], __rt) as any; } + datePart(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Float8], [[{ type: types.Date }], types.Float8], [[{ type: types.Time }], types.Float8], [[{ type: types.Timetz }], types.Float8], [[{ type: types.Interval }], types.Float8]]); return runtime.funcCall("date_part", [this, ...__rest], __rt) as any; } dateTrunc>(arg0: M0): types.Interval>>; dateTrunc | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Timestamptz | runtime.NullOf>>; dateTrunc>(arg0: M0): types.Timestamp>>; @expose.unchecked() - dateTrunc(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Interval }], types.Interval], [[{ type: types.Timestamptz, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Timestamptz], [[{ type: types.Timestamp }], types.Timestamp]]); return runtime.PgFunc("date_trunc", [this, ...__rest], __rt) as any; } + dateTrunc(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Interval }], types.Interval], [[{ type: types.Timestamptz, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Timestamptz], [[{ type: types.Timestamp }], types.Timestamp]]); return runtime.funcCall("date_trunc", [this, ...__rest], __rt) as any; } @expose.unchecked() - decode | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bytea]]); return runtime.PgFunc("decode", [this, ...__rest], __rt) as any; } + decode | string>(arg0: M0): types.Bytea>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bytea]]); return runtime.funcCall("decode", [this, ...__rest], __rt) as any; } extract>(arg0: M0): types.Numeric>>; extract>(arg0: M0): types.Numeric>>; extract>(arg0: M0): types.Numeric>>; extract>(arg0: M0): types.Numeric>>; extract>(arg0: M0): types.Numeric>>; @expose.unchecked() - extract(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Numeric], [[{ type: types.Timestamp }], types.Numeric], [[{ type: types.Timetz }], types.Numeric], [[{ type: types.Time }], types.Numeric], [[{ type: types.Date }], types.Numeric]]); return runtime.PgFunc("extract", [this, ...__rest], __rt) as any; } + extract(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Numeric], [[{ type: types.Timestamp }], types.Numeric], [[{ type: types.Timetz }], types.Numeric], [[{ type: types.Time }], types.Numeric], [[{ type: types.Date }], types.Numeric]]); return runtime.funcCall("extract", [this, ...__rest], __rt) as any; } @expose.unchecked() - initcap(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("initcap", [this, ...__rest], __rt) as any; } + initcap(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("initcap", [this, ...__rest], __rt) as any; } @expose.unchecked() - isNormalized | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("is_normalized", [this, ...__rest], __rt) as any; } + isNormalized | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("is_normalized", [this, ...__rest], __rt) as any; } @expose.unchecked() - left | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("left", [this, ...__rest], __rt) as any; } + left | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("left", [this, ...__rest], __rt) as any; } @expose.unchecked() - length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("length", [this, ...__rest], __rt) as any; } + length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("length", [this, ...__rest], __rt) as any; } @expose.unchecked() - like | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("like", [this, ...__rest], __rt) as any; } + like | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("like", [this, ...__rest], __rt) as any; } @expose.unchecked() - likeEscape | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("like_escape", [this, ...__rest], __rt) as any; } + likeEscape | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("like_escape", [this, ...__rest], __rt) as any; } @expose.unchecked() - lower(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("lower", [this, ...__rest], __rt) as any; } + lower(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("lower", [this, ...__rest], __rt) as any; } lpad | number>(arg0: M0): types.Text>>; lpad | number, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; @expose.unchecked() - lpad(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("lpad", [this, ...__rest], __rt) as any; } + lpad(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("lpad", [this, ...__rest], __rt) as any; } ltrim | string>(arg0: M0): types.Text>>; ltrim(): types.Text; @expose.unchecked() - ltrim(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[], types.Text]]); return runtime.PgFunc("ltrim", [this, ...__rest], __rt) as any; } + ltrim(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[], types.Text]]); return runtime.funcCall("ltrim", [this, ...__rest], __rt) as any; } @expose.unchecked() - md5(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("md5", [this, ...__rest], __rt) as any; } + md5(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("md5", [this, ...__rest], __rt) as any; } @expose.unchecked() - normalize | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("normalize", [this, ...__rest], __rt) as any; } + normalize | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("normalize", [this, ...__rest], __rt) as any; } @expose.unchecked() - notlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("notlike", [this, ...__rest], __rt) as any; } + notlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("notlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - octetLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("octet_length", [this, ...__rest], __rt) as any; } + octetLength(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("octet_length", [this, ...__rest], __rt) as any; } overlay | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; overlay | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Text | runtime.NullOf | runtime.NullOf>>; @expose.unchecked() - overlay(arg0: unknown, arg1: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("overlay", [this, ...__rest], __rt) as any; } + overlay(arg0: unknown, arg1: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("overlay", [this, ...__rest], __rt) as any; } @expose.unchecked() - pgSizeBytes(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("pg_size_bytes", [this, ...__rest], __rt) as any; } + pgSizeBytes(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("pg_size_bytes", [this, ...__rest], __rt) as any; } @expose.unchecked() - position | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("position", [this, ...__rest], __rt) as any; } + position | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("position", [this, ...__rest], __rt) as any; } @expose.unchecked() - quoteIdent(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("quote_ident", [this, ...__rest], __rt) as any; } + quoteIdent(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("quote_ident", [this, ...__rest], __rt) as any; } @expose.unchecked() - quoteLiteral(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("quote_literal", [this, ...__rest], __rt) as any; } + quoteLiteral(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("quote_literal", [this, ...__rest], __rt) as any; } @expose.unchecked() - quoteNullable(): types.Text<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("quote_nullable", [this, ...__rest], __rt) as any; } + quoteNullable(): types.Text<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("quote_nullable", [this, ...__rest], __rt) as any; } regexpCount | string>(arg0: M0): types.Int4>>; regexpCount | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Int4 | runtime.NullOf>>; regexpCount | string, M1 extends types.Int4 | number, M2 extends types.Text | string>(arg0: M0, arg1: M1, arg2: M2): types.Int4 | runtime.NullOf | runtime.NullOf>>; @expose.unchecked() - regexpCount(arg0: unknown, arg1?: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Text, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("regexp_count", [this, ...__rest], __rt) as any; } + regexpCount(arg0: unknown, arg1?: unknown, arg2?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Text, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("regexp_count", [this, ...__rest], __rt) as any; } regexpInstr | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Int4 | runtime.NullOf | runtime.NullOf>>; regexpInstr | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number, M3 extends types.Int4 | number, M4 extends types.Text | string, M5 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2, arg3: M3, arg4: M4, arg5: M5): types.Int4 | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf>>; regexpInstr | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number, M3 extends types.Int4 | number, M4 extends types.Text | string>(arg0: M0, arg1: M1, arg2: M2, arg3: M3, arg4: M4): types.Int4 | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf>>; @@ -108,193 +108,193 @@ export class Text extends Anynonarray { regexpInstr | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Int4 | runtime.NullOf>>; regexpInstr | string>(arg0: M0): types.Int4>>; @expose.unchecked() - regexpInstr(arg0: unknown, arg1?: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown, arg5?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4, arg5], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("regexp_instr", [this, ...__rest], __rt) as any; } + regexpInstr(arg0: unknown, arg1?: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown, arg5?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4, arg5], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Int4], [[{ type: types.Text, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("regexp_instr", [this, ...__rest], __rt) as any; } regexpLike | string>(arg0: M0): types.Bool>>; regexpLike | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Bool | runtime.NullOf>>; @expose.unchecked() - regexpLike(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }], types.Bool], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("regexp_like", [this, ...__rest], __rt) as any; } + regexpLike(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }], types.Bool], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("regexp_like", [this, ...__rest], __rt) as any; } regexpReplace | string, M1 extends types.Text | string, M2 extends types.Int4 | number, M3 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2, arg3: M3): types.Text | runtime.NullOf | runtime.NullOf | runtime.NullOf>>; regexpReplace | string, M1 extends types.Text | string, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Text | runtime.NullOf | runtime.NullOf>>; regexpReplace | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; regexpReplace | string, M1 extends types.Text | string, M2 extends types.Text | string>(arg0: M0, arg1: M1, arg2: M2): types.Text | runtime.NullOf | runtime.NullOf>>; regexpReplace | string, M1 extends types.Text | string, M2 extends types.Int4 | number, M3 extends types.Int4 | number, M4 extends types.Text | string>(arg0: M0, arg1: M1, arg2: M2, arg3: M3, arg4: M4): types.Text | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf>>; @expose.unchecked() - regexpReplace(arg0: unknown, arg1: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("regexp_replace", [this, ...__rest], __rt) as any; } + regexpReplace(arg0: unknown, arg1: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("regexp_replace", [this, ...__rest], __rt) as any; } regexpSubstr | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number, M3 extends types.Text | string, M4 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2, arg3: M3, arg4: M4): types.Text | runtime.NullOf | runtime.NullOf | runtime.NullOf | runtime.NullOf>>; regexpSubstr | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number>(arg0: M0, arg1: M1, arg2: M2): types.Text | runtime.NullOf | runtime.NullOf>>; regexpSubstr | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; regexpSubstr | string, M1 extends types.Int4 | number, M2 extends types.Int4 | number, M3 extends types.Text | string>(arg0: M0, arg1: M1, arg2: M2, arg3: M3): types.Text | runtime.NullOf | runtime.NullOf | runtime.NullOf>>; regexpSubstr | string>(arg0: M0): types.Text>>; @expose.unchecked() - regexpSubstr(arg0: unknown, arg1?: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("regexp_substr", [this, ...__rest], __rt) as any; } + regexpSubstr(arg0: unknown, arg1?: unknown, arg2?: unknown, arg3?: unknown, arg4?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2, arg3, arg4], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("regexp_substr", [this, ...__rest], __rt) as any; } @expose.unchecked() - repeat | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("repeat", [this, ...__rest], __rt) as any; } + repeat | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("repeat", [this, ...__rest], __rt) as any; } @expose.unchecked() - replace | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("replace", [this, ...__rest], __rt) as any; } + replace | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("replace", [this, ...__rest], __rt) as any; } @expose.unchecked() - reverse(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("reverse", [this, ...__rest], __rt) as any; } + reverse(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("reverse", [this, ...__rest], __rt) as any; } @expose.unchecked() - right | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("right", [this, ...__rest], __rt) as any; } + right | number>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("right", [this, ...__rest], __rt) as any; } rpad | number>(arg0: M0): types.Text>>; rpad | number, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; @expose.unchecked() - rpad(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("rpad", [this, ...__rest], __rt) as any; } + rpad(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("rpad", [this, ...__rest], __rt) as any; } rtrim | string>(arg0: M0): types.Text>>; rtrim(): types.Text; @expose.unchecked() - rtrim(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[], types.Text]]); return runtime.PgFunc("rtrim", [this, ...__rest], __rt) as any; } + rtrim(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[], types.Text]]); return runtime.funcCall("rtrim", [this, ...__rest], __rt) as any; } @expose.unchecked() - similarEscape | string>(arg0: M0): types.Text<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("similar_escape", [this, ...__rest], __rt) as any; } + similarEscape | string>(arg0: M0): types.Text<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("similar_escape", [this, ...__rest], __rt) as any; } similarToEscape | string>(arg0: M0): types.Text>>; similarToEscape(): types.Text; @expose.unchecked() - similarToEscape(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[], types.Text]]); return runtime.PgFunc("similar_to_escape", [this, ...__rest], __rt) as any; } + similarToEscape(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[], types.Text]]); return runtime.funcCall("similar_to_escape", [this, ...__rest], __rt) as any; } @expose.unchecked() - splitPart | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("split_part", [this, ...__rest], __rt) as any; } + splitPart | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("split_part", [this, ...__rest], __rt) as any; } @expose.unchecked() - startsWith | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("starts_with", [this, ...__rest], __rt) as any; } + startsWith | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("starts_with", [this, ...__rest], __rt) as any; } @expose.unchecked() - strpos | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Int4]]); return runtime.PgFunc("strpos", [this, ...__rest], __rt) as any; } + strpos | string>(arg0: M0): types.Int4>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Int4]]); return runtime.funcCall("strpos", [this, ...__rest], __rt) as any; } substr | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; substr | number>(arg0: M0): types.Text>>; @expose.unchecked() - substr(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("substr", [this, ...__rest], __rt) as any; } + substr(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("substr", [this, ...__rest], __rt) as any; } substring | string>(arg0: M0): types.Text>>; substring | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; substring | number, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>>; substring | number>(arg0: M0): types.Text>>; @expose.unchecked() - substring(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("substring", [this, ...__rest], __rt) as any; } + substring(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Text], [[{ type: types.Int4, allowPrimitive: true }], types.Text]]); return runtime.funcCall("substring", [this, ...__rest], __rt) as any; } @expose.unchecked() - textLarger | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("text_larger", [this, ...__rest], __rt) as any; } + textLarger | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("text_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - textPatternGe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("text_pattern_ge", [this, ...__rest], __rt) as any; } + textPatternGe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("text_pattern_ge", [this, ...__rest], __rt) as any; } @expose.unchecked() - textPatternGt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("text_pattern_gt", [this, ...__rest], __rt) as any; } + textPatternGt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("text_pattern_gt", [this, ...__rest], __rt) as any; } @expose.unchecked() - textPatternLe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("text_pattern_le", [this, ...__rest], __rt) as any; } + textPatternLe | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("text_pattern_le", [this, ...__rest], __rt) as any; } @expose.unchecked() - textPatternLt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("text_pattern_lt", [this, ...__rest], __rt) as any; } + textPatternLt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("text_pattern_lt", [this, ...__rest], __rt) as any; } @expose.unchecked() - textSmaller | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("text_smaller", [this, ...__rest], __rt) as any; } + textSmaller | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("text_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - textcat | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("textcat", [this, ...__rest], __rt) as any; } + textcat | string>(arg0: M0): types.Text>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("textcat", [this, ...__rest], __rt) as any; } @expose.unchecked() - texticlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("texticlike", [this, ...__rest], __rt) as any; } + texticlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("texticlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - texticnlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("texticnlike", [this, ...__rest], __rt) as any; } + texticnlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("texticnlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - texticregexeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("texticregexeq", [this, ...__rest], __rt) as any; } + texticregexeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("texticregexeq", [this, ...__rest], __rt) as any; } @expose.unchecked() - texticregexne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("texticregexne", [this, ...__rest], __rt) as any; } + texticregexne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("texticregexne", [this, ...__rest], __rt) as any; } @expose.unchecked() - textlen(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("textlen", [this, ...__rest], __rt) as any; } + textlen(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("textlen", [this, ...__rest], __rt) as any; } @expose.unchecked() - textlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("textlike", [this, ...__rest], __rt) as any; } + textlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("textlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - textnlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("textnlike", [this, ...__rest], __rt) as any; } + textnlike | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("textnlike", [this, ...__rest], __rt) as any; } @expose.unchecked() - textregexeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("textregexeq", [this, ...__rest], __rt) as any; } + textregexeq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("textregexeq", [this, ...__rest], __rt) as any; } @expose.unchecked() - textregexne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("textregexne", [this, ...__rest], __rt) as any; } + textregexne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("textregexne", [this, ...__rest], __rt) as any; } timezone>(arg0: M0): types.Timestamptz>>; timezone>(arg0: M0): types.Timestamp>>; @expose.unchecked() - timezone(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Timestamptz], [[{ type: types.Timestamptz }], types.Timestamp]]); return runtime.PgFunc("timezone", [this, ...__rest], __rt) as any; } + timezone(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Timestamptz], [[{ type: types.Timestamptz }], types.Timestamp]]); return runtime.funcCall("timezone", [this, ...__rest], __rt) as any; } toAscii | number>(arg0: M0): types.Text>>; toAscii(): types.Text; @expose.unchecked() - toAscii(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text], [[], types.Text]]); return runtime.PgFunc("to_ascii", [this, ...__rest], __rt) as any; } + toAscii(arg0?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Text], [[], types.Text]]); return runtime.funcCall("to_ascii", [this, ...__rest], __rt) as any; } @expose.unchecked() - translate | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("translate", [this, ...__rest], __rt) as any; } + translate | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("translate", [this, ...__rest], __rt) as any; } @expose.unchecked() - unicodeAssigned(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("unicode_assigned", [this, ...__rest], __rt) as any; } + unicodeAssigned(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("unicode_assigned", [this, ...__rest], __rt) as any; } @expose.unchecked() - unistr(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("unistr", [this, ...__rest], __rt) as any; } + unistr(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("unistr", [this, ...__rest], __rt) as any; } @expose.unchecked() - upper(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("upper", [this, ...__rest], __rt) as any; } + upper(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("upper", [this, ...__rest], __rt) as any; } @expose.unchecked() - xmlIsWellFormedContent(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("xml_is_well_formed_content", [this, ...__rest], __rt) as any; } + xmlIsWellFormedContent(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("xml_is_well_formed_content", [this, ...__rest], __rt) as any; } @expose.unchecked() - xmlIsWellFormedDocument(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("xml_is_well_formed_document", [this, ...__rest], __rt) as any; } + xmlIsWellFormedDocument(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("xml_is_well_formed_document", [this, ...__rest], __rt) as any; } @expose.unchecked() - xmlcomment(): types.Xml { const [__rt, ...__rest] = runtime.match([], [[[], types.Xml]]); return runtime.PgFunc("xmlcomment", [this, ...__rest], __rt) as any; } + xmlcomment(): types.Xml { const [__rt, ...__rest] = runtime.match([], [[[], types.Xml]]); return runtime.funcCall("xmlcomment", [this, ...__rest], __rt) as any; } @expose.unchecked() - xmlexists | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xml, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("xmlexists", [this, ...__rest], __rt) as any; } + xmlexists | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xml, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("xmlexists", [this, ...__rest], __rt) as any; } @expose.unchecked() - xmltext(): types.Xml { const [__rt, ...__rest] = runtime.match([], [[[], types.Xml]]); return runtime.PgFunc("xmltext", [this, ...__rest], __rt) as any; } + xmltext(): types.Xml { const [__rt, ...__rest] = runtime.match([], [[[], types.Xml]]); return runtime.funcCall("xmltext", [this, ...__rest], __rt) as any; } @expose.unchecked() - xpathExists | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xml, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("xpath_exists", [this, ...__rest], __rt) as any; } + xpathExists | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xml, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("xpath_exists", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Text<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Text<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Text<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Text<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - stringAgg | string>(arg0: M0): types.Text<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgFunc("string_agg", [this, ...__rest], __rt) as any; } - regexpSplitToTable | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): runtime.PgSrf<{ regexp_split_to_table: types.Text | runtime.NullOf>> }, "regexp_split_to_table">; - regexpSplitToTable | string>(arg0: M0): runtime.PgSrf<{ regexp_split_to_table: types.Text>> }, "regexp_split_to_table">; + stringAgg | string>(arg0: M0): types.Text<0 | 1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.funcCall("string_agg", [this, ...__rest], __rt) as any; } + regexpSplitToTable | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): runtime.Srf<{ regexp_split_to_table: types.Text | runtime.NullOf>> }, "regexp_split_to_table">; + regexpSplitToTable | string>(arg0: M0): runtime.Srf<{ regexp_split_to_table: types.Text>> }, "regexp_split_to_table">; @expose.unchecked() - regexpSplitToTable(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return new runtime.PgSrf("regexp_split_to_table", [this, ...__rest], [["regexp_split_to_table", __rt]]) as any; } - stringToTable | string>(arg0: M0): runtime.PgSrf<{ string_to_table: types.Text<1> }, "string_to_table">; - stringToTable | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): runtime.PgSrf<{ string_to_table: types.Text<1> }, "string_to_table">; + regexpSplitToTable(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return new runtime.Srf("regexp_split_to_table", [this, ...__rest], [["regexp_split_to_table", __rt]]) as any; } + stringToTable | string>(arg0: M0): runtime.Srf<{ string_to_table: types.Text<1> }, "string_to_table">; + stringToTable | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): runtime.Srf<{ string_to_table: types.Text<1> }, "string_to_table">; @expose.unchecked() - stringToTable(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return new runtime.PgSrf("string_to_table", [this, ...__rest], [["string_to_table", __rt]]) as any; } + stringToTable(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }], types.Text], [[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); return new runtime.Srf("string_to_table", [this, ...__rest], [["string_to_table", __rt]]) as any; } @expose.unchecked() - ['!~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['!~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['!~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['!~~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`!~~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['!~~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`!~~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['@@']>(arg0: M0): types.Bool>>; ['@@'] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['@@'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery }], types.Bool], [[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@@'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery }], types.Bool], [[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['^@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`^@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['^@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`^@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['||']>(arg0: M0): types.Text>>; ['||'] | string>(arg0: M0): types.Text>>; @expose.unchecked() - ['||'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anynonarray }], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.PgOp(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['||'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Anynonarray }], types.Text], [[{ type: types.Text, allowPrimitive: true }], types.Text]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~<=~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~<=~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~<=~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~<=~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~<~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~<~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~<~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~<~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~>=~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~>=~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~>=~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~>=~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~>~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~>~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~>~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~>~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~~'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~~`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['~~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`~~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['~~*'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`~~*`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/tid.ts b/src/types/postgres/generated/tid.ts index 57ede8d..f1cdb97 100644 --- a/src/types/postgres/generated/tid.ts +++ b/src/types/postgres/generated/tid.ts @@ -18,37 +18,37 @@ export class Tid extends Anynonarray { static __typnameText = "tid"; declare deserialize: (raw: string) => string; @expose.unchecked() - tidlarger | string>(arg0: M0): types.Tid>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Tid]]); return runtime.PgFunc("tidlarger", [this, ...__rest], __rt) as any; } + tidlarger | string>(arg0: M0): types.Tid>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Tid]]); return runtime.funcCall("tidlarger", [this, ...__rest], __rt) as any; } @expose.unchecked() - tidsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("tidsend", [this, ...__rest], __rt) as any; } + tidsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("tidsend", [this, ...__rest], __rt) as any; } @expose.unchecked() - tidsmaller | string>(arg0: M0): types.Tid>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Tid]]); return runtime.PgFunc("tidsmaller", [this, ...__rest], __rt) as any; } + tidsmaller | string>(arg0: M0): types.Tid>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Tid]]); return runtime.funcCall("tidsmaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Tid<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Tid]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Tid<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Tid]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Tid<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Tid]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Tid<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Tid]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/time.ts b/src/types/postgres/generated/time.ts index a58b76e..a94bddf 100644 --- a/src/types/postgres/generated/time.ts +++ b/src/types/postgres/generated/time.ts @@ -18,63 +18,63 @@ export class Time extends Anynonarray { static __typnameText = "time"; declare deserialize: (raw: string) => string; @expose.unchecked() - interval(): types.Interval { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.PgFunc("interval", [this, ...__rest], __rt) as any; } + interval(): types.Interval { const [__rt, ...__rest] = runtime.match([], [[[], types.Interval]]); return runtime.funcCall("interval", [this, ...__rest], __rt) as any; } overlaps, M1 extends types.Time, M2 extends types.Interval>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1>; overlaps | string, M1 extends types.Time | string, M2 extends types.Time | string>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1>; overlaps, M1 extends types.Time, M2 extends types.Interval>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1>; overlaps, M1 extends types.Time, M2 extends types.Time>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1>; @expose.unchecked() - overlaps(arg0: unknown, arg1: unknown, arg2: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Time }, { type: types.Time }, { type: types.Interval }], types.Bool], [[{ type: types.Time, allowPrimitive: true }, { type: types.Time, allowPrimitive: true }, { type: types.Time, allowPrimitive: true }], types.Bool], [[{ type: types.Interval }, { type: types.Time }, { type: types.Interval }], types.Bool], [[{ type: types.Interval }, { type: types.Time }, { type: types.Time }], types.Bool]]); return runtime.PgFunc("overlaps", [this, ...__rest], __rt) as any; } + overlaps(arg0: unknown, arg1: unknown, arg2: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Time }, { type: types.Time }, { type: types.Interval }], types.Bool], [[{ type: types.Time, allowPrimitive: true }, { type: types.Time, allowPrimitive: true }, { type: types.Time, allowPrimitive: true }], types.Bool], [[{ type: types.Interval }, { type: types.Time }, { type: types.Interval }], types.Bool], [[{ type: types.Interval }, { type: types.Time }, { type: types.Time }], types.Bool]]); return runtime.funcCall("overlaps", [this, ...__rest], __rt) as any; } @expose.unchecked() - time | number>(arg0: M0): types.Time>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Time]]); return runtime.PgFunc("time", [this, ...__rest], __rt) as any; } + time | number>(arg0: M0): types.Time>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Time]]); return runtime.funcCall("time", [this, ...__rest], __rt) as any; } @expose.unchecked() - timeLarger | string>(arg0: M0): types.Time>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Time]]); return runtime.PgFunc("time_larger", [this, ...__rest], __rt) as any; } + timeLarger | string>(arg0: M0): types.Time>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Time]]); return runtime.funcCall("time_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - timeSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("time_send", [this, ...__rest], __rt) as any; } + timeSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("time_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - timeSmaller | string>(arg0: M0): types.Time>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Time]]); return runtime.PgFunc("time_smaller", [this, ...__rest], __rt) as any; } + timeSmaller | string>(arg0: M0): types.Time>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Time]]); return runtime.funcCall("time_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Time<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Time<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Time<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Time<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } ['+']>(arg0: M0): types.Time>>; ['+']>(arg0: M0): types.Timestamp>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Time], [[{ type: types.Date }], types.Timestamp]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Time], [[{ type: types.Date }], types.Timestamp]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus>(arg0: M0): types.Time>>; plus>(arg0: M0): types.Timestamp>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Time], [[{ type: types.Date }], types.Timestamp]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Time], [[{ type: types.Date }], types.Timestamp]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-'] | string>(arg0: M0): types.Interval>>; ['-']>(arg0: M0): types.Time>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Interval], [[{ type: types.Interval }], types.Time]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Interval], [[{ type: types.Interval }], types.Time]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus | string>(arg0: M0): types.Interval>>; minus>(arg0: M0): types.Time>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Interval], [[{ type: types.Interval }], types.Time]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Interval], [[{ type: types.Interval }], types.Time]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Time, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/timestamp.ts b/src/types/postgres/generated/timestamp.ts index 4a8a847..d9e283a 100644 --- a/src/types/postgres/generated/timestamp.ts +++ b/src/types/postgres/generated/timestamp.ts @@ -18,105 +18,105 @@ export class Timestamp extends Anynonarray { static __typnameText = "timestamp"; declare deserialize: (raw: string) => string; @expose.unchecked() - age | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Interval]]); return runtime.PgFunc("age", [this, ...__rest], __rt) as any; } + age | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Interval]]); return runtime.funcCall("age", [this, ...__rest], __rt) as any; } @expose.unchecked() - date(): types.Date { const [__rt, ...__rest] = runtime.match([], [[[], types.Date]]); return runtime.PgFunc("date", [this, ...__rest], __rt) as any; } + date(): types.Date { const [__rt, ...__rest] = runtime.match([], [[[], types.Date]]); return runtime.funcCall("date", [this, ...__rest], __rt) as any; } @expose.unchecked() - isfinite(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("isfinite", [this, ...__rest], __rt) as any; } + isfinite(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("isfinite", [this, ...__rest], __rt) as any; } overlaps, M1 extends types.Timestamp, M2 extends types.Interval>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1>; overlaps, M1 extends types.Timestamp, M2 extends types.Timestamp>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1>; overlaps, M1 extends types.Timestamp, M2 extends types.Interval>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1>; overlaps | string, M1 extends types.Timestamp | string, M2 extends types.Timestamp | string>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1>; @expose.unchecked() - overlaps(arg0: unknown, arg1: unknown, arg2: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Interval }, { type: types.Timestamp }, { type: types.Interval }], types.Bool], [[{ type: types.Interval }, { type: types.Timestamp }, { type: types.Timestamp }], types.Bool], [[{ type: types.Timestamp }, { type: types.Timestamp }, { type: types.Interval }], types.Bool], [[{ type: types.Timestamp, allowPrimitive: true }, { type: types.Timestamp, allowPrimitive: true }, { type: types.Timestamp, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("overlaps", [this, ...__rest], __rt) as any; } + overlaps(arg0: unknown, arg1: unknown, arg2: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Interval }, { type: types.Timestamp }, { type: types.Interval }], types.Bool], [[{ type: types.Interval }, { type: types.Timestamp }, { type: types.Timestamp }], types.Bool], [[{ type: types.Timestamp }, { type: types.Timestamp }, { type: types.Interval }], types.Bool], [[{ type: types.Timestamp, allowPrimitive: true }, { type: types.Timestamp, allowPrimitive: true }, { type: types.Timestamp, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("overlaps", [this, ...__rest], __rt) as any; } @expose.unchecked() - time(): types.Time { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.PgFunc("time", [this, ...__rest], __rt) as any; } + time(): types.Time { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.funcCall("time", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestamp | number>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Timestamp]]); return runtime.PgFunc("timestamp", [this, ...__rest], __rt) as any; } + timestamp | number>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Timestamp]]); return runtime.funcCall("timestamp", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestampLarger | string>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Timestamp]]); return runtime.PgFunc("timestamp_larger", [this, ...__rest], __rt) as any; } + timestampLarger | string>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Timestamp]]); return runtime.funcCall("timestamp_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestampSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("timestamp_send", [this, ...__rest], __rt) as any; } + timestampSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("timestamp_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestampSmaller | string>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Timestamp]]); return runtime.PgFunc("timestamp_smaller", [this, ...__rest], __rt) as any; } + timestampSmaller | string>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Timestamp]]); return runtime.funcCall("timestamp_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsrangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("tsrange_subdiff", [this, ...__rest], __rt) as any; } + tsrangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("tsrange_subdiff", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Timestamp<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamp]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Timestamp<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamp]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Timestamp<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamp]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Timestamp<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamp]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - generateSeries | string, M1 extends types.Interval | string>(arg0: M0, arg1: M1): runtime.PgSrf<{ generate_series: types.Timestamp | runtime.NullOf>> }, "generate_series"> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Timestamp, allowPrimitive: true }, { type: types.Interval, allowPrimitive: true }], types.Timestamp]]); return new runtime.PgSrf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } + generateSeries | string, M1 extends types.Interval | string>(arg0: M0, arg1: M1): runtime.Srf<{ generate_series: types.Timestamp | runtime.NullOf>> }, "generate_series"> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Timestamp, allowPrimitive: true }, { type: types.Interval, allowPrimitive: true }], types.Timestamp]]); return new runtime.Srf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } @expose.unchecked() - ['+'] | string>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timestamp]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'] | string>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timestamp]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - plus | string>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timestamp]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus | string>(arg0: M0): types.Timestamp>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timestamp]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-']>(arg0: M0): types.Timestamp>>; ['-'] | string>(arg0: M0): types.Interval>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamp], [[{ type: types.Timestamp, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamp], [[{ type: types.Timestamp, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus>(arg0: M0): types.Timestamp>>; minus | string>(arg0: M0): types.Interval>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamp], [[{ type: types.Timestamp, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamp], [[{ type: types.Timestamp, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<'] | string>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lt | string>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; @expose.unchecked() - lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<='] | string>(arg0: M0): types.Bool>>; ['<=']>(arg0: M0): types.Bool>>; ['<=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lte | string>(arg0: M0): types.Bool>>; lte>(arg0: M0): types.Bool>>; lte>(arg0: M0): types.Bool>>; @expose.unchecked() - lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<>'] | string>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | string>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['='] | string>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq | string>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>']>(arg0: M0): types.Bool>>; ['>'] | string>(arg0: M0): types.Bool>>; ['>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gt>(arg0: M0): types.Bool>>; gt | string>(arg0: M0): types.Bool>>; gt>(arg0: M0): types.Bool>>; @expose.unchecked() - gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz }], types.Bool], [[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>='] | string>(arg0: M0): types.Bool>>; ['>=']>(arg0: M0): types.Bool>>; ['>=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gte | string>(arg0: M0): types.Bool>>; gte>(arg0: M0): types.Bool>>; gte>(arg0: M0): types.Bool>>; @expose.unchecked() - gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamptz }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/timestamptz.ts b/src/types/postgres/generated/timestamptz.ts index 063a69a..c5bc35c 100644 --- a/src/types/postgres/generated/timestamptz.ts +++ b/src/types/postgres/generated/timestamptz.ts @@ -18,101 +18,101 @@ export class Timestamptz extends Anynonarray { static __typnameText = "timestamptz"; declare deserialize: (raw: string) => string; @expose.unchecked() - age | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Interval]]); return runtime.PgFunc("age", [this, ...__rest], __rt) as any; } + age | string>(arg0: M0): types.Interval>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Interval]]); return runtime.funcCall("age", [this, ...__rest], __rt) as any; } @expose.unchecked() - dateAdd | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Timestamptz | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Interval, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Timestamptz]]); return runtime.PgFunc("date_add", [this, ...__rest], __rt) as any; } + dateAdd | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Timestamptz | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Interval, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Timestamptz]]); return runtime.funcCall("date_add", [this, ...__rest], __rt) as any; } @expose.unchecked() - dateSubtract | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Timestamptz | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Interval, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Timestamptz]]); return runtime.PgFunc("date_subtract", [this, ...__rest], __rt) as any; } + dateSubtract | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Timestamptz | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Interval, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Timestamptz]]); return runtime.funcCall("date_subtract", [this, ...__rest], __rt) as any; } @expose.unchecked() - isfinite(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.PgFunc("isfinite", [this, ...__rest], __rt) as any; } + isfinite(): types.Bool { const [__rt, ...__rest] = runtime.match([], [[[], types.Bool]]); return runtime.funcCall("isfinite", [this, ...__rest], __rt) as any; } @expose.unchecked() - overlaps | string, M1 extends types.Timestamptz | string, M2 extends types.Timestamptz | string>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Timestamptz, allowPrimitive: true }, { type: types.Timestamptz, allowPrimitive: true }, { type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("overlaps", [this, ...__rest], __rt) as any; } + overlaps | string, M1 extends types.Timestamptz | string, M2 extends types.Timestamptz | string>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Timestamptz, allowPrimitive: true }, { type: types.Timestamptz, allowPrimitive: true }, { type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("overlaps", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestamptz | number>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Timestamptz]]); return runtime.PgFunc("timestamptz", [this, ...__rest], __rt) as any; } + timestamptz | number>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Timestamptz]]); return runtime.funcCall("timestamptz", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestamptzLarger | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Timestamptz]]); return runtime.PgFunc("timestamptz_larger", [this, ...__rest], __rt) as any; } + timestamptzLarger | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Timestamptz]]); return runtime.funcCall("timestamptz_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestamptzSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("timestamptz_send", [this, ...__rest], __rt) as any; } + timestamptzSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("timestamptz_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - timestamptzSmaller | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Timestamptz]]); return runtime.PgFunc("timestamptz_smaller", [this, ...__rest], __rt) as any; } + timestamptzSmaller | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Timestamptz]]); return runtime.funcCall("timestamptz_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - tstzrangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Float8]]); return runtime.PgFunc("tstzrange_subdiff", [this, ...__rest], __rt) as any; } + tstzrangeSubdiff | string>(arg0: M0): types.Float8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Float8]]); return runtime.funcCall("tstzrange_subdiff", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Timestamptz<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamptz]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Timestamptz<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamptz]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Timestamptz<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamptz]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Timestamptz<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamptz]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - generateSeries | string, M1 extends types.Interval | string, M2 extends types.Text | string>(arg0: M0, arg1: M1, arg2: M2): runtime.PgSrf<{ generate_series: types.Timestamptz | runtime.NullOf | runtime.NullOf>> }, "generate_series"> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Timestamptz, allowPrimitive: true }, { type: types.Interval, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Timestamptz]]); return new runtime.PgSrf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } + generateSeries | string, M1 extends types.Interval | string, M2 extends types.Text | string>(arg0: M0, arg1: M1, arg2: M2): runtime.Srf<{ generate_series: types.Timestamptz | runtime.NullOf | runtime.NullOf>> }, "generate_series"> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Timestamptz, allowPrimitive: true }, { type: types.Interval, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Timestamptz]]); return new runtime.Srf("generate_series", [this, ...__rest], [["generate_series", __rt]]) as any; } @expose.unchecked() - ['+'] | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timestamptz]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'] | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timestamptz]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - plus | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timestamptz]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus | string>(arg0: M0): types.Timestamptz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timestamptz]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['-']>(arg0: M0): types.Timestamptz>>; ['-'] | string>(arg0: M0): types.Interval>>; @expose.unchecked() - ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamptz], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamptz], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } minus>(arg0: M0): types.Timestamptz>>; minus | string>(arg0: M0): types.Interval>>; @expose.unchecked() - minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamptz], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Interval]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timestamptz], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Interval]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<'] | string>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; ['<']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lt | string>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; lt>(arg0: M0): types.Bool>>; @expose.unchecked() - lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<=']>(arg0: M0): types.Bool>>; ['<=']>(arg0: M0): types.Bool>>; ['<='] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } lte>(arg0: M0): types.Bool>>; lte>(arg0: M0): types.Bool>>; lte | string>(arg0: M0): types.Bool>>; @expose.unchecked() - lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['<>'] | string>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; ['<>']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | string>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; ne>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['=']>(arg0: M0): types.Bool>>; ['='] | string>(arg0: M0): types.Bool>>; ['=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq>(arg0: M0): types.Bool>>; eq | string>(arg0: M0): types.Bool>>; eq>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>']>(arg0: M0): types.Bool>>; ['>']>(arg0: M0): types.Bool>>; ['>'] | string>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gt>(arg0: M0): types.Bool>>; gt>(arg0: M0): types.Bool>>; gt | string>(arg0: M0): types.Bool>>; @expose.unchecked() - gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool], [[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['>='] | string>(arg0: M0): types.Bool>>; ['>=']>(arg0: M0): types.Bool>>; ['>=']>(arg0: M0): types.Bool>>; @expose.unchecked() - ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } gte | string>(arg0: M0): types.Bool>>; gte>(arg0: M0): types.Bool>>; gte>(arg0: M0): types.Bool>>; @expose.unchecked() - gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timestamptz, allowPrimitive: true }], types.Bool], [[{ type: types.Date }], types.Bool], [[{ type: types.Timestamp }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/timetz.ts b/src/types/postgres/generated/timetz.ts index cba6c94..2e620af 100644 --- a/src/types/postgres/generated/timetz.ts +++ b/src/types/postgres/generated/timetz.ts @@ -18,55 +18,55 @@ export class Timetz extends Anynonarray { static __typnameText = "timetz"; declare deserialize: (raw: string) => string; @expose.unchecked() - overlaps | string, M1 extends types.Timetz | string, M2 extends types.Timetz | string>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Timetz, allowPrimitive: true }, { type: types.Timetz, allowPrimitive: true }, { type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("overlaps", [this, ...__rest], __rt) as any; } + overlaps | string, M1 extends types.Timetz | string, M2 extends types.Timetz | string>(arg0: M0, arg1: M1, arg2: M2): types.Bool<1> { const [__rt, ...__rest] = runtime.match([arg0, arg1, arg2], [[[{ type: types.Timetz, allowPrimitive: true }, { type: types.Timetz, allowPrimitive: true }, { type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("overlaps", [this, ...__rest], __rt) as any; } @expose.unchecked() - time(): types.Time { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.PgFunc("time", [this, ...__rest], __rt) as any; } + time(): types.Time { const [__rt, ...__rest] = runtime.match([], [[[], types.Time]]); return runtime.funcCall("time", [this, ...__rest], __rt) as any; } @expose.unchecked() - timetz | number>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Timetz]]); return runtime.PgFunc("timetz", [this, ...__rest], __rt) as any; } + timetz | number>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Int4, allowPrimitive: true }], types.Timetz]]); return runtime.funcCall("timetz", [this, ...__rest], __rt) as any; } @expose.unchecked() - timetzLarger | string>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Timetz]]); return runtime.PgFunc("timetz_larger", [this, ...__rest], __rt) as any; } + timetzLarger | string>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Timetz]]); return runtime.funcCall("timetz_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - timetzSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("timetz_send", [this, ...__rest], __rt) as any; } + timetzSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("timetz_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - timetzSmaller | string>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Timetz]]); return runtime.PgFunc("timetz_smaller", [this, ...__rest], __rt) as any; } + timetzSmaller | string>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Timetz]]); return runtime.funcCall("timetz_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Timetz<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timetz]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Timetz<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timetz]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Timetz<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timetz]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Timetz<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Timetz]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } ['+']>(arg0: M0): types.Timetz>>; ['+']>(arg0: M0): types.Timestamptz>>; @expose.unchecked() - ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timetz], [[{ type: types.Date }], types.Timestamptz]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['+'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timetz], [[{ type: types.Date }], types.Timestamptz]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } plus>(arg0: M0): types.Timetz>>; plus>(arg0: M0): types.Timestamptz>>; @expose.unchecked() - plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timetz], [[{ type: types.Date }], types.Timestamptz]]); return runtime.PgOp(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + plus(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval }], types.Timetz], [[{ type: types.Date }], types.Timestamptz]]); return runtime.opCall(runtime.sql`+`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['-'] | string>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timetz]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['-'] | string>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timetz]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - minus | string>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timetz]]); return runtime.PgOp(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + minus | string>(arg0: M0): types.Timetz>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Interval, allowPrimitive: true }], types.Timetz]]); return runtime.opCall(runtime.sql`-`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Timetz, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/tsquery.ts b/src/types/postgres/generated/tsquery.ts index 9939a6e..d1a227e 100644 --- a/src/types/postgres/generated/tsquery.ts +++ b/src/types/postgres/generated/tsquery.ts @@ -18,65 +18,65 @@ export class Tsquery extends Anynonarray { static __typnameText = "tsquery"; declare deserialize: (raw: string) => string; @expose.unchecked() - numnode(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("numnode", [this, ...__rest], __rt) as any; } + numnode(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("numnode", [this, ...__rest], __rt) as any; } @expose.unchecked() - querytree(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("querytree", [this, ...__rest], __rt) as any; } + querytree(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("querytree", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsMatchQv | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("ts_match_qv", [this, ...__rest], __rt) as any; } + tsMatchQv | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("ts_match_qv", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsRewrite | string, M1 extends types.Tsquery | string>(arg0: M0, arg1: M1): types.Tsquery | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Tsquery, allowPrimitive: true }, { type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.PgFunc("ts_rewrite", [this, ...__rest], __rt) as any; } + tsRewrite | string, M1 extends types.Tsquery | string>(arg0: M0, arg1: M1): types.Tsquery | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Tsquery, allowPrimitive: true }, { type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.funcCall("ts_rewrite", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsqMcontained | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("tsq_mcontained", [this, ...__rest], __rt) as any; } + tsqMcontained | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("tsq_mcontained", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsqMcontains | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("tsq_mcontains", [this, ...__rest], __rt) as any; } + tsqMcontains | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("tsq_mcontains", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsqueryAnd | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.PgFunc("tsquery_and", [this, ...__rest], __rt) as any; } + tsqueryAnd | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.funcCall("tsquery_and", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsqueryNot(): types.Tsquery { const [__rt, ...__rest] = runtime.match([], [[[], types.Tsquery]]); return runtime.PgFunc("tsquery_not", [this, ...__rest], __rt) as any; } + tsqueryNot(): types.Tsquery { const [__rt, ...__rest] = runtime.match([], [[[], types.Tsquery]]); return runtime.funcCall("tsquery_not", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsqueryOr | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.PgFunc("tsquery_or", [this, ...__rest], __rt) as any; } + tsqueryOr | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.funcCall("tsquery_or", [this, ...__rest], __rt) as any; } tsqueryPhrase | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Tsquery | runtime.NullOf>>; tsqueryPhrase | string>(arg0: M0): types.Tsquery>>; @expose.unchecked() - tsqueryPhrase(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Tsquery, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Tsquery], [[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.PgFunc("tsquery_phrase", [this, ...__rest], __rt) as any; } + tsqueryPhrase(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Tsquery, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Tsquery], [[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.funcCall("tsquery_phrase", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsquerysend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("tsquerysend", [this, ...__rest], __rt) as any; } + tsquerysend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("tsquerysend", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['&&'] | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.PgOp(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['&&'] | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.opCall(runtime.sql`&&`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<->'] | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.PgOp(runtime.sql`<->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<->'] | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.opCall(runtime.sql`<->`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['||'] | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.PgOp(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['||'] | string>(arg0: M0): types.Tsquery>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Tsquery]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/tsvector.ts b/src/types/postgres/generated/tsvector.ts index d9b7ca9..e80fc11 100644 --- a/src/types/postgres/generated/tsvector.ts +++ b/src/types/postgres/generated/tsvector.ts @@ -18,57 +18,57 @@ export class Tsvector extends Anynonarray { static __typnameText = "tsvector"; declare deserialize: (raw: string) => string; @expose.unchecked() - length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.PgFunc("length", [this, ...__rest], __rt) as any; } + length(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("length", [this, ...__rest], __rt) as any; } @expose.unchecked() - setweight | string>(arg0: M0): types.Tsvector>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Tsvector]]); return runtime.PgFunc("setweight", [this, ...__rest], __rt) as any; } + setweight | string>(arg0: M0): types.Tsvector>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Char, allowPrimitive: true }], types.Tsvector]]); return runtime.funcCall("setweight", [this, ...__rest], __rt) as any; } @expose.unchecked() - strip(): types.Tsvector { const [__rt, ...__rest] = runtime.match([], [[[], types.Tsvector]]); return runtime.PgFunc("strip", [this, ...__rest], __rt) as any; } + strip(): types.Tsvector { const [__rt, ...__rest] = runtime.match([], [[[], types.Tsvector]]); return runtime.funcCall("strip", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsDelete | string>(arg0: M0): types.Tsvector>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsvector]]); return runtime.PgFunc("ts_delete", [this, ...__rest], __rt) as any; } + tsDelete | string>(arg0: M0): types.Tsvector>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Tsvector]]); return runtime.funcCall("ts_delete", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsMatchVq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("ts_match_vq", [this, ...__rest], __rt) as any; } + tsMatchVq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("ts_match_vq", [this, ...__rest], __rt) as any; } tsRank | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Float4 | runtime.NullOf>>; tsRank | string>(arg0: M0): types.Float4>>; @expose.unchecked() - tsRank(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Tsquery, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Float4], [[{ type: types.Tsquery, allowPrimitive: true }], types.Float4]]); return runtime.PgFunc("ts_rank", [this, ...__rest], __rt) as any; } + tsRank(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Tsquery, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Float4], [[{ type: types.Tsquery, allowPrimitive: true }], types.Float4]]); return runtime.funcCall("ts_rank", [this, ...__rest], __rt) as any; } tsRankCd | string>(arg0: M0): types.Float4>>; tsRankCd | string, M1 extends types.Int4 | number>(arg0: M0, arg1: M1): types.Float4 | runtime.NullOf>>; @expose.unchecked() - tsRankCd(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Float4], [[{ type: types.Tsquery, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Float4]]); return runtime.PgFunc("ts_rank_cd", [this, ...__rest], __rt) as any; } + tsRankCd(arg0: unknown, arg1?: unknown): any { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Float4], [[{ type: types.Tsquery, allowPrimitive: true }, { type: types.Int4, allowPrimitive: true }], types.Float4]]); return runtime.funcCall("ts_rank_cd", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsvectorConcat | string>(arg0: M0): types.Tsvector>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Tsvector]]); return runtime.PgFunc("tsvector_concat", [this, ...__rest], __rt) as any; } + tsvectorConcat | string>(arg0: M0): types.Tsvector>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Tsvector]]); return runtime.funcCall("tsvector_concat", [this, ...__rest], __rt) as any; } @expose.unchecked() - tsvectorsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("tsvectorsend", [this, ...__rest], __rt) as any; } + tsvectorsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("tsvectorsend", [this, ...__rest], __rt) as any; } @expose.unchecked() - unnest(): runtime.PgSrf<{ lexeme: types.Text<1> }, "unnest"> { return new runtime.PgSrf("unnest", [this], [["lexeme", types.Text]]) as any; } + unnest(): runtime.Srf<{ lexeme: types.Text<1> }, "unnest"> { return new runtime.Srf("unnest", [this], [["lexeme", types.Text]]) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['@@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`@@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['@@@'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsquery, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`@@@`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['||'] | string>(arg0: M0): types.Tsvector>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Tsvector]]); return runtime.PgOp(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['||'] | string>(arg0: M0): types.Tsvector>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Tsvector, allowPrimitive: true }], types.Tsvector]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/txid_snapshot.ts b/src/types/postgres/generated/txid_snapshot.ts index ff21e8f..0338858 100644 --- a/src/types/postgres/generated/txid_snapshot.ts +++ b/src/types/postgres/generated/txid_snapshot.ts @@ -18,11 +18,11 @@ export class TxidSnapshot extends Anynonarray { static __typnameText = "txid_snapshot"; declare deserialize: (raw: string) => string; @expose.unchecked() - txidSnapshotSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("txid_snapshot_send", [this, ...__rest], __rt) as any; } + txidSnapshotSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("txid_snapshot_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - txidSnapshotXmax(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("txid_snapshot_xmax", [this, ...__rest], __rt) as any; } + txidSnapshotXmax(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("txid_snapshot_xmax", [this, ...__rest], __rt) as any; } @expose.unchecked() - txidSnapshotXmin(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.PgFunc("txid_snapshot_xmin", [this, ...__rest], __rt) as any; } + txidSnapshotXmin(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("txid_snapshot_xmin", [this, ...__rest], __rt) as any; } @expose.unchecked() - txidSnapshotXip(): runtime.PgSrf<{ txid_snapshot_xip: types.Int8 }, "txid_snapshot_xip"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return new runtime.PgSrf("txid_snapshot_xip", [this, ...__rest], [["txid_snapshot_xip", __rt]]) as any; } + txidSnapshotXip(): runtime.Srf<{ txid_snapshot_xip: types.Int8 }, "txid_snapshot_xip"> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return new runtime.Srf("txid_snapshot_xip", [this, ...__rest], [["txid_snapshot_xip", __rt]]) as any; } } diff --git a/src/types/postgres/generated/unknown.ts b/src/types/postgres/generated/unknown.ts index 6a2d410..056cdf8 100644 --- a/src/types/postgres/generated/unknown.ts +++ b/src/types/postgres/generated/unknown.ts @@ -18,5 +18,5 @@ export class Unknown extends Anynonarray { static __typnameText = "unknown"; declare deserialize: (raw: string) => string; @expose.unchecked() - unknownsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("unknownsend", [this, ...__rest], __rt) as any; } + unknownsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("unknownsend", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/uuid.ts b/src/types/postgres/generated/uuid.ts index 80ee928..a34dfb0 100644 --- a/src/types/postgres/generated/uuid.ts +++ b/src/types/postgres/generated/uuid.ts @@ -18,33 +18,33 @@ export class Uuid extends Anynonarray { static __typnameText = "uuid"; declare deserialize: (raw: string) => string; @expose.unchecked() - uuidExtractTimestamp(): types.Timestamptz { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamptz]]); return runtime.PgFunc("uuid_extract_timestamp", [this, ...__rest], __rt) as any; } + uuidExtractTimestamp(): types.Timestamptz { const [__rt, ...__rest] = runtime.match([], [[[], types.Timestamptz]]); return runtime.funcCall("uuid_extract_timestamp", [this, ...__rest], __rt) as any; } @expose.unchecked() - uuidExtractVersion(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.PgFunc("uuid_extract_version", [this, ...__rest], __rt) as any; } + uuidExtractVersion(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("uuid_extract_version", [this, ...__rest], __rt) as any; } @expose.unchecked() - uuidSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("uuid_send", [this, ...__rest], __rt) as any; } + uuidSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("uuid_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Uuid, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/varbit.ts b/src/types/postgres/generated/varbit.ts index f4c2649..567ea6b 100644 --- a/src/types/postgres/generated/varbit.ts +++ b/src/types/postgres/generated/varbit.ts @@ -18,35 +18,35 @@ export class Varbit extends Anynonarray { static __typnameText = "varbit"; declare deserialize: (raw: string) => string; @expose.unchecked() - bitcat | string>(arg0: M0): types.Varbit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Varbit]]); return runtime.PgFunc("bitcat", [this, ...__rest], __rt) as any; } + bitcat | string>(arg0: M0): types.Varbit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Varbit]]); return runtime.funcCall("bitcat", [this, ...__rest], __rt) as any; } @expose.unchecked() - varbit | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): types.Varbit | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Varbit]]); return runtime.PgFunc("varbit", [this, ...__rest], __rt) as any; } + varbit | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): types.Varbit | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Varbit]]); return runtime.funcCall("varbit", [this, ...__rest], __rt) as any; } @expose.unchecked() - varbitSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("varbit_send", [this, ...__rest], __rt) as any; } + varbitSend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("varbit_send", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['||'] | string>(arg0: M0): types.Varbit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Varbit]]); return runtime.PgOp(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['||'] | string>(arg0: M0): types.Varbit>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Varbit, allowPrimitive: true }], types.Varbit]]); return runtime.opCall(runtime.sql`||`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/varchar.ts b/src/types/postgres/generated/varchar.ts index 880a0b2..9605f7e 100644 --- a/src/types/postgres/generated/varchar.ts +++ b/src/types/postgres/generated/varchar.ts @@ -18,5 +18,5 @@ export class Varchar extends Anynonarray { static __typnameText = "varchar"; declare deserialize: (raw: string) => string; @expose.unchecked() - varchar | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): types.Varchar | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Varchar]]); return runtime.PgFunc("varchar", [this, ...__rest], __rt) as any; } + varchar | number, M1 extends types.Bool | boolean>(arg0: M0, arg1: M1): types.Varchar | runtime.NullOf>> { const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Int4, allowPrimitive: true }, { type: types.Bool, allowPrimitive: true }], types.Varchar]]); return runtime.funcCall("varchar", [this, ...__rest], __rt) as any; } } diff --git a/src/types/postgres/generated/xid.ts b/src/types/postgres/generated/xid.ts index ee79bb2..472625c 100644 --- a/src/types/postgres/generated/xid.ts +++ b/src/types/postgres/generated/xid.ts @@ -18,21 +18,21 @@ export class Xid extends Anynonarray { static __typnameText = "xid"; declare deserialize: (raw: string) => string; @expose.unchecked() - xidsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("xidsend", [this, ...__rest], __rt) as any; } + xidsend(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("xidsend", [this, ...__rest], __rt) as any; } ['<>'] | string>(arg0: M0): types.Bool>>; ['<>'] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ne | string>(arg0: M0): types.Bool>>; ne | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } ['='] | string>(arg0: M0): types.Bool>>; ['='] | number>(arg0: M0): types.Bool>>; @expose.unchecked() - ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='](arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } eq | string>(arg0: M0): types.Bool>>; eq | number>(arg0: M0): types.Bool>>; @expose.unchecked() - eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq(arg0: unknown): any { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid, allowPrimitive: true }], types.Bool], [[{ type: types.Int4, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/xid8.ts b/src/types/postgres/generated/xid8.ts index 86736a0..12ca133 100644 --- a/src/types/postgres/generated/xid8.ts +++ b/src/types/postgres/generated/xid8.ts @@ -18,41 +18,41 @@ export class Xid8 extends Anynonarray { static __typnameText = "xid8"; declare deserialize: (raw: string) => string; @expose.unchecked() - pgVisibleInSnapshot | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgSnapshot, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("pg_visible_in_snapshot", [this, ...__rest], __rt) as any; } + pgVisibleInSnapshot | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.PgSnapshot, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("pg_visible_in_snapshot", [this, ...__rest], __rt) as any; } @expose.unchecked() - xid(): types.Xid { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid]]); return runtime.PgFunc("xid", [this, ...__rest], __rt) as any; } + xid(): types.Xid { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid]]); return runtime.funcCall("xid", [this, ...__rest], __rt) as any; } @expose.unchecked() - xid8Larger | string>(arg0: M0): types.Xid8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Xid8]]); return runtime.PgFunc("xid8_larger", [this, ...__rest], __rt) as any; } + xid8Larger | string>(arg0: M0): types.Xid8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Xid8]]); return runtime.funcCall("xid8_larger", [this, ...__rest], __rt) as any; } @expose.unchecked() - xid8Smaller | string>(arg0: M0): types.Xid8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Xid8]]); return runtime.PgFunc("xid8_smaller", [this, ...__rest], __rt) as any; } + xid8Smaller | string>(arg0: M0): types.Xid8>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Xid8]]); return runtime.funcCall("xid8_smaller", [this, ...__rest], __rt) as any; } @expose.unchecked() - xid8Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.PgFunc("xid8send", [this, ...__rest], __rt) as any; } + xid8Send(): types.Bytea { const [__rt, ...__rest] = runtime.match([], [[[], types.Bytea]]); return runtime.funcCall("xid8send", [this, ...__rest], __rt) as any; } @expose.unchecked() - max(): types.Xid8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return runtime.PgFunc("max", [this, ...__rest], __rt) as any; } + max(): types.Xid8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return runtime.funcCall("max", [this, ...__rest], __rt) as any; } @expose.unchecked() - min(): types.Xid8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return runtime.PgFunc("min", [this, ...__rest], __rt) as any; } + min(): types.Xid8<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Xid8]]); return runtime.funcCall("min", [this, ...__rest], __rt) as any; } @expose.unchecked() - ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + lte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['<>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ne | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`<>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + eq | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>'] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gt | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + ['>='] | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } @expose.unchecked() - gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.PgOp(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } + gte | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xid8, allowPrimitive: true }], types.Bool]]); return runtime.opCall(runtime.sql`>=`, [this, ...__rest] as [unknown, unknown], __rt) as any; } } diff --git a/src/types/postgres/generated/xml.ts b/src/types/postgres/generated/xml.ts index a3ff206..dacc091 100644 --- a/src/types/postgres/generated/xml.ts +++ b/src/types/postgres/generated/xml.ts @@ -18,11 +18,11 @@ export class Xml extends Anynonarray { static __typnameText = "xml"; declare deserialize: (raw: string) => string; @expose.unchecked() - text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.PgFunc("text", [this, ...__rest], __rt) as any; } + text(): types.Text { const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); return runtime.funcCall("text", [this, ...__rest], __rt) as any; } @expose.unchecked() - xmlconcat2 | string>(arg0: M0): types.Xml<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xml, allowPrimitive: true }], types.Xml]]); return runtime.PgFunc("xmlconcat2", [this, ...__rest], __rt) as any; } + xmlconcat2 | string>(arg0: M0): types.Xml<1> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Xml, allowPrimitive: true }], types.Xml]]); return runtime.funcCall("xmlconcat2", [this, ...__rest], __rt) as any; } @expose.unchecked() - xmlvalidate | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.PgFunc("xmlvalidate", [this, ...__rest], __rt) as any; } + xmlvalidate | string>(arg0: M0): types.Bool>> { const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Bool]]); return runtime.funcCall("xmlvalidate", [this, ...__rest], __rt) as any; } @expose.unchecked() - xmlagg(): types.Xml<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Xml]]); return runtime.PgFunc("xmlagg", [this, ...__rest], __rt) as any; } + xmlagg(): types.Xml<0 | 1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Xml]]); return runtime.funcCall("xmlagg", [this, ...__rest], __rt) as any; } } diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 6188c45..0f233ee 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -154,18 +154,18 @@ const argToSql = (arg: unknown): Sql => { }; // Expression node builders — construct real typed instances via constructor(Sql) -export const PgFunc = (name: string, args: unknown[], type: typeof Any) => { +export const funcCall = (name: string, args: unknown[], type: typeof Any) => { return type.from(new Func(name, args.map(argToSql))); }; -export const PgOp = (op: Raw, args: [unknown, unknown], type: typeof Any) => { +export const opCall = (op: Raw, args: [unknown, unknown], type: typeof Any) => { return type.from(new Op(op, argToSql(args[0]), argToSql(args[1]))); }; // Set-returning function result — a Fromable for use in FROM/JOIN. // columns is the row shape: [[name, constructor], ...]. Single-column SRFs // pass a 1-element array; multi-column SRFs with OUT params pass N entries. -export class PgSrf }, A extends string> extends Sql { +export class Srf }, A extends string> extends Sql { readonly tsAlias: A; #name: string; #columns: [string, typeof Any][]; From 48bc394536d197d36e509f3c36d27a2e27ec7927 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 27 May 2026 16:33:05 -0700 Subject: [PATCH 03/33] refactor(types): per-dialect deserialize registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 0.3 of SQLite generalization. Splits the deserialize registry so each dialect owns its own typname → TS-type mapping. - src/types/deserialize.ts: shared TypeDef/Dialect, registerDialect(), getTypeDef(dialect, typname). Internal map is a Map (avoids proto-pollution lint rule on dynamic object keys). - src/types/postgres/deserialize.ts: PG registry (bool, int2/4, float 4/8, oid). Registers itself on import. - PG Any base class gets `static dialect: Dialect = "postgres"`; runtime.match() and Any.{deserialize,serialize} read it for lookup. SQLite's registry (Phase 1) will register the same way. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/types/deserialize.ts | 45 ++++++++++------------------- src/types/postgres/deserialize.ts | 25 ++++++++++++++++ src/types/postgres/generate.ts | 3 +- src/types/postgres/overrides/any.ts | 9 ++++-- src/types/runtime.ts | 2 +- 5 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 src/types/postgres/deserialize.ts diff --git a/src/types/deserialize.ts b/src/types/deserialize.ts index 6d2abe9..3cbf463 100644 --- a/src/types/deserialize.ts +++ b/src/types/deserialize.ts @@ -1,42 +1,29 @@ -// Single source of truth for pg type → TS type mapping and deserialization. -// Used by codegen (tsType field) and runtime (deserialize fn). -// Types not listed here default to: tsType = "string", deserialize = identity. +// Dialect-aware registry: pg typname / sqlite typname → TS type + deserializer. +// Each dialect's package registers its own table via registerDialect(). +// Types not listed default to: tsType = "string", deserialize = identity. export interface TypeDef { tsType: string; deserialize: (raw: string) => unknown; } -const identity = (raw: string): string => raw; - -const parseBoolean = (raw: string): boolean => raw === "t"; - -const parseInt32 = (raw: string): number => parseInt(raw, 10); +export type Dialect = "postgres" | "sqlite"; -// parseFloat handles NaN, Infinity, -Infinity natively - -// Non-string types — everything else defaults to string/identity. -// -// int8 / bytea sit at "string" rather than bigint / Uint8Array on purpose: -// the RPC wire format is JSON, and bigint/Uint8Array don't survive JSON -// round-tripping. Keeping deserialize as identity here means the wire is -// JSON-clean by default. Users who want bigint arithmetic can `BigInt(s)` -// themselves; bytea stays as pg's hex string (`\xDEADBEEF`). A richer -// wire codec (bigint, bytes, dates as sentinels) is a v0.2 item — see -// ISSUES.md. -export const typeRegistry: { [key: string]: TypeDef } = { - bool: { tsType: "boolean", deserialize: parseBoolean }, - int2: { tsType: "number", deserialize: parseInt32 }, - int4: { tsType: "number", deserialize: parseInt32 }, - float4: { tsType: "number", deserialize: parseFloat }, - float8: { tsType: "number", deserialize: parseFloat }, - oid: { tsType: "number", deserialize: parseInt32 } -}; +const identity = (raw: string): string => raw; export const defaultTypeDef: TypeDef = { tsType: "string", deserialize: identity, }; -export const getTypeDef = (typname: string): TypeDef => - typeRegistry[typname] ?? defaultTypeDef; +const registries = new Map(); + +export const registerDialect = ( + dialect: Dialect, + reg: { [key: string]: TypeDef }, +): void => { + registries.set(dialect, reg); +}; + +export const getTypeDef = (dialect: Dialect, typname: string): TypeDef => + registries.get(dialect)?.[typname] ?? defaultTypeDef; diff --git a/src/types/postgres/deserialize.ts b/src/types/postgres/deserialize.ts new file mode 100644 index 0000000..02b8b94 --- /dev/null +++ b/src/types/postgres/deserialize.ts @@ -0,0 +1,25 @@ +// Postgres-side wire-format deserializers. +// +// int8 / bytea sit at "string" rather than bigint / Uint8Array on purpose: +// the RPC wire format is JSON, and bigint/Uint8Array don't survive JSON +// round-tripping. Keeping deserialize as identity here means the wire is +// JSON-clean by default. Users who want bigint arithmetic can `BigInt(s)` +// themselves; bytea stays as pg's hex string (`\xDEADBEEF`). A richer +// wire codec (bigint, bytes, dates as sentinels) is a v0.2 item — see +// ISSUES.md. +import { registerDialect, type TypeDef } from "../deserialize.ts"; + +const parseBoolean = (raw: string): boolean => raw === "t"; +const parseInt32 = (raw: string): number => parseInt(raw, 10); +// parseFloat handles NaN, Infinity, -Infinity natively + +export const postgresRegistry: { [key: string]: TypeDef } = { + bool: { tsType: "boolean", deserialize: parseBoolean }, + int2: { tsType: "number", deserialize: parseInt32 }, + int4: { tsType: "number", deserialize: parseInt32 }, + float4: { tsType: "number", deserialize: parseFloat }, + float8: { tsType: "number", deserialize: parseFloat }, + oid: { tsType: "number", deserialize: parseInt32 }, +}; + +registerDialect("postgres", postgresRegistry); diff --git a/src/types/postgres/generate.ts b/src/types/postgres/generate.ts index 9b25f96..3739808 100644 --- a/src/types/postgres/generate.ts +++ b/src/types/postgres/generate.ts @@ -5,6 +5,7 @@ import * as path from "node:path"; import { pathToFileURL } from "node:url"; import { requireDatabaseUrl } from "../../pg.ts"; import { getTypeDef } from "../deserialize.ts"; +import "./deserialize.ts"; import { introspect, groupByFirstArg, @@ -23,7 +24,7 @@ const OVERRIDES_DIR = path.resolve(import.meta.dirname, "overrides"); const TYPES_INDEX = path.resolve(import.meta.dirname, "index.ts"); const tsPrimitiveFor = (typname: string): string => - getTypeDef(typname).tsType; + getTypeDef("postgres", typname).tsType; // Types that get a generic > parameter const GENERIC_TYPES = new Set([ diff --git a/src/types/postgres/overrides/any.ts b/src/types/postgres/overrides/any.ts index 47ba885..9d6a9de 100644 --- a/src/types/postgres/overrides/any.ts +++ b/src/types/postgres/overrides/any.ts @@ -1,5 +1,6 @@ import { Any as Generated } from "../generated/any"; -import { getTypeDef } from "../../deserialize"; +import { getTypeDef, type Dialect } from "../../deserialize"; +import "../deserialize"; import { meta } from "../../runtime"; import type { NullOf, StrictNull, TsTypeOf } from "../../runtime"; import { Column, Param, sql, Sql, TypedParam, Unbound } from "../../../builder/sql"; @@ -26,9 +27,11 @@ export class Any extends Generated { // string (for map lookups, error messages). Codegen emits both. static __typname: Sql = sql`any`; static __typnameText = "any"; + static dialect: Dialect = "postgres"; deserialize(raw: string): unknown { - return getTypeDef((this.constructor as typeof Any).__typnameText).deserialize(raw); + const cls = this.constructor as typeof Any; + return getTypeDef(cls.dialect, cls.__typnameText).deserialize(raw); } // Returns the underlying Sql node for embedding in other expressions @@ -146,7 +149,7 @@ export class Any extends Generated { // Used by match() for runtime overload dispatch. static serialize(v: unknown): Any { if (v instanceof this) { return v; } - const expected = getTypeDef(this.__typnameText).tsType; + const expected = getTypeDef(this.dialect, this.__typnameText).tsType; if (typeof v === expected) { return this.from(v); } throw new Error( `${this.__typnameText}.serialize: expected a ${this.__typnameText} instance or ${expected} primitive, got ${typeof v} (${String(v).slice(0, 60)}).`, diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 0f233ee..7256bff 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -125,7 +125,7 @@ export const match = (args: unknown[], cases: MatchCase[]): [typeof Any, ...unkn return true; } if (m.allowPrimitive) { - const expected = getTypeDef(m.type.__typnameText).tsType; + const expected = getTypeDef(m.type.dialect, m.type.__typnameText).tsType; if (typeof arg === expected) { return true; } From b4dd4b088e4aeff60f5c1a801e7baff9e1382757 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 27 May 2026 16:37:24 -0700 Subject: [PATCH 04/33] refactor(builder): add CompileContext + Cast AST node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 0.4 of SQLite generalization. Threads a CompileContext (carrying the dialect) through Sql.bind(ctx) and compile(root, ctx) so future dialect-aware AST nodes can dispatch without baking dialect into the node at construction time. - src/builder/sql.ts: - CompileContext { dialect } + pgCtx/sqliteCtx singletons. - Sql.bind() → Sql.bind(ctx); subclasses without dispatch can omit. - compile(root, "pg"|"sqlite") → compile(root, ctx). Param-placeholder style (`$N` vs `?`) derives from ctx.dialect. - New Cast(expr, typname) node; TypedParam now delegates to Cast. - src/driver.ts: Driver gets `readonly dialect: Dialect`. PgDriver and PgliteDriver default to "postgres" and build ctx from their own dialect on execute(). - src/types/postgres/overrides/any.ts: Any.cast() emits Cast node instead of inline `CAST(... AS ...)` templating. - All 45 compile() call sites updated to pass pgCtx/sqliteCtx instead of string args. - delete/insert/update FinalizedX.bind() take ctx and forward it. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/delete.ts | 8 +++---- src/builder/insert.ts | 8 +++---- src/builder/query.test.ts | 24 +++++++++---------- src/builder/query.ts | 4 ++-- src/builder/sql.test.ts | 16 ++++++------- src/builder/sql.ts | 36 +++++++++++++++++++++++++---- src/builder/update.ts | 8 +++---- src/driver.ts | 12 +++++++--- src/types/match.test.ts | 12 +++++----- src/types/postgres/index.test.ts | 26 ++++++++++----------- src/types/postgres/overrides/any.ts | 4 ++-- 11 files changed, 95 insertions(+), 63 deletions(-) diff --git a/src/builder/delete.ts b/src/builder/delete.ts index 75ab646..ddfc80b 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -1,4 +1,4 @@ -import { Sql, sql, Alias, compile } from "./sql"; +import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; import { Bool } from "../types"; import type { RowType, RowTypeToTsType } from "./query"; @@ -107,9 +107,9 @@ export class DeleteBuilder { const q = db.values({ a: Int4.from(1), b: Text.from("hello") }); - const compiled = compile(q, "pg"); + const compiled = compile(q, pgCtx); expect(compiled.text).toContain("VALUES"); expect(compiled.text).toContain("CAST"); }); test("values with multiple rows, second row uses primitives", async () => { const q = db.values({ x: Int4.from(1), y: Text.from("a") }, { x: 2, y: "b" }); - const compiled = compile(q, "pg"); + const compiled = compile(q, pgCtx); expect(compiled.text).toContain("VALUES"); }); @@ -24,7 +24,7 @@ test("values with multiple rows, second row uses primitives", async () => { test("values with select identity", async () => { const q = db.values({ num: Int4.from(42), name: Text.from("test") }).select((n) => n.values); - const compiled = compile(q, "pg"); + const compiled = compile(q, pgCtx); expect(compiled.text).toContain("SELECT"); expect(compiled.text).toContain("VALUES"); }); @@ -33,7 +33,7 @@ test("values with select computed column", async () => { const q = db.values({ a: Int4.from(5), b: Int4.from(3) }).select((n) => ({ sum: n.values.a["+"](n.values.b), })); - const compiled = compile(q, "pg"); + const compiled = compile(q, pgCtx); expect(compiled.text).toContain("SELECT"); expect(compiled.text).toContain("+"); }); @@ -113,7 +113,7 @@ test("e2e: where with equality", async () => { test("where compiles to SQL", () => { const q = db.values({ a: Int4.from(1) }).where((n) => n.values.a[">"](5)); - const compiled = compile(q, "pg"); + const compiled = compile(q, pgCtx); expect(compiled.text).toContain("WHERE"); }); @@ -127,7 +127,7 @@ test("groupBy compiles to SQL", () => { { category: "b", amount: 30 }, ) .groupBy((n) => [n.values.category]); - const compiled = compile(q, "pg"); + const compiled = compile(q, pgCtx); expect(compiled.text).toContain("GROUP BY"); }); @@ -178,7 +178,7 @@ test("having compiles to SQL", () => { ) .groupBy((n) => [n.values.category]) .having((n) => n.values.category[">"](Text.from("a"))); - const compiled = compile(q, "pg"); + const compiled = compile(q, pgCtx); expect(compiled.text).toContain("HAVING"); expect(compiled.text).toContain("GROUP BY"); }); @@ -233,7 +233,7 @@ test("orderBy compiles to SQL", () => { const q = db .values({ a: Int4.from(1) }) .orderBy((n) => [n.values.a, "desc"]); - const compiled = compile(q, "pg"); + const compiled = compile(q, pgCtx); expect(compiled.text).toContain("ORDER BY"); expect(compiled.text).toContain("DESC"); }); @@ -834,17 +834,17 @@ test("where defers callback validation — bad return only throws at compile", ( .values({ a: Int4.from(1) }) // @ts-expect-error — callback must return Bool .where(() => 42); - expectReturnValidationError(() => compile(q, "pg"), /expected Bool, received number/); + expectReturnValidationError(() => compile(q, pgCtx), /expected Bool, received number/); }); test("orderBy defers — empty array fails .min(1) at compile", () => { const q = db.values({ a: Int4.from(1) }).orderBy(() => [] as never); - expectReturnValidationError(() => compile(q, "pg"), /expected array to have >=1 items/); + expectReturnValidationError(() => compile(q, pgCtx), /expected array to have >=1 items/); }); test("groupBy() with no args is allowed (optional callback)", () => { const q = db.values({ a: Int4.from(1) }).groupBy(); - expect(() => compile(q, "pg")).not.toThrow(); + expect(() => compile(q, pgCtx)).not.toThrow(); }); test("type test: db.execute(Table.from()) row methods are never-typed (uncallable)", async () => { diff --git a/src/builder/query.ts b/src/builder/query.ts index a50a84f..53372fb 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -1,5 +1,5 @@ import type { BoundSql } from "./sql"; -import { sql, Sql, Alias, compile } from "./sql"; +import { sql, Sql, Alias, compile, pgCtx } from "./sql"; import { Database } from "../database"; import { Bool } from "../types"; import { Any, Anyarray, Record } from "../types"; @@ -510,7 +510,7 @@ export class QueryBuilder< @expose() debug(): this { - const compiled = compile(this, "pg"); + const compiled = compile(this, pgCtx); console.log("Debugging query:", { sql: compiled.text, parameters: compiled.values }); return this; } diff --git a/src/builder/sql.test.ts b/src/builder/sql.test.ts index b5f16f5..48a9da3 100644 --- a/src/builder/sql.test.ts +++ b/src/builder/sql.test.ts @@ -1,36 +1,36 @@ import { test, expect } from "vitest"; -import { sql, compile } from "./sql"; +import { sql, compile, pgCtx, sqliteCtx } from "./sql"; test("param compiles with pg style", () => { const q = sql`SELECT ${1}, ${2}`; - expect(compile(q, "pg")).toEqual({ text: "SELECT $1, $2", values: [1, 2] }); + expect(compile(q, pgCtx)).toEqual({ text: "SELECT $1, $2", values: [1, 2] }); }); test("param compiles with sqlite style", () => { const q = sql`SELECT ${1}, ${2}`; - expect(compile(q, "sqlite")).toEqual({ text: "SELECT ?, ?", values: [1, 2] }); + expect(compile(q, sqliteCtx)).toEqual({ text: "SELECT ?, ?", values: [1, 2] }); }); test("ident in tagged template", () => { const col = sql.ident("user_name"); const q = sql`SELECT ${col} FROM ${sql.ident("users")}`; - expect(compile(q, "pg")).toEqual({ text: 'SELECT "user_name" FROM "users"', values: [] }); + expect(compile(q, pgCtx)).toEqual({ text: 'SELECT "user_name" FROM "users"', values: [] }); }); test("ident escapes double quotes", () => { const q = sql.ident('foo"bar'); - expect(compile(q, "pg")).toEqual({ text: '"foo""bar"', values: [] }); + expect(compile(q, pgCtx)).toEqual({ text: '"foo""bar"', values: [] }); }); test("join", () => { const cols = [sql.ident("a"), sql.ident("b"), sql.ident("c")]; const q = sql`SELECT ${sql.join(cols)}`; - expect(compile(q, "pg")).toEqual({ text: 'SELECT "a", "b", "c"', values: [] }); + expect(compile(q, pgCtx)).toEqual({ text: 'SELECT "a", "b", "c"', values: [] }); }); test("mixed params and idents", () => { const q = sql`SELECT ${sql.ident("name")} FROM ${sql.ident("users")} WHERE ${sql.ident("id")} = ${42}`; - expect(compile(q, "pg")).toEqual({ + expect(compile(q, pgCtx)).toEqual({ text: 'SELECT "name" FROM "users" WHERE "id" = $1', values: [42], }); @@ -38,5 +38,5 @@ test("mixed params and idents", () => { test("raw sql", () => { const q = sql`SELECT ${sql.raw("COUNT(*)")} FROM ${sql.ident("users")}`; - expect(compile(q, "pg")).toEqual({ text: 'SELECT COUNT(*) FROM "users"', values: [] }); + expect(compile(q, pgCtx)).toEqual({ text: 'SELECT COUNT(*) FROM "users"', values: [] }); }); diff --git a/src/builder/sql.ts b/src/builder/sql.ts index 31f4149..ea87234 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -1,7 +1,16 @@ import type { Database } from "../database"; +import type { Dialect } from "../types/deserialize"; export type CompiledSql = { text: string; values: unknown[] }; +// Threaded through bind() and compile() so dialect-aware nodes (Cast, +// Scalar, future per-dialect operator emission) can dispatch without +// baking dialect into the node at construction time. +export type CompileContext = { dialect: Dialect }; + +export const pgCtx: CompileContext = { dialect: "postgres" }; +export const sqliteCtx: CompileContext = { dialect: "sqlite" }; + // --- Root --- // Every SQL node extends Sql. bind() produces a single BoundSql — one of @@ -12,7 +21,9 @@ export type CompiledSql = { text: string; values: unknown[] }; // children() exposes direct sub-expressions for generic tree walks // (extractor, linting). Default is []; override on composites. export abstract class Sql { - abstract bind(): BoundSql; + // Subclasses that don't dispatch on dialect can omit ctx; TS allows + // overrides to take fewer params than the parent signature. + abstract bind(ctx: CompileContext): BoundSql; children(): readonly Sql[] { return []; } // Fluent terminator: `someSql.execute(db)` === `db.execute(someSql)`. // Base returns Promise so builder subclasses can narrow to @@ -158,10 +169,25 @@ export class UnaryOp extends Sql { override children(): readonly Sql[] { return [this.op, this.expr]; } } +// `CAST(expr AS T)` — dialect-aware emission lives here so callers +// (TypedParam, Any.cast(), etc.) don't templating CAST inline. +export class Cast extends Sql { + constructor(readonly expr: Sql, readonly typname: Sql) { super(); } + bind(_ctx: CompileContext): BoundSql { + // Both PG and SQLite accept CAST(expr AS typename); typename keyspace + // differs per-dialect but that's the caller's concern (the typname + // Sql node already carries the right dialect-specific identifier). + return sql`CAST(${this.expr} AS ${this.typname})`; + } + override children(): readonly Sql[] { return [this.expr, this.typname]; } +} + // `CAST($n AS T)` for a TS primitive flowing into a typed pg expression. export class TypedParam extends Sql { constructor(readonly value: Param, readonly typname: Sql) { super(); } - bind(): BoundSql { return sql`CAST(${this.value} AS ${this.typname})`; } + bind(_ctx: CompileContext): BoundSql { + return new Cast(this.value, this.typname).bind(_ctx); + } override children(): readonly Sql[] { return [this.value, this.typname]; } } @@ -188,7 +214,7 @@ const quoteIdent = (name: string): string => `"${name.replace(/"/g, '""')}"`; // frames stash the previous scope to restore on pop. type Frame = { iter: Iterator; prevScope?: Scope }; -export const compile = (root: Sql, style: "pg" | "sqlite" = "pg"): CompiledSql => { +export const compile = (root: Sql, ctx: CompileContext = pgCtx): CompiledSql => { const values: unknown[] = []; const out: string[] = []; let scope = new Scope(); @@ -202,14 +228,14 @@ export const compile = (root: Sql, style: "pg" | "sqlite" = "pg"): CompiledSql = stack.pop(); continue; } - const atom = next.value.bind(); + const atom = next.value.bind(ctx); if (atom instanceof Raw) { out.push(atom.value); } else if (atom instanceof Ident) { out.push(quoteIdent(atom.name)); } else if (atom instanceof Param) { values.push(atom.value); - out.push(style === "pg" ? `$${values.length}` : "?"); + out.push(ctx.dialect === "postgres" ? `$${values.length}` : "?"); } else if (atom instanceof Alias) { const resolved = scope.resolve(atom); if (!resolved) { diff --git a/src/builder/update.ts b/src/builder/update.ts index 79f0f9a..36db8b6 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -1,4 +1,4 @@ -import { Sql, sql, Alias, compile } from "./sql"; +import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; import { Bool } from "../types"; import type { SetRow } from "../types/runtime"; @@ -138,9 +138,9 @@ export class UpdateBuilder Promise; export interface Driver { + readonly dialect: Dialect; execute: ExecuteFn; runInSingleConnection(cb: (execute: ExecuteFn) => Promise): Promise; close(): Promise; @@ -21,6 +23,8 @@ export interface Driver { // lets a missing peer fail late with a real module-not-found error rather // than at load time. export class PgDriver implements Driver { + readonly dialect: Dialect = "postgres"; + static async create( connectionString: string, poolOptions: pg.PoolConfig = {}, @@ -38,7 +42,7 @@ export class PgDriver implements Driver { private constructor(private pool: pg.Pool) {} async execute(query: Sql): Promise { - const c = compile(query, "pg"); + const c = compile(query, { dialect: this.dialect }); return this.pool.query(c.text, c.values); } @@ -46,7 +50,7 @@ export class PgDriver implements Driver { const client = await this.pool.connect(); try { return await cb(async (query) => { - const c = compile(query, "pg"); + const c = compile(query, { dialect: this.dialect }); return client.query(c.text, c.values); }); } finally { @@ -73,6 +77,8 @@ type PgliteDb = { }; export class PgliteDriver implements Driver { + readonly dialect: Dialect = "postgres"; + static async create(): Promise { // eslint-disable-next-line no-restricted-syntax -- optional peer, see class comment const { PGlite } = await import("@electric-sql/pglite"); @@ -91,7 +97,7 @@ export class PgliteDriver implements Driver { ) {} async execute(query: Sql): Promise { - const c = compile(query, "pg"); + const c = compile(query, { dialect: this.dialect }); return this.db.query(c.text, c.values, { parsers: this.parsers }) as Promise; } diff --git a/src/types/match.test.ts b/src/types/match.test.ts index 4c3184a..d0d5e6e 100644 --- a/src/types/match.test.ts +++ b/src/types/match.test.ts @@ -1,19 +1,19 @@ import { test, expect } from "vitest"; import { Int4, Int8, Text, Bool } from "./index"; -import { compile } from "../builder/sql"; +import { compile, pgCtx } from "../builder/sql"; // --- match via operators/functions --- test("match: correct type passes", () => { const a = Int4.from(5) as Int4<1>; const result = a["+"](Int4.from(3)); - expect(compile(result.toSql(), "pg").text).toContain("+"); + expect(compile(result.toSql(), pgCtx).text).toContain("+"); }); test("match: primitive passes when allowed", () => { const a = Int4.from(5) as Int4<1>; const result = a["+"](3); - expect(compile(result.toSql(), "pg").text).toContain("+"); + expect(compile(result.toSql(), pgCtx).text).toContain("+"); }); test("match: wrong primitive type throws", () => { @@ -43,11 +43,11 @@ test("match: multi-overload resolves correct return type", () => { // Int4 * Int4 → Int4 const r1 = a["*"](Int4.from(3)); - expect(compile(r1.toSql(), "pg").text).toContain("*"); + expect(compile(r1.toSql(), pgCtx).text).toContain("*"); // Int4 * Int8 → Int8 (different return type per overload) const r2 = a["*"](Int8.from("3")); - expect(compile(r2.toSql(), "pg").text).toContain("*"); + expect(compile(r2.toSql(), pgCtx).text).toContain("*"); }); test("match: comparison operator returns Bool", () => { @@ -61,7 +61,7 @@ test("match: serializes primitive arg into typed instance", () => { const a = Int4.from(5) as Int4<1>; const result = a["+"](3); // The compiled SQL should have CAST for both args (both are primitives wrapped) - const compiled = compile(result.toSql(), "pg"); + const compiled = compile(result.toSql(), pgCtx); expect(compiled.text).toContain("CAST"); }); diff --git a/src/types/postgres/index.test.ts b/src/types/postgres/index.test.ts index b98f1b4..d9915e3 100644 --- a/src/types/postgres/index.test.ts +++ b/src/types/postgres/index.test.ts @@ -3,7 +3,7 @@ import type { meta } from "../runtime"; import type { StrictNull, MaybeNull, NullOf, TsTypeOf } from "../runtime"; import type { Any, Float8, Anyrange, Anymultirange } from "./index"; import { Int4, Text, Bool, Int8, Record, Anyarray } from "./index"; -import { compile } from "../../builder/sql"; +import { compile, pgCtx } from "../../builder/sql"; import { sql } from "../../builder/sql"; import { PgDriver } from "../../driver"; import { requireDatabaseUrl } from "../../pg"; @@ -110,28 +110,28 @@ test("operator overloads: Int4 = accepts number but not string", () => { test("Int4.from(number) compiles with cast", () => { const expr = Int4.from(5); - const compiled = compile(expr.toSql(), "pg"); + const compiled = compile(expr.toSql(), pgCtx); expect(compiled.text).toBe("CAST($1 AS int4)"); expect(compiled.values).toEqual([5]); }); test("Text.from(string) compiles with cast", () => { const expr = Text.from("hello"); - const compiled = compile(expr.toSql(), "pg"); + const compiled = compile(expr.toSql(), pgCtx); expect(compiled.text).toBe("CAST($1 AS text)"); expect(compiled.values).toEqual(["hello"]); }); test("Bool.from(boolean) compiles with cast", () => { const expr = Bool.from(true); - const compiled = compile(expr.toSql(), "pg"); + const compiled = compile(expr.toSql(), pgCtx); expect(compiled.text).toBe("CAST($1 AS bool)"); expect(compiled.values).toEqual([true]); }); test("Int8.from(bigint) compiles with cast", () => { const expr = Int8.from(9007199254740993n); - const compiled = compile(expr.toSql(), "pg"); + const compiled = compile(expr.toSql(), pgCtx); expect(compiled.text).toBe("CAST($1 AS int8)"); expect(compiled.values).toEqual([9007199254740993n]); }); @@ -140,28 +140,28 @@ test("Int8.from(bigint) compiles with cast", () => { test("Int4 + Int4 compiles with casts", () => { const expr = Int4.from(5)["+"](Int4.from(3)); - const compiled = compile(expr.toSql(), "pg"); + const compiled = compile(expr.toSql(), pgCtx); expect(compiled.text).toBe("(CAST($1 AS int4) + CAST($2 AS int4))"); expect(compiled.values).toEqual([5, 3]); }); test("Int4 + primitive compiles with casts", () => { const expr = Int4.from(5)["+"](3); - const compiled = compile(expr.toSql(), "pg"); + const compiled = compile(expr.toSql(), pgCtx); expect(compiled.text).toBe("(CAST($1 AS int4) + CAST($2 AS int4))"); expect(compiled.values).toEqual([5, 3]); }); test("Text.upper() compiles with cast", () => { const expr = Text.from("hello").upper(); - const compiled = compile(expr.toSql(), "pg"); + const compiled = compile(expr.toSql(), pgCtx); expect(compiled.text).toBe('"upper"(CAST($1 AS text))'); expect(compiled.values).toEqual(["hello"]); }); test("chained operations", () => { const expr = Int4.from(1)["+"](Int4.from(2))["*"](Int4.from(3)); - const compiled = compile(expr.toSql(), "pg"); + const compiled = compile(expr.toSql(), pgCtx); expect(compiled.text).toBe("((CAST($1 AS int4) + CAST($2 AS int4)) * CAST($3 AS int4))"); expect(compiled.values).toEqual([1, 2, 3]); }); @@ -497,7 +497,7 @@ test("sql template inlines Any expressions via duck-typed toSql()", () => { // columns (e.g. `CASE ${col} WHEN ...`) would parameterize the // class instance — invalid or worse, silently `{}`. const expr = Int4.from(5)["+"](3); - const compiled = compile(sql`SELECT ${expr} AS x`, "pg"); + const compiled = compile(sql`SELECT ${expr} AS x`, pgCtx); // The Int4 binop renders as a real `+` between two operands — // multiple `$N` placeholders, an explicit `+` operator. The bug // we're guarding against is the whole expr collapsing to a single @@ -516,7 +516,7 @@ test("Any.in: empty vararg is a type error (SQL forbids `IN ()`)", () => { test("Any.in: single value → IN list (no `=` rewrite — pg planner handles that)", () => { const expr = Text.from("a").in(Text.from("b")); - const compiled = compile(sql`SELECT ${expr.toSql()}`, "pg"); + const compiled = compile(sql`SELECT ${expr.toSql()}`, pgCtx); expect(compiled).toMatchInlineSnapshot(` { "text": "SELECT (CAST($1 AS text) IN (CAST($2 AS text)))", @@ -530,7 +530,7 @@ test("Any.in: single value → IN list (no `=` rewrite — pg planner handles th test("Any.in: multiple values → IN list", () => { const expr = Text.from("a").in(Text.from("b"), Text.from("c"), Text.from("d")); - const compiled = compile(sql`SELECT ${expr.toSql()}`, "pg"); + const compiled = compile(sql`SELECT ${expr.toSql()}`, pgCtx); expect(compiled).toMatchInlineSnapshot(` { "text": "SELECT (CAST($1 AS text) IN (CAST($2 AS text), CAST($3 AS text), CAST($4 AS text)))", @@ -546,7 +546,7 @@ test("Any.in: multiple values → IN list", () => { test("Any.in: accepts primitives directly", () => { const expr = Text.from("a").in("b", "c", "d"); - const compiled = compile(sql`SELECT ${expr.toSql()}`, "pg"); + const compiled = compile(sql`SELECT ${expr.toSql()}`, pgCtx); expect(compiled).toMatchInlineSnapshot(` { "text": "SELECT (CAST($1 AS text) IN (CAST($2 AS text), CAST($3 AS text), CAST($4 AS text)))", diff --git a/src/types/postgres/overrides/any.ts b/src/types/postgres/overrides/any.ts index 9d6a9de..9863080 100644 --- a/src/types/postgres/overrides/any.ts +++ b/src/types/postgres/overrides/any.ts @@ -3,7 +3,7 @@ import { getTypeDef, type Dialect } from "../../deserialize"; import "../deserialize"; import { meta } from "../../runtime"; import type { NullOf, StrictNull, TsTypeOf } from "../../runtime"; -import { Column, Param, sql, Sql, TypedParam, Unbound } from "../../../builder/sql"; +import { Cast, Column, Param, sql, Sql, TypedParam, Unbound } from "../../../builder/sql"; import { expose } from "../../../exoeval/tool"; import { isPlainData } from "../../../util"; import * as types from "../index"; @@ -59,7 +59,7 @@ export class Any extends Generated { : [N] extends [1] ? (InstanceType extends { [meta]: { __nonNullable: infer U } } ? U : InstanceType) : (InstanceType extends { [meta]: { __nullable: infer U } } ? U : InstanceType) { - return cls.from(sql`CAST(${this.toSql()} AS ${cls.__typname})`) as any; + return cls.from(new Cast(this.toSql(), cls.__typname)) as any; } // Type-safe IN. Accepts a vararg of "this type at any nullability" From 325979724e7c4bad17cba23c6f4d43297deab3c1 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 27 May 2026 16:38:47 -0700 Subject: [PATCH 05/33] refactor(types): extract boolAnd/boolOr/boolNot helpers from Bool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 0.5 of SQLite generalization. Moves the body of Bool.and/or/not into dialect-agnostic helpers at src/types/bool-mixin.ts. PG's Bool calls them with its own __typname so primitive TS booleans coerce to pg `bool` via the Cast node; SQLite's Bool (Phase 1) will reuse the same helpers with its own typname. The previous inline `CAST(... AS bool)` template is gone — Cast is the single source of truth for cast emission. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/types/bool-mixin.ts | 21 +++++++++++++++++++++ src/types/postgres/overrides/bool.ts | 10 ++++------ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 src/types/bool-mixin.ts diff --git a/src/types/bool-mixin.ts b/src/types/bool-mixin.ts new file mode 100644 index 0000000..212dd6f --- /dev/null +++ b/src/types/bool-mixin.ts @@ -0,0 +1,21 @@ +// Dialect-agnostic helpers for Bool's and/or/not. Concrete Bool classes +// pass their own __typname so a primitive TS boolean gets wrapped in the +// dialect's native bool representation via Cast. Cast itself is +// dialect-aware via CompileContext at bind time. +import { Cast, Op, Param, UnaryOp, sql, type Sql } from "../builder/sql"; + +const coerceBoolArg = (v: unknown, typname: Sql): Sql => { + if (v !== null && typeof v === "object" && typeof (v as { toSql?: unknown }).toSql === "function") { + return (v as { toSql: () => Sql }).toSql(); + } + return new Cast(new Param(v), typname); +}; + +export const boolAnd = (leftSql: Sql, right: unknown, typname: Sql): Sql => + new Op(sql`AND`, leftSql, coerceBoolArg(right, typname)); + +export const boolOr = (leftSql: Sql, right: unknown, typname: Sql): Sql => + new Op(sql`OR`, leftSql, coerceBoolArg(right, typname)); + +export const boolNot = (sqlExpr: Sql): Sql => + new UnaryOp(sql`NOT`, sqlExpr); diff --git a/src/types/postgres/overrides/bool.ts b/src/types/postgres/overrides/bool.ts index 355176d..e11813b 100644 --- a/src/types/postgres/overrides/bool.ts +++ b/src/types/postgres/overrides/bool.ts @@ -1,5 +1,5 @@ import { Bool as Generated } from "../generated/bool"; -import { Op, UnaryOp, sql } from "../../../builder/sql"; +import { boolAnd, boolOr, boolNot } from "../../bool-mixin"; import type { StrictNull, NullOf } from "../../runtime"; export class Bool extends Generated { @@ -9,16 +9,14 @@ export class Bool extends Generated { declare deserialize: (raw: string) => boolean; and | boolean>(other: M): Bool>> { - const otherSql = other instanceof Bool ? other.toSql() : sql`CAST(${sql.param(other)} AS bool)`; - return Bool.from(new Op(sql`AND`, this.toSql(), otherSql)) as any; + return Bool.from(boolAnd(this.toSql(), other, Bool.__typname)) as any; } or | boolean>(other: M): Bool>> { - const otherSql = other instanceof Bool ? other.toSql() : sql`CAST(${sql.param(other)} AS bool)`; - return Bool.from(new Op(sql`OR`, this.toSql(), otherSql)) as any; + return Bool.from(boolOr(this.toSql(), other, Bool.__typname)) as any; } not(): Bool { - return Bool.from(new UnaryOp(sql`NOT`, this.toSql())) as any; + return Bool.from(boolNot(this.toSql())) as any; } } From 3908120e1ae3f5cebb4fd20fac38ce4dcaf70d33 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 12:19:05 -0700 Subject: [PATCH 06/33] refactor(types): extract SqlValue base + Dialect object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hoists the dialect-agnostic behavior (cast, coalesce, from, serialize, column, deserialize, toSql, [meta], statics) out of PG's `Any` into a shared `SqlValue` base in src/types/any.ts. Codegen'd PG root `any.ts` now extends `SqlValue`; every other pg_catalog type inherits transitively. Also introduces `Dialect` as a rich descriptor `{ name, root, bool }` (name kept as the compile-ctx tag, aliased to `DialectName` in the deserialize registry) and a shared `Bool` interface + `isBool` predicate for future dialect-agnostic detection. `isNull` / `isNotNull` / `.in()` stay on PG `Any` (not SqlValue): the shared `Bool.and(Bool | boolean)` vs concrete `types.Bool.and(types.Bool | boolean)` are contravariantly incompatible, and duplicating three method bodies per dialect is cheaper than plumbing around the variance. SqlValue is *sibling* to Sql (not subclass) — matches the pre-existing design and avoids inheriting Sql's abstract `bind()` down the whole concrete-type chain. Values are duck-type-spliced into sql\`...\` templates via `.toSql()`. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/sql.ts | 4 +- src/driver.ts | 8 +- src/types/any.ts | 208 ++++++++++++++++++++++++++++ src/types/bool.ts | 32 +++++ src/types/deserialize.ts | 14 +- src/types/postgres/generate.ts | 13 +- src/types/postgres/generated/any.ts | 3 +- src/types/postgres/overrides/any.ts | 194 +++++--------------------- src/types/runtime.ts | 2 +- 9 files changed, 303 insertions(+), 175 deletions(-) create mode 100644 src/types/any.ts create mode 100644 src/types/bool.ts diff --git a/src/builder/sql.ts b/src/builder/sql.ts index ea87234..6afc8c7 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -1,12 +1,12 @@ import type { Database } from "../database"; -import type { Dialect } from "../types/deserialize"; +import type { DialectName } from "../types/deserialize"; export type CompiledSql = { text: string; values: unknown[] }; // Threaded through bind() and compile() so dialect-aware nodes (Cast, // Scalar, future per-dialect operator emission) can dispatch without // baking dialect into the node at construction time. -export type CompileContext = { dialect: Dialect }; +export type CompileContext = { dialect: DialectName }; export const pgCtx: CompileContext = { dialect: "postgres" }; export const sqliteCtx: CompileContext = { dialect: "sqlite" }; diff --git a/src/driver.ts b/src/driver.ts index 03b8fa9..be50adc 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -1,6 +1,6 @@ import type { Sql } from "./builder/sql"; import { compile } from "./builder/sql"; -import type { Dialect } from "./types/deserialize"; +import type { DialectName } from "./types/deserialize"; import type pg from "pg"; // Rows come back as plain objects keyed by column name. Values are always @@ -10,7 +10,7 @@ export type QueryResult = { rows: { [key: string]: string }[] }; export type ExecuteFn = (query: Sql) => Promise; export interface Driver { - readonly dialect: Dialect; + readonly dialect: DialectName; execute: ExecuteFn; runInSingleConnection(cb: (execute: ExecuteFn) => Promise): Promise; close(): Promise; @@ -23,7 +23,7 @@ export interface Driver { // lets a missing peer fail late with a real module-not-found error rather // than at load time. export class PgDriver implements Driver { - readonly dialect: Dialect = "postgres"; + readonly dialect: DialectName = "postgres"; static async create( connectionString: string, @@ -77,7 +77,7 @@ type PgliteDb = { }; export class PgliteDriver implements Driver { - readonly dialect: Dialect = "postgres"; + readonly dialect: DialectName = "postgres"; static async create(): Promise { // eslint-disable-next-line no-restricted-syntax -- optional peer, see class comment diff --git a/src/types/any.ts b/src/types/any.ts new file mode 100644 index 0000000..6e6b41a --- /dev/null +++ b/src/types/any.ts @@ -0,0 +1,208 @@ +// Dialect-agnostic base class for typed SQL expressions. +// +// Every typegres value — PG's Int4, SQLite's Integer (future), either +// dialect's Bool, etc. — descends from SqlValue. Behavior that doesn't +// depend on the dialect (cast, coalesce, from, serialize, column, +// deserialize, toSql, [meta]) lives here. +// +// Methods that return a Bool (isNull, isNotNull, in) stay on each +// dialect's root class (`Any` for PG). Reason: the shared Bool +// interface has and/or/not with `Bool | boolean` args; each +// dialect's concrete Bool has narrower args (its own class), which +// makes the shared vs concrete return types contravariantly +// incompatible. Duplicating three method bodies per dialect is cheaper +// than plumbing a workaround; the shared surface stays clean. +// +// SqlValue is *sibling* to Sql, not a subclass. Typegres values expose +// `.toSql()` and are duck-type-spliced into sql`...` templates (see +// builder/sql.ts template handler). Keeping SqlValue outside the Sql +// hierarchy avoids inheriting Sql's abstract `bind()` down the whole +// concrete-type chain. +import { Cast, Column, Param, sql, Sql, TypedParam, Unbound } from "../builder/sql"; +import { isPlainData } from "../util"; +import { getTypeDef, type DialectName } from "./deserialize"; +import { meta } from "./runtime"; +import type { BoolClass } from "./bool"; +import type { NullOf } from "./runtime"; + +// Rich per-dialect descriptor. `name` is the string tag used by +// compile ctx / driver / deserialize registry; `root` and `bool` +// point at the dialect's canonical classes (used by isBool detection +// and by dialect roots' isNull/isNotNull/in bodies). +export interface Dialect { + readonly name: DialectName; + readonly root: typeof SqlValue; + readonly bool: BoolClass; +} + +type ColumnOpts = { nonNull?: boolean; default?: Sql; generated?: boolean }; + +export class SqlValue { + // [meta] is an internal bag keyed by a symbol so it doesn't clutter + // autocomplete. __class is runtime-set (see from()); __raw holds the + // underlying Sql node for this expression; __nullability is a phantom + // that makes N structurally visible so TS distinguishes e.g. Text<0> + // from Text<0|1>. + declare [meta]: { + __class: typeof SqlValue; + __raw: Sql; + __nullability: N; + __aggregate: SqlValue; + }; + + // Dialect descriptor. Each dialect's root class overrides this; leaf + // classes inherit through the prototype chain. Kept as a static so + // `this.constructor.dialect` reaches it from any instance. + static dialect: Dialect; + + // __typname: the dialect type name as a SQL fragment (for use in + // templates like `CAST(x AS int4)`). __typnameText: the same name as + // a plain string (for map lookups, error messages). Codegen emits both. + static __typname: Sql; + static __typnameText: string; + + deserialize(raw: string): unknown { + const cls = this.constructor as typeof SqlValue; + return getTypeDef(cls.dialect.name, cls.__typnameText).deserialize(raw); + } + + // Returns the underlying Sql node for embedding in other expressions + toSql(): Sql { + return this[meta].__raw; + } + + // CAST this expression to another dialect type, preserving nullability. + // Three cases, in order: + // - N is `number` (aggregate context) → target's __aggregate variant + // - N is exactly 1 (non-null) → target's __nonNullable variant + // - otherwise (0, or 0|1) → target's __nullable variant + cast( + cls: T, + ): [number] extends [N] + ? (InstanceType extends { [meta]: { __aggregate: infer U } } ? U : InstanceType) + : [N] extends [1] + ? (InstanceType extends { [meta]: { __nonNullable: infer U } } ? U : InstanceType) + : (InstanceType extends { [meta]: { __nullable: infer U } } ? U : InstanceType) { + return cls.from(new Cast(this.toSql(), cls.__typname)) as any; + } + + // COALESCE(this, rhs) — returns first non-null. Chainable. + // rhs must be same concrete type (via [meta].__any). If rhs is non-null, returns __nonNullable. + coalesce, R extends (T extends { [meta]: { __any: infer A } } ? A : SqlValue)>( + this: T, + rhs: R, + ): 0 extends NullOf + ? T // rhs can be null → preserve T (still nullable) + : (T extends { [meta]: { __nonNullable: infer U } } ? U : T) { // rhs is non-null → __nonNullable + return this[meta].__class.from(sql`COALESCE(${this.toSql()}, ${rhs.toSql()})`) as any; + } + + // Public constructor alternative with precise nullability. + // Sql → nullable (0|1), primitive → non-null (1). + static from(this: T, v: Sql): InstanceType extends { [meta]: { __nullable: infer U } } ? U : InstanceType; + static from(this: T, v: unknown): InstanceType extends { [meta]: { __nonNullable: infer U } } ? U : InstanceType; + static from(v: Sql | unknown): any { + const instance = new this(); + let __raw: Sql; + if (v instanceof Sql) { + __raw = v; + } else { + // Reject class instances — they almost always indicate a bug. + // The historical case: passing an SqlValue expression to .from() + // silently wraps it as `Param(anAny)` which serializes as `{}`, + // producing either invalid SQL or a confusing cast error far + // from the call site. Plain objects (jsonb), arrays, nulls, + // and primitives are fine. + if (!isPlainData(v)) { + const name = (Object.getPrototypeOf(v) as { constructor?: { name?: string } } | null)?.constructor?.name ?? "anonymous"; + throw new TypeError( + `${this.__typnameText}.from: cannot wrap ${name} instance as a typegres parameter. ` + + `If this is a typegres expression, pass its .toSql() result; ` + + `otherwise extract the primitive value first.`, + ); + } + __raw = new TypedParam(new Param(v), this.__typname); + } + // Set [meta] at runtime — subclasses' `declare [meta]` narrows the type only + Object.defineProperty(instance, meta, { + value: { __class: this, __raw }, + enumerable: false, + }); + return instance; + } + + // Internal: validate and wrap a TS value into a typed instance. + // Used by match() for runtime overload dispatch. + static serialize(v: unknown): SqlValue { + if (v instanceof this) { return v; } + const expected = getTypeDef(this.dialect.name, this.__typnameText).tsType; + if (typeof v === expected) { return this.from(v); } + throw new Error( + `${this.__typnameText}.serialize: expected a ${this.__typnameText} instance or ${expected} primitive, got ${typeof v} (${String(v).slice(0, 60)}).`, + ); + } + + // Column declaration for Table definitions. The field name doubles as + // the column name: + // + // class Users extends Table("users") { + // id = Int8.column({ nonNull: true }); + // } + // + // Underlying Sql is sql.unbound() — a sentinel that throws if emitted. + // The query builder calls reAlias() on the row shape before compiling, + // swapping each column's unbound SQL for a real `Column(alias, key)` + // against a freshly-minted scope alias. + // + // __required is a type-level brand used by InsertRow to distinguish + // required vs optional columns. + static column< + T extends typeof SqlValue, + Opts extends ColumnOpts = {}, + >( + this: T, + _opts?: Opts, + ): InstanceType & { + [meta]: { + __required: Opts extends { nonNull: true } + ? Opts extends { default: any } | { generated: true } ? false : true + : false; + }; + } { + return this.from(sql.unbound()) as any; + } +} + +// True iff `v` is a SqlValue whose underlying SQL is the sql.unbound() +// sentinel — i.e., it was declared via `.column()` on a Table class, not +// built as an arbitrary expression. Dialect-agnostic. +export const isColumn = (v: unknown): v is SqlValue => + v instanceof SqlValue && v[meta].__raw instanceof Unbound; + +// Look up a column by name on a Table instance. Throws with a specific +// message when the field is missing or is an expression rather than a +// column declaration. Used by mutation builders and live wrappers. +export const getColumn = ( + instance: { constructor: { tableName: string } }, + name: string, +): SqlValue => { + const col = (instance as { [k: string]: unknown })[name]; + const tableName = instance.constructor.tableName; + if (!(col instanceof SqlValue)) { + throw new Error( + `No column '${name}' on table '${tableName}'. ` + + `Declare it as a field: \`${name} = Type.column(...)\`.`, + ); + } + // A column declaration's SQL is either Unbound (un-aliased rowType) or a + // Column ref (after reAlias by a builder's finalize). Compound shapes + // (Op, Func, ...) mean the field was assigned an expression, not declared. + const raw = col[meta].__raw; + if (!(raw instanceof Unbound) && !(raw instanceof Column)) { + throw new Error( + `Field '${name}' on table '${tableName}' is an expression, not a column. ` + + `Only fields declared via \`Type.column(...)\` can be targeted by mutations.`, + ); + } + return col; +}; diff --git a/src/types/bool.ts b/src/types/bool.ts new file mode 100644 index 0000000..57e7c06 --- /dev/null +++ b/src/types/bool.ts @@ -0,0 +1,32 @@ +// Dialect-agnostic Bool interface. Each dialect ships a concrete Bool +// class; the shared surface for `.isNull()`, `.in()`, etc. is captured +// here so SqlValue can return `Bool` without importing a concrete +// class from either dialect. +// +// isBool detection uses `v.constructor === v.constructor.dialect.bool` +// — each dialect's Bool class is the canonical value of `dialect.bool`, +// so the identity check is enough. No separate marker symbol needed. +import type { Sql } from "../builder/sql"; +import { SqlValue } from "./any"; +import type { StrictNull, NullOf } from "./runtime"; + +export interface Bool extends SqlValue { + and | boolean>(other: M): Bool>>; + or | boolean>(other: M): Bool>>; + not(): Bool; +} + +// Constructor / static surface each dialect's Bool exposes. SqlValue's +// isNull/isNotNull/in reach through `dialect.bool.from(...)` at call time. +export interface BoolClass { + from(v: Sql): Bool<0 | 1>; + from(v: unknown): Bool<1>; + readonly __typname: Sql; + readonly __typnameText: string; +} + +export const isBool = (v: unknown): v is Bool => + v instanceof SqlValue && + // v.constructor is typed as Function; compare against the dialect's + // Bool class (a distinct nominal type from Function) via unknown. + (v.constructor as unknown) === (v.constructor as typeof SqlValue).dialect.bool; diff --git a/src/types/deserialize.ts b/src/types/deserialize.ts index 3cbf463..95b9360 100644 --- a/src/types/deserialize.ts +++ b/src/types/deserialize.ts @@ -1,13 +1,19 @@ // Dialect-aware registry: pg typname / sqlite typname → TS type + deserializer. // Each dialect's package registers its own table via registerDialect(). // Types not listed default to: tsType = "string", deserialize = identity. +// +// This module only knows about the *name* of a dialect ("postgres" | +// "sqlite"). The richer `Dialect` object with class references +// (SqlValue root, Bool class) lives in `./any.ts` — the two are +// intentionally separated so driver / compile-context code can talk +// about dialects without pulling in the type system. export interface TypeDef { tsType: string; deserialize: (raw: string) => unknown; } -export type Dialect = "postgres" | "sqlite"; +export type DialectName = "postgres" | "sqlite"; const identity = (raw: string): string => raw; @@ -16,14 +22,14 @@ export const defaultTypeDef: TypeDef = { deserialize: identity, }; -const registries = new Map(); +const registries = new Map(); export const registerDialect = ( - dialect: Dialect, + dialect: DialectName, reg: { [key: string]: TypeDef }, ): void => { registries.set(dialect, reg); }; -export const getTypeDef = (dialect: Dialect, typname: string): TypeDef => +export const getTypeDef = (dialect: DialectName, typname: string): TypeDef => registries.get(dialect)?.[typname] ?? defaultTypeDef; diff --git a/src/types/postgres/generate.ts b/src/types/postgres/generate.ts index 3739808..6d37408 100644 --- a/src/types/postgres/generate.ts +++ b/src/types/postgres/generate.ts @@ -211,13 +211,20 @@ const generateTypeFile = ( // clauses evaluate at module-load time, and the barrel may not have finished // loading when this file runs. Method bodies use `types.X` freely — those // are lazy, so load order doesn't matter. + // + // The root `any` type extends the shared dialect-agnostic `SqlValue` + // base (which provides cast/coalesce/from/serialize/column/deserialize + // /isNull/isNotNull/in). Everything else chains down through the pg_catalog + // hierarchy to `any`, so those methods are inherited transitively. const parentTypname = pgType.typname === "any" ? undefined : extendsClass ? Object.keys(EXTENDS_MAP).find((k) => pgNameToClassName(k) === extendsClass) ?? "any" : "anynonarray"; - if (parentTypname) { + if (pgType.typname === "any") { + lines.push('import { SqlValue } from "../../any";'); + } else if (parentTypname) { const parentClass = pgNameToClassName(parentTypname); const dir = overrideNames.has(parentTypname) ? "overrides" : "generated"; lines.push(`import { ${parentClass} } from "../${dir}/${parentTypname}";`); @@ -243,7 +250,9 @@ const generateTypeFile = ( classDecl += parentIsContainer ? ` extends ${extendsClass}` : ` extends ${extendsClass}`; - } else if (pgType.typname !== "any") { + } else if (pgType.typname === "any") { + classDecl += ` extends SqlValue`; + } else { classDecl += ` extends Anynonarray`; } classDecl += " {"; diff --git a/src/types/postgres/generated/any.ts b/src/types/postgres/generated/any.ts index 1305b11..f5847ba 100644 --- a/src/types/postgres/generated/any.ts +++ b/src/types/postgres/generated/any.ts @@ -1,9 +1,10 @@ // Auto-generated — do not edit import * as runtime from "../../runtime"; import { expose } from "../../../exoeval/tool"; +import { SqlValue } from "../../any"; import * as types from "../index"; -export class Any { +export class Any extends SqlValue { @expose.unchecked() numNonnulls(): types.Int4<1> { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("num_nonnulls", [this, ...__rest], __rt) as any; } @expose.unchecked() diff --git a/src/types/postgres/overrides/any.ts b/src/types/postgres/overrides/any.ts index 9863080..256a469 100644 --- a/src/types/postgres/overrides/any.ts +++ b/src/types/postgres/overrides/any.ts @@ -1,43 +1,46 @@ +// PG-side root class. Sits above the pg_catalog codegen'd `Generated` +// (which provides all pg_catalog method surface) and below the leaf +// concrete types (Int4, Text, Bool, ...). Carries the PG-specific +// static metadata plus the three Bool-returning methods (isNull, +// isNotNull, in) that couldn't live on `SqlValue` — see any.ts docstring +// for the variance reason. +// +// `dialect.root` / `dialect.bool` use barrel-import getters so the +// class-level dialect object can be initialized at class-def time +// without resolving the cyclic references at import time. Property +// access happens at method-call time, by which point the barrel has +// finished loading. import { Any as Generated } from "../generated/any"; -import { getTypeDef, type Dialect } from "../../deserialize"; -import "../deserialize"; +import type { Dialect } from "../../any"; import { meta } from "../../runtime"; import type { NullOf, StrictNull, TsTypeOf } from "../../runtime"; -import { Cast, Column, Param, sql, Sql, TypedParam, Unbound } from "../../../builder/sql"; +import * as types from "../index"; +import { sql, type Sql } from "../../../builder/sql"; import { expose } from "../../../exoeval/tool"; import { isPlainData } from "../../../util"; -import * as types from "../index"; - -type ColumnOpts = { nonNull?: boolean; default?: Sql; generated?: boolean }; +// Side-effect import: registers the PG dialect's deserialize table +// (see ../deserialize.ts). The barrel imports this file, so importing +// any pg type transitively populates the registry before any typed +// value gets constructed. +import "../deserialize"; export class Any extends Generated { - // [meta] is an internal bag keyed by a symbol so it doesn't clutter - // autocomplete. __class is runtime-set (see from()); __raw holds the - // underlying Sql node for this expression; __nullability is a phantom - // that makes N structurally visible so TS distinguishes e.g. Text<0> - // from Text<0|1>. + // Narrow SqlValue's `[meta].__aggregate: SqlValue` to + // `Any` so the pg_catalog aggregate row type stays PG-shaped + // rather than collapsing to the bare shared base. declare [meta]: { __class: typeof Any; __raw: Sql; __nullability: N; __aggregate: Any; }; - // __typname: the pg type name as a SQL fragment (for use in templates - // like `CAST(x AS int4)`). __typnameText: the same name as a plain - // string (for map lookups, error messages). Codegen emits both. - static __typname: Sql = sql`any`; - static __typnameText = "any"; - static dialect: Dialect = "postgres"; - - deserialize(raw: string): unknown { - const cls = this.constructor as typeof Any; - return getTypeDef(cls.dialect, cls.__typnameText).deserialize(raw); - } - - // Returns the underlying Sql node for embedding in other expressions - toSql(): Sql { - return this[meta].__raw; - } + static override dialect: Dialect = { + name: "postgres", + get root() { return types.Any; }, + get bool() { return types.Bool; }, + }; + static override __typname = sql`any`; + static override __typnameText = "any"; isNull(): types.Bool<1> { return types.Bool.from(sql`(${this.toSql()} IS NULL)`) as types.Bool<1>; @@ -47,21 +50,6 @@ export class Any extends Generated { return types.Bool.from(sql`(${this.toSql()} IS NOT NULL)`) as types.Bool<1>; } - // CAST this expression to another pg type, preserving nullability. - // Three cases, in order: - // - N is `number` (aggregate context) → target's __aggregate variant - // - N is exactly 1 (non-null) → target's __nonNullable variant - // - otherwise (0, or 0|1) → target's __nullable variant - cast( - cls: T, - ): [number] extends [N] - ? (InstanceType extends { [meta]: { __aggregate: infer U } } ? U : InstanceType) - : [N] extends [1] - ? (InstanceType extends { [meta]: { __nonNullable: infer U } } ? U : InstanceType) - : (InstanceType extends { [meta]: { __nullable: infer U } } ? U : InstanceType) { - return cls.from(new Cast(this.toSql(), cls.__typname)) as any; - } - // Type-safe IN. Accepts a vararg of "this type at any nullability" // — including primitive values that the type knows how to serialize. // For `Text`, that means `.in("a", "b", textVal)` all work. Always @@ -99,124 +87,8 @@ export class Any extends Generated { const list = sql.join(wrapped.map((v) => v.toSql())); return types.Bool.from(sql`(${this.toSql()} IN (${list}))`) as unknown as types.Bool | NullOf>>; } - - // COALESCE(this, rhs) — returns first non-null. Chainable. - // rhs must be same concrete type (via [meta].__any). If rhs is non-null, returns __nonNullable. - coalesce, R extends (T extends { [meta]: { __any: infer A } } ? A : Any)>( - this: T, - rhs: R, - ): 0 extends NullOf - ? T // rhs can be null → preserve T (still nullable) - : (T extends { [meta]: { __nonNullable: infer U } } ? U : T) { // rhs is non-null → __nonNullable - return this[meta].__class.from(sql`COALESCE(${this.toSql()}, ${rhs.toSql()})`) as any; - } - - // Public constructor alternative with precise nullability. - // Sql → nullable (0|1), primitive → non-null (1). - static from(this: T, v: Sql): InstanceType extends { [meta]: { __nullable: infer U } } ? U : InstanceType; - static from(this: T, v: unknown): InstanceType extends { [meta]: { __nonNullable: infer U } } ? U : InstanceType; - static from(v: Sql | unknown): any { - const instance = new this(); - let __raw: Sql; - if (v instanceof Sql) { - __raw = v; - } else { - // Reject class instances — they almost always indicate a bug. - // The historical case: passing an Any expression to .from() - // silently wraps it as `Param(anAny)` which serializes as `{}`, - // producing either invalid SQL or a confusing cast error far - // from the call site. Plain objects (jsonb), arrays, nulls, - // and primitives are fine. - if (!isPlainData(v)) { - const name = (Object.getPrototypeOf(v) as { constructor?: { name?: string } } | null)?.constructor?.name ?? "anonymous"; - throw new TypeError( - `${this.__typnameText}.from: cannot wrap ${name} instance as a typegres parameter. ` + - `If this is a typegres expression, pass its .toSql() result; ` + - `otherwise extract the primitive value first.`, - ); - } - __raw = new TypedParam(new Param(v), this.__typname); - } - // Set [meta] at runtime — subclasses' `declare [meta]` narrows the type only - Object.defineProperty(instance, meta, { - value: { __class: this, __raw }, - enumerable: false, - }); - return instance; - } - - // Internal: validate and wrap a TS value into a typed instance. - // Used by match() for runtime overload dispatch. - static serialize(v: unknown): Any { - if (v instanceof this) { return v; } - const expected = getTypeDef(this.dialect, this.__typnameText).tsType; - if (typeof v === expected) { return this.from(v); } - throw new Error( - `${this.__typnameText}.serialize: expected a ${this.__typnameText} instance or ${expected} primitive, got ${typeof v} (${String(v).slice(0, 60)}).`, - ); - } - - // Column declaration for Table definitions. The field name doubles as - // the pg column name: - // - // class Users extends Table("users") { - // id = Int8.column({ nonNull: true }); - // } - // - // Underlying Sql is sql.unbound() — a sentinel that throws if emitted. - // The query builder calls reAlias() on the row shape before compiling, - // swapping each column's unbound SQL for a real `Column(alias, key)` - // against a freshly-minted scope alias. - // - // __required is a type-level brand used by InsertRow to distinguish - // required vs optional columns. - static column< - T extends typeof Any, - Opts extends ColumnOpts = {}, - >( - this: T, - _opts?: Opts, - ): InstanceType & { - [meta]: { - __required: Opts extends { nonNull: true } - ? Opts extends { default: any } | { generated: true } ? false : true - : false; - }; - } { - return this.from(sql.unbound()) as any; - } } -// True iff `v` is an Any whose underlying SQL is the sql.unbound() sentinel -// — i.e., it was declared via `.column()` on a Table class, not built as -// an arbitrary expression. -export const isColumn = (v: unknown): v is Any => - v instanceof Any && v[meta].__raw instanceof Unbound; - -// Look up a column by name on a Table instance. Throws with a specific -// message when the field is missing or is an expression rather than a -// column declaration. Used by mutation builders and live wrappers. -export const getColumn = ( - instance: { constructor: { tableName: string } }, - name: string, -): Any => { - const col = (instance as { [k: string]: unknown })[name]; - const tableName = instance.constructor.tableName; - if (!(col instanceof Any)) { - throw new Error( - `No column '${name}' on table '${tableName}'. ` + - `Declare it as a field: \`${name} = Type.column(...)\`.`, - ); - } - // A column declaration's SQL is either Unbound (un-aliased rowType) or a - // Column ref (after reAlias by a builder's finalize). Compound shapes - // (Op, Func, ...) mean the field was assigned an expression, not declared. - const raw = col[meta].__raw; - if (!(raw instanceof Unbound) && !(raw instanceof Column)) { - throw new Error( - `Field '${name}' on table '${tableName}' is an expression, not a column. ` + - `Only fields declared via \`Type.column(...)\` can be targeted by mutations.`, - ); - } - return col; -}; +// Re-export shared column helpers under this module's path so existing +// PG-side callers keep working without pinning to `src/types/any.ts`. +export { isColumn, getColumn } from "../../any"; diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 7256bff..86ea220 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -125,7 +125,7 @@ export const match = (args: unknown[], cases: MatchCase[]): [typeof Any, ...unkn return true; } if (m.allowPrimitive) { - const expected = getTypeDef(m.type.dialect, m.type.__typnameText).tsType; + const expected = getTypeDef(m.type.dialect.name, m.type.__typnameText).tsType; if (typeof arg === expected) { return true; } From f6c09cef898caf836424d10051ceacac72275067 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 12:41:46 -0700 Subject: [PATCH 07/33] feat(sqlite): initial SQLite dialect scaffold + runtime inference tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 1 foundation. Introduces: - `SqliteValue` (src/types/sqlite/base.ts) — dialect root, extends the shared `SqlValue`. Carries the SQLite `Dialect` object (barrel-getter root/bool) plus `isNull`/`isNotNull`. `.in()` is deferred: its `(this: T, ...)` shape triggers TS2589 at SQLite's flatter class hierarchy (see file comment). - `src/types/sqlite/deserialize.ts` — dialect entries for the registry. Registers on module load, same side-effect pattern PG uses. Bool is a convention (INTEGER 0/1); blob repr TBD (better-sqlite3 → Buffer, Cloudflare DO → ArrayBuffer — reconcile at driver layer). - `src/types/sqlite/generate.ts` — runtime introspection tool that reads `pragma_function_list`, probes each function through a typed input matrix, and emits both a JSON snapshot (`functions.json`, ~20k lines) and first-pass class stubs (`generated/{integer,real, text,blob}.ts`). Bool is hand-written (via boolAnd/boolOr/boolNot helpers from Phase 0.5). Known limits — runtime probing conflates null-propagation with error-signal nulls, admits nonsensical coercions (Blob.acos exists), misbuckets aggregates onto whichever leaf type they were probed with, and collapses multi-arity overloads. Detailed follow-up plan in the generate.ts header comment: LLM-over-docs with this file as a deterministic sanity check. better-sqlite3 added as a devDependency (codegen only; peer-dep plumbing lands with the driver in Phase 4). Co-Authored-By: Claude Opus 4.7 (1M context) --- package-lock.json | 483 +- package.json | 2 + src/types/sqlite/base.ts | 56 + src/types/sqlite/deserialize.ts | 29 + src/types/sqlite/functions.json | 19931 ++++++++++++++++++++++++ src/types/sqlite/generate.ts | 411 + src/types/sqlite/generated/blob.ts | 252 + src/types/sqlite/generated/bool.ts | 40 + src/types/sqlite/generated/integer.ts | 372 + src/types/sqlite/generated/real.ts | 354 + src/types/sqlite/generated/text.ts | 210 + src/types/sqlite/index.ts | 11 + 12 files changed, 22149 insertions(+), 2 deletions(-) create mode 100644 src/types/sqlite/base.ts create mode 100644 src/types/sqlite/deserialize.ts create mode 100644 src/types/sqlite/functions.json create mode 100644 src/types/sqlite/generate.ts create mode 100644 src/types/sqlite/generated/blob.ts create mode 100644 src/types/sqlite/generated/bool.ts create mode 100644 src/types/sqlite/generated/integer.ts create mode 100644 src/types/sqlite/generated/real.ts create mode 100644 src/types/sqlite/generated/text.ts create mode 100644 src/types/sqlite/index.ts diff --git a/package-lock.json b/package-lock.json index ff228b2..cae7f9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "typegres", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "typegres", - "version": "0.1.0", + "version": "0.2.0", "dependencies": { "camelcase": "^9.0.0" }, @@ -19,12 +19,14 @@ "@standard-schema/spec": "^1.1.0", "@swc/core": "^1.15.32", "@types/acorn": "^4.0.6", + "@types/better-sqlite3": "^7.6.13", "@types/node": "^25.6.0", "@types/pg": "^8.20.0", "@typescript-eslint/eslint-plugin": "^8.59.0", "@typescript-eslint/parser": "^8.59.0", "@typescript/native-preview": "^7.0.0-dev.20260422.1", "acorn": "^8.16.0", + "better-sqlite3": "^12.11.1", "eslint": "^10.2.1", "pg": "^8.20.0", "prettier": "^3.8.3", @@ -1017,6 +1019,16 @@ "@types/estree": "*" } }, + "node_modules/@types/better-sqlite3": { + "version": "7.6.13", + "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.13.tgz", + "integrity": "sha512-NMv9ASNARoKksWtsq/SHakpYAYnhBrQgGD8zkLYk/jaK8jUGn08CfEdTRgYhMypUQAfzSP8W6gNLe0q19/t4VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/chai": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", @@ -1636,6 +1648,52 @@ "node": "18 || 20 || >=22" } }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/better-sqlite3": { + "version": "12.11.1", + "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.11.1.tgz", + "integrity": "sha512-dq9AtApgg5PGFtBzPFSBl3HZQjHok5gaQCM6zh2Yk0aSmDCs1CbnVI8/HgASQkNKsWFpseIO9beg5xxpYhbIfA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "bindings": "^1.5.0", + "prebuild-install": "^7.1.1" + }, + "engines": { + "node": "20.x || 22.x || 23.x || 24.x || 25.x || 26.x" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, "node_modules/birpc": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/birpc/-/birpc-4.0.0.tgz", @@ -1646,6 +1704,18 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/brace-expansion": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", @@ -1659,6 +1729,31 @@ "node": "18 || 20 || >=22" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/cac": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cac/-/cac-7.0.0.tgz", @@ -1691,6 +1786,13 @@ "node": ">=18" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "license": "ISC" + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -1731,6 +1833,32 @@ } } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -1786,6 +1914,16 @@ "node": ">=14" } }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/es-module-lexer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", @@ -2004,6 +2142,16 @@ "node": ">=0.10.0" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, "node_modules/expect-type": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", @@ -2066,6 +2214,13 @@ "node": ">=16.0.0" } }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "license": "MIT" + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2104,6 +2259,13 @@ "dev": true, "license": "ISC" }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "license": "MIT" + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -2132,6 +2294,13 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true, + "license": "MIT" + }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -2152,6 +2321,27 @@ "dev": true, "license": "MIT" }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", @@ -2185,6 +2375,20 @@ "node": ">=0.8.19" } }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC" + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2570,6 +2774,19 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "10.2.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", @@ -2586,6 +2803,23 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true, + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2612,6 +2846,13 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "dev": true, + "license": "MIT" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -2619,6 +2860,19 @@ "dev": true, "license": "MIT" }, + "node_modules/node-abi": { + "version": "3.93.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.93.0.tgz", + "integrity": "sha512-Cu6yUpX5Iavugm8BeX7c0wgU9CvOqfd1yM6A1d2q2ZMjym7GjpASv2GdRcTq3Fx+Sb5OgBkEEpw4VnAbY6Y5RA==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/obug": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", @@ -2630,6 +2884,16 @@ ], "license": "MIT" }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -2896,6 +3160,34 @@ "node": ">=0.10.0" } }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "deprecated": "No longer maintained. Please contact the author of the relevant native addon; alternatives are available.", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -2922,6 +3214,17 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/pump": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -2949,6 +3252,37 @@ ], "license": "MIT" }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", @@ -3039,6 +3373,27 @@ } } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/secure-json-parse": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.1.0.tgz", @@ -3099,6 +3454,53 @@ "dev": true, "license": "ISC" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -3133,6 +3535,56 @@ "dev": true, "license": "MIT" }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tar-fs": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.5.tgz", + "integrity": "sha512-OboTd8mmMhZDNPV+UjQcK9yKAatXu2aJ+r1w4im1Otd4M4fl2hwvdoXUxIYHFTHWK/3y3FarBP70v3vwmGlOxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -3274,6 +3726,19 @@ "license": "0BSD", "optional": true }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3390,6 +3855,13 @@ "punycode": "^2.1.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, "node_modules/vite": { "version": "8.0.9", "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.9.tgz", @@ -3939,6 +4411,13 @@ "node": ">=0.10.0" } }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index d22bfe7..bb5a5fa 100644 --- a/package.json +++ b/package.json @@ -63,12 +63,14 @@ "@standard-schema/spec": "^1.1.0", "@swc/core": "^1.15.32", "@types/acorn": "^4.0.6", + "@types/better-sqlite3": "^7.6.13", "@types/node": "^25.6.0", "@types/pg": "^8.20.0", "@typescript-eslint/eslint-plugin": "^8.59.0", "@typescript-eslint/parser": "^8.59.0", "@typescript/native-preview": "^7.0.0-dev.20260422.1", "acorn": "^8.16.0", + "better-sqlite3": "^12.11.1", "eslint": "^10.2.1", "pg": "^8.20.0", "prettier": "^3.8.3", diff --git a/src/types/sqlite/base.ts b/src/types/sqlite/base.ts new file mode 100644 index 0000000..161ab9d --- /dev/null +++ b/src/types/sqlite/base.ts @@ -0,0 +1,56 @@ +// SQLite-side root class. Sits directly below `SqlValue` (SQLite has +// no polymorphic pseudotype hierarchy the way PG does — Integer, Text, +// Real, Blob, Json, Bool all extend SqliteValue directly). +// +// Mirrors PG `Any`: carries dialect metadata + the three Bool-returning +// methods (isNull/isNotNull/in) that couldn't live on the shared +// SqlValue for variance reasons (see src/types/any.ts docstring). +// +// `dialect.root` / `dialect.bool` use barrel-import getters so the +// class-level dialect object can be initialized at class-def time +// without resolving the cyclic references at import time. Property +// access happens at method-call time. +// +import { SqlValue, type Dialect } from "../any"; +import { meta } from "../runtime"; +import * as types from "./index"; +import { sql, type Sql } from "../../builder/sql"; +// Side-effect import: registers the SQLite dialect's deserialize table. +import "./deserialize"; + +export class SqliteValue extends SqlValue { + declare [meta]: { + __class: typeof SqliteValue; + __raw: Sql; + __nullability: N; + __aggregate: SqliteValue; + }; + static override dialect: Dialect = { + name: "sqlite", + get root() { return types.SqliteValue; }, + get bool() { return types.Bool; }, + }; + static override __typname = sql`any`; + static override __typnameText = "any"; + + isNull(): types.Bool<1> { + return types.Bool.from(sql`(${this.toSql()} IS NULL)`) as types.Bool<1>; + } + + isNotNull(): types.Bool<1> { + return types.Bool.from(sql`(${this.toSql()} IS NOT NULL)`) as types.Bool<1>; + } + +} + +// `.in()` deferred: putting the PG-style generic `.in(this: T, ...)` +// on SqliteValue triggers TS2589 (excessively deep type instantiation) +// during variance inference at concrete leaves like Bool. PG dodges this +// because its type hierarchy is deep enough (7 levels) that TS bottoms +// out on structural variance before recursing into `.in`. SQLite's +// flat hierarchy hits the recursion at shallower depth. +// +// Options for later: (1) codegen `.in()` per concrete type (like pg does +// for '='); (2) add a non-generic `.in()` on SqliteValue; (3) find a way +// to force TS to stop the recursion. Deferring — isNull/isNotNull are +// enough for the phase-1 foundation. diff --git a/src/types/sqlite/deserialize.ts b/src/types/sqlite/deserialize.ts new file mode 100644 index 0000000..34eab9b --- /dev/null +++ b/src/types/sqlite/deserialize.ts @@ -0,0 +1,29 @@ +// SQLite-side wire-format deserializers. +// +// Unlike PG (where every value comes back as a raw string and needs +// per-type parsing), better-sqlite3 hands us typed JS values directly +// — integers as number (or bigint under safeIntegers), reals as number, +// text as string, blobs as Buffer/Uint8Array. So `deserialize` is +// identity for most types; the registry mainly exists to teach the +// overload matcher what TS primitive each SQLite type accepts. +// +// Bool is a convention: SQLite stores 0/1 as INTEGER. `bool` here is the +// registry key (not a native SQLite storage class); `Bool.__typname` +// still emits `INTEGER` in CAST expressions. +import { registerDialect, type TypeDef } from "../deserialize.ts"; + +const identity = (raw: string): string => raw; +const parseIntFromText = (raw: string): number => parseInt(raw, 10); + +export const sqliteRegistry: { [key: string]: TypeDef } = { + integer: { tsType: "number", deserialize: parseIntFromText }, + real: { tsType: "number", deserialize: parseFloat }, + text: { tsType: "string", deserialize: identity }, + // Blob deserialize is a placeholder — the driver returns Buffer + // directly, so this path is only used if a raw string sneaks in. + // Real repr TBD (Buffer? Uint8Array? hex? see plan.md A1). + blob: { tsType: "object", deserialize: identity }, + bool: { tsType: "boolean", deserialize: (raw) => raw === "1" }, +}; + +registerDialect("sqlite", sqliteRegistry); diff --git a/src/types/sqlite/functions.json b/src/types/sqlite/functions.json new file mode 100644 index 0000000..bfc2b11 --- /dev/null +++ b/src/types/sqlite/functions.json @@ -0,0 +1,19931 @@ +{ + "sqlite_version": "3.53.2", + "generated_at": "2026-07-01T19:36:51.469Z", + "function_count": 197, + "functions": { + "->": [ + { + "name": "->", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "integer", + "real" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "integer", + "text" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "integer", + "null" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "real", + "integer" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "real", + "real" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "real", + "text" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "real", + "blob" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "real", + "null" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "text", + "integer" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "text", + "real" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "text", + "text" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "text", + "blob" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "text", + "null" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "blob", + "real" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "blob", + "text" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "blob", + "null" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "null", + "integer" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "null", + "real" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "null", + "text" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "null", + "blob" + ], + "error": "near \"->\": syntax error" + }, + { + "args": [ + "null", + "null" + ], + "error": "near \"->\": syntax error" + } + ] + } + ], + "->>": [ + { + "name": "->>", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "integer", + "real" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "integer", + "text" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "integer", + "null" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "real", + "integer" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "real", + "real" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "real", + "text" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "real", + "blob" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "real", + "null" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "text", + "integer" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "text", + "real" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "text", + "text" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "text", + "blob" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "text", + "null" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "blob", + "real" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "blob", + "text" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "blob", + "null" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "null", + "integer" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "null", + "real" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "null", + "text" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "null", + "blob" + ], + "error": "near \"->>\": syntax error" + }, + { + "args": [ + "null", + "null" + ], + "error": "near \"->>\": syntax error" + } + ] + } + ], + "abs": [ + { + "name": "abs", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "real" + }, + { + "args": [ + "blob" + ], + "result": "real" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "acos": [ + { + "name": "acos", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "acosh": [ + { + "name": "acosh", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "asin": [ + { + "name": "asin", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "asinh": [ + { + "name": "asinh", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "atan": [ + { + "name": "atan", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "atan2": [ + { + "name": "atan2", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "real" + }, + { + "args": [ + "integer", + "real" + ], + "result": "real" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "atanh": [ + { + "name": "atanh", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "avg": [ + { + "name": "avg", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "real" + }, + { + "args": [ + "blob" + ], + "result": "real" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "bm25": [ + { + "name": "bm25", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "real" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "text" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "blob" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "null" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "integer", + "real" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "integer", + "text" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "integer", + "null" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "real", + "integer" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "real", + "real" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "real", + "text" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "real", + "blob" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "real", + "null" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "text", + "integer" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "text", + "real" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "text", + "text" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "text", + "blob" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "text", + "null" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "blob", + "real" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "blob", + "text" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "blob", + "null" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "null", + "integer" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "null", + "real" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "null", + "text" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "null", + "blob" + ], + "error": "unable to use function bm25 in the requested context" + }, + { + "args": [ + "null", + "null" + ], + "error": "unable to use function bm25 in the requested context" + } + ] + } + ], + "ceil": [ + { + "name": "ceil", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "ceiling": [ + { + "name": "ceiling", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "changes": [ + { + "name": "changes", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "integer" + } + ] + } + ], + "char": [ + { + "name": "char", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "text" + }, + { + "args": [ + "null", + "real" + ], + "result": "text" + }, + { + "args": [ + "null", + "text" + ], + "result": "text" + }, + { + "args": [ + "null", + "blob" + ], + "result": "text" + }, + { + "args": [ + "null", + "null" + ], + "result": "text" + } + ] + } + ], + "coalesce": [ + { + "name": "coalesce", + "type": "s", + "narg": -4, + "variadic": true, + "observations": [] + } + ], + "concat": [ + { + "name": "concat", + "type": "s", + "narg": -3, + "variadic": true, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "text" + }, + { + "args": [ + "null", + "real" + ], + "result": "text" + }, + { + "args": [ + "null", + "text" + ], + "result": "text" + }, + { + "args": [ + "null", + "blob" + ], + "result": "text" + }, + { + "args": [ + "null", + "null" + ], + "result": "text" + }, + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "text" + } + ] + } + ], + "concat_ws": [ + { + "name": "concat_ws", + "type": "s", + "narg": -4, + "variadic": true, + "observations": [] + } + ], + "cos": [ + { + "name": "cos", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "cosh": [ + { + "name": "cosh", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "count": [ + { + "name": "count", + "type": "w", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "integer" + } + ] + }, + { + "name": "count", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "integer" + } + ] + } + ], + "cume_dist": [ + { + "name": "cume_dist", + "type": "w", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "real" + } + ] + } + ], + "current_date": [ + { + "name": "current_date", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "error": "near \"(\": syntax error" + } + ] + } + ], + "current_time": [ + { + "name": "current_time", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "error": "near \"(\": syntax error" + } + ] + } + ], + "current_timestamp": [ + { + "name": "current_timestamp", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "error": "near \"(\": syntax error" + } + ] + } + ], + "date": [ + { + "name": "date", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "datetime": [ + { + "name": "datetime", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "degrees": [ + { + "name": "degrees", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "dense_rank": [ + { + "name": "dense_rank", + "type": "w", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "integer" + } + ] + } + ], + "exp": [ + { + "name": "exp", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "first_value": [ + { + "name": "first_value", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "floor": [ + { + "name": "floor", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "format": [ + { + "name": "format", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "fts3_tokenizer": [ + { + "name": "fts3_tokenizer", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "error": "unknown tokenizer: 1" + }, + { + "args": [ + "real" + ], + "error": "unknown tokenizer: 1.5" + }, + { + "args": [ + "text" + ], + "error": "unknown tokenizer: x" + }, + { + "args": [ + "blob" + ], + "error": "unknown tokenizer: \u0001" + }, + { + "args": [ + "null" + ], + "error": "unknown tokenizer: " + } + ] + }, + { + "name": "fts3_tokenizer", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "integer", + "real" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "integer", + "text" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "integer", + "null" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "real", + "integer" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "real", + "real" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "real", + "text" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "real", + "blob" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "real", + "null" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "text", + "integer" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "text", + "real" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "text", + "text" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "text", + "blob" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "text", + "null" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "blob", + "real" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "blob", + "text" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "blob", + "null" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "null", + "integer" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "null", + "real" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "null", + "text" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "null", + "blob" + ], + "error": "fts3tokenize disabled" + }, + { + "args": [ + "null", + "null" + ], + "error": "fts3tokenize disabled" + } + ] + } + ], + "fts5": [ + { + "name": "fts5", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "fts5_get_locale": [ + { + "name": "fts5_get_locale", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "real" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "text" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "blob" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "null" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "integer", + "real" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "integer", + "text" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "integer", + "null" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "real", + "integer" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "real", + "real" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "real", + "text" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "real", + "blob" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "real", + "null" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "text", + "integer" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "text", + "real" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "text", + "text" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "text", + "blob" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "text", + "null" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "blob", + "real" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "blob", + "text" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "blob", + "null" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "null", + "integer" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "null", + "real" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "null", + "text" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "null", + "blob" + ], + "error": "unable to use function fts5_get_locale in the requested context" + }, + { + "args": [ + "null", + "null" + ], + "error": "unable to use function fts5_get_locale in the requested context" + } + ] + } + ], + "fts5_insttoken": [ + { + "name": "fts5_insttoken", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "fts5_locale": [ + { + "name": "fts5_locale", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "real" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "text" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "null" + ], + "result": "blob" + }, + { + "args": [ + "real", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real", + "real" + ], + "result": "blob" + }, + { + "args": [ + "real", + "text" + ], + "result": "blob" + }, + { + "args": [ + "real", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "real", + "null" + ], + "result": "blob" + }, + { + "args": [ + "text", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "text", + "real" + ], + "result": "blob" + }, + { + "args": [ + "text", + "text" + ], + "result": "blob" + }, + { + "args": [ + "text", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "text", + "null" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "blob" + }, + { + "args": [ + "null", + "integer" + ], + "result": "text" + }, + { + "args": [ + "null", + "real" + ], + "result": "text" + }, + { + "args": [ + "null", + "text" + ], + "result": "text" + }, + { + "args": [ + "null", + "blob" + ], + "result": "text" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "fts5_source_id": [ + { + "name": "fts5_source_id", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "text" + } + ] + } + ], + "geopoly_area": [ + { + "name": "geopoly_area", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_bbox": [ + { + "name": "geopoly_bbox", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_blob": [ + { + "name": "geopoly_blob", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_ccw": [ + { + "name": "geopoly_ccw", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_contains_point": [ + { + "name": "geopoly_contains_point", + "type": "s", + "narg": 3, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_debug": [ + { + "name": "geopoly_debug", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_group_bbox": [ + { + "name": "geopoly_group_bbox", + "type": "a", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_json": [ + { + "name": "geopoly_json", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_overlap": [ + { + "name": "geopoly_overlap", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_regular": [ + { + "name": "geopoly_regular", + "type": "s", + "narg": 4, + "variadic": false, + "observations": [] + } + ], + "geopoly_svg": [ + { + "name": "geopoly_svg", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_within": [ + { + "name": "geopoly_within", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "geopoly_xform": [ + { + "name": "geopoly_xform", + "type": "s", + "narg": 7, + "variadic": false, + "observations": [] + } + ], + "glob": [ + { + "name": "glob", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "real" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "text" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real" + ], + "result": "integer" + }, + { + "args": [ + "real", + "text" + ], + "result": "integer" + }, + { + "args": [ + "real", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "text", + "real" + ], + "result": "integer" + }, + { + "args": [ + "text", + "text" + ], + "result": "integer" + }, + { + "args": [ + "text", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "real" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "null" + ], + "result": "integer" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "group_concat": [ + { + "name": "group_concat", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "group_concat", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "hex": [ + { + "name": "hex", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + } + ] + } + ], + "highlight": [ + { + "name": "highlight", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "real" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "text" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "blob" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "null" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "integer", + "real" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "integer", + "text" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "integer", + "null" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "real", + "integer" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "real", + "real" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "real", + "text" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "real", + "blob" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "real", + "null" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "text", + "integer" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "text", + "real" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "text", + "text" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "text", + "blob" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "text", + "null" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "blob", + "real" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "blob", + "text" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "blob", + "null" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "null", + "integer" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "null", + "real" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "null", + "text" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "null", + "blob" + ], + "error": "unable to use function highlight in the requested context" + }, + { + "args": [ + "null", + "null" + ], + "error": "unable to use function highlight in the requested context" + } + ] + } + ], + "if": [ + { + "name": "if", + "type": "s", + "narg": -4, + "variadic": true, + "observations": [] + } + ], + "ifnull": [ + { + "name": "ifnull", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "real" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "text" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "null" + ], + "result": "integer" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "real" + }, + { + "args": [ + "real", + "blob" + ], + "result": "real" + }, + { + "args": [ + "real", + "null" + ], + "result": "real" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "blob" + }, + { + "args": [ + "null", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "null", + "real" + ], + "result": "real" + }, + { + "args": [ + "null", + "text" + ], + "result": "text" + }, + { + "args": [ + "null", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "iif": [ + { + "name": "iif", + "type": "s", + "narg": -4, + "variadic": true, + "observations": [] + } + ], + "instr": [ + { + "name": "instr", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "real" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "text" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real" + ], + "result": "integer" + }, + { + "args": [ + "real", + "text" + ], + "result": "integer" + }, + { + "args": [ + "real", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "text", + "real" + ], + "result": "integer" + }, + { + "args": [ + "text", + "text" + ], + "result": "integer" + }, + { + "args": [ + "text", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "real" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "json": [ + { + "name": "json", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "json_array": [ + { + "name": "json_array", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "text" + }, + { + "args": [ + "null", + "real" + ], + "result": "text" + }, + { + "args": [ + "null", + "text" + ], + "result": "text" + }, + { + "args": [ + "null", + "blob" + ], + "result": "text" + }, + { + "args": [ + "null", + "null" + ], + "result": "text" + } + ] + } + ], + "json_array_insert": [ + { + "name": "json_array_insert", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + } + ] + } + ], + "json_array_length": [ + { + "name": "json_array_length", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "json_array_length", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "integer", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "integer", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "real", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "real", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "real", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "blob", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "blob", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "json_error_position": [ + { + "name": "json_error_position", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "json_extract": [ + { + "name": "json_extract", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "integer", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "integer", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "real", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "real", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "real", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "blob", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "blob", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "json_group_array": [ + { + "name": "json_group_array", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + } + ] + } + ], + "json_group_object": [ + { + "name": "json_group_object", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "text" + }, + { + "args": [ + "null", + "real" + ], + "result": "text" + }, + { + "args": [ + "null", + "text" + ], + "result": "text" + }, + { + "args": [ + "null", + "blob" + ], + "result": "text" + }, + { + "args": [ + "null", + "null" + ], + "result": "text" + } + ] + } + ], + "json_insert": [ + { + "name": "json_insert", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + } + ] + } + ], + "json_object": [ + { + "name": "json_object", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "real" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "text" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "blob" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "null" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_object() labels must be TEXT" + } + ] + } + ], + "json_patch": [ + { + "name": "json_patch", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "json_pretty": [ + { + "name": "json_pretty", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "json_pretty", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "json_quote": [ + { + "name": "json_quote", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + } + ] + } + ], + "json_remove": [ + { + "name": "json_remove", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "integer", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "integer", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "real", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "real", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "real", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "blob", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "blob", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "json_replace": [ + { + "name": "json_replace", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + } + ] + } + ], + "json_set": [ + { + "name": "json_set", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "null" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_set() needs an odd number of arguments" + } + ] + } + ], + "json_type": [ + { + "name": "json_type", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "json_type", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "integer", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "integer", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "real", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "real", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "real", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "blob", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "blob", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "json_valid": [ + { + "name": "json_valid", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "json_valid", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "real" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "text" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "integer", + "null" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "real", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real" + ], + "result": "integer" + }, + { + "args": [ + "real", + "text" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "real", + "blob" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "real", + "null" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "text", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "text", + "real" + ], + "result": "integer" + }, + { + "args": [ + "text", + "text" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "text", + "blob" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "text", + "null" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "real" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "text" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "blob", + "null" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "null", + "blob" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + }, + { + "args": [ + "null", + "null" + ], + "error": "FLAGS parameter to json_valid() must be between 1 and 15" + } + ] + } + ], + "jsonb": [ + { + "name": "jsonb", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "jsonb_array": [ + { + "name": "jsonb_array", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "real" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "text" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "null" + ], + "result": "blob" + }, + { + "args": [ + "real", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real", + "real" + ], + "result": "blob" + }, + { + "args": [ + "real", + "text" + ], + "result": "blob" + }, + { + "args": [ + "real", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "real", + "null" + ], + "result": "blob" + }, + { + "args": [ + "text", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "text", + "real" + ], + "result": "blob" + }, + { + "args": [ + "text", + "text" + ], + "result": "blob" + }, + { + "args": [ + "text", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "text", + "null" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "blob" + }, + { + "args": [ + "null", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "null", + "real" + ], + "result": "blob" + }, + { + "args": [ + "null", + "text" + ], + "result": "blob" + }, + { + "args": [ + "null", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null" + ], + "result": "blob" + } + ] + } + ], + "jsonb_array_insert": [ + { + "name": "jsonb_array_insert", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_array_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_array_insert() needs an odd number of arguments" + } + ] + } + ], + "jsonb_extract": [ + { + "name": "jsonb_extract", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "integer", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "integer", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "real", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "real", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "real", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "blob", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "blob", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "jsonb_group_array": [ + { + "name": "jsonb_group_array", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "blob" + } + ] + } + ], + "jsonb_group_object": [ + { + "name": "jsonb_group_object", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "real" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "text" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "null" + ], + "result": "blob" + }, + { + "args": [ + "real", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real", + "real" + ], + "result": "blob" + }, + { + "args": [ + "real", + "text" + ], + "result": "blob" + }, + { + "args": [ + "real", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "real", + "null" + ], + "result": "blob" + }, + { + "args": [ + "text", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "text", + "real" + ], + "result": "blob" + }, + { + "args": [ + "text", + "text" + ], + "result": "blob" + }, + { + "args": [ + "text", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "text", + "null" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "blob" + }, + { + "args": [ + "null", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "null", + "real" + ], + "result": "blob" + }, + { + "args": [ + "null", + "text" + ], + "result": "blob" + }, + { + "args": [ + "null", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null" + ], + "result": "blob" + } + ] + } + ], + "jsonb_insert": [ + { + "name": "jsonb_insert", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "text", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_insert() needs an odd number of arguments" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_insert() needs an odd number of arguments" + } + ] + } + ], + "jsonb_object": [ + { + "name": "jsonb_object", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "real" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "text" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "blob" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "null" + ], + "error": "json_object() requires an even number of arguments" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "text", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "text", + "real" + ], + "result": "blob" + }, + { + "args": [ + "text", + "text" + ], + "result": "blob" + }, + { + "args": [ + "text", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "text", + "null" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_object() labels must be TEXT" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_object() labels must be TEXT" + } + ] + } + ], + "jsonb_patch": [ + { + "name": "jsonb_patch", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "real" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real", + "real" + ], + "result": "blob" + }, + { + "args": [ + "real", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "real", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "jsonb_remove": [ + { + "name": "jsonb_remove", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "integer", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "integer", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "real", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "real", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "real", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "real" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "blob" + ], + "error": "malformed JSON" + }, + { + "args": [ + "text", + "null" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "bad JSON path: '1'" + }, + { + "args": [ + "blob", + "real" + ], + "error": "bad JSON path: '1.5'" + }, + { + "args": [ + "blob", + "text" + ], + "error": "bad JSON path: 'x'" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "bad JSON path: '\u0001'" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "jsonb_replace": [ + { + "name": "jsonb_replace", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "text", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_replace() needs an odd number of arguments" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_replace() needs an odd number of arguments" + } + ] + } + ], + "jsonb_set": [ + { + "name": "jsonb_set", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "error": "malformed JSON" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "integer", + "null" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "real", + "null" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "text", + "null" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "blob", + "null" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "integer" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "real" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "text" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "blob" + ], + "error": "json_set() needs an odd number of arguments" + }, + { + "args": [ + "null", + "null" + ], + "error": "json_set() needs an odd number of arguments" + } + ] + } + ], + "julianday": [ + { + "name": "julianday", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "lag": [ + { + "name": "lag", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "lag", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "real" + }, + { + "args": [ + "real", + "blob" + ], + "result": "real" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + }, + { + "name": "lag", + "type": "w", + "narg": 3, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "last_insert_rowid": [ + { + "name": "last_insert_rowid", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "integer" + } + ] + } + ], + "last_value": [ + { + "name": "last_value", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "lead": [ + { + "name": "lead", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "lead", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "real" + }, + { + "args": [ + "real", + "blob" + ], + "result": "real" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + }, + { + "name": "lead", + "type": "w", + "narg": 3, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "length": [ + { + "name": "length", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "like": [ + { + "name": "like", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "real" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "text" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real" + ], + "result": "integer" + }, + { + "args": [ + "real", + "text" + ], + "result": "integer" + }, + { + "args": [ + "real", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "text", + "real" + ], + "result": "integer" + }, + { + "args": [ + "text", + "text" + ], + "result": "integer" + }, + { + "args": [ + "text", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "real" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "null" + ], + "result": "integer" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + }, + { + "name": "like", + "type": "s", + "narg": 3, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real", + "real" + ], + "error": "ESCAPE expression must be a single character" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "likelihood": [ + { + "name": "likelihood", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "real" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "text" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "null" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "real", + "integer" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "real", + "real" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "real", + "text" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "real", + "blob" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "real", + "null" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "text", + "integer" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "text", + "real" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "text", + "text" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "text", + "blob" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "text", + "null" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "real" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "text" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "null" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "null", + "integer" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "null", + "real" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "null", + "text" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "null", + "blob" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + }, + { + "args": [ + "null", + "null" + ], + "error": "second argument to likelihood() must be a constant between 0.0 and 1.0" + } + ] + } + ], + "likely": [ + { + "name": "likely", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "ln": [ + { + "name": "ln", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "load_extension": [ + { + "name": "load_extension", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "error": "not authorized" + }, + { + "args": [ + "real" + ], + "error": "not authorized" + }, + { + "args": [ + "text" + ], + "error": "not authorized" + }, + { + "args": [ + "blob" + ], + "error": "not authorized" + }, + { + "args": [ + "null" + ], + "error": "not authorized" + } + ] + }, + { + "name": "load_extension", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "not authorized" + }, + { + "args": [ + "integer", + "real" + ], + "error": "not authorized" + }, + { + "args": [ + "integer", + "text" + ], + "error": "not authorized" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "not authorized" + }, + { + "args": [ + "integer", + "null" + ], + "error": "not authorized" + }, + { + "args": [ + "real", + "integer" + ], + "error": "not authorized" + }, + { + "args": [ + "real", + "real" + ], + "error": "not authorized" + }, + { + "args": [ + "real", + "text" + ], + "error": "not authorized" + }, + { + "args": [ + "real", + "blob" + ], + "error": "not authorized" + }, + { + "args": [ + "real", + "null" + ], + "error": "not authorized" + }, + { + "args": [ + "text", + "integer" + ], + "error": "not authorized" + }, + { + "args": [ + "text", + "real" + ], + "error": "not authorized" + }, + { + "args": [ + "text", + "text" + ], + "error": "not authorized" + }, + { + "args": [ + "text", + "blob" + ], + "error": "not authorized" + }, + { + "args": [ + "text", + "null" + ], + "error": "not authorized" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "not authorized" + }, + { + "args": [ + "blob", + "real" + ], + "error": "not authorized" + }, + { + "args": [ + "blob", + "text" + ], + "error": "not authorized" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "not authorized" + }, + { + "args": [ + "blob", + "null" + ], + "error": "not authorized" + }, + { + "args": [ + "null", + "integer" + ], + "error": "not authorized" + }, + { + "args": [ + "null", + "real" + ], + "error": "not authorized" + }, + { + "args": [ + "null", + "text" + ], + "error": "not authorized" + }, + { + "args": [ + "null", + "blob" + ], + "error": "not authorized" + }, + { + "args": [ + "null", + "null" + ], + "error": "not authorized" + } + ] + } + ], + "log": [ + { + "name": "log", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "log", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "log10": [ + { + "name": "log10", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "log2": [ + { + "name": "log2", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "lower": [ + { + "name": "lower", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "ltrim": [ + { + "name": "ltrim", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "ltrim", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "match": [ + { + "name": "match", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "integer", + "real" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "integer", + "text" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "integer", + "null" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "real", + "integer" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "real", + "real" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "real", + "text" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "real", + "blob" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "real", + "null" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "text", + "integer" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "text", + "real" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "text", + "text" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "text", + "blob" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "text", + "null" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "blob", + "real" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "blob", + "text" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "blob", + "null" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "null", + "integer" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "null", + "real" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "null", + "text" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "null", + "blob" + ], + "error": "unable to use function MATCH in the requested context" + }, + { + "args": [ + "null", + "null" + ], + "error": "unable to use function MATCH in the requested context" + } + ] + } + ], + "matchinfo": [ + { + "name": "matchinfo", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "real" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "text" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "blob" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "null" + ], + "error": "unable to use function matchinfo in the requested context" + } + ] + }, + { + "name": "matchinfo", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "integer", + "real" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "integer", + "text" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "integer", + "null" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "real", + "integer" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "real", + "real" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "real", + "text" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "real", + "blob" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "real", + "null" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "text", + "integer" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "text", + "real" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "text", + "text" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "text", + "blob" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "text", + "null" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "blob", + "real" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "blob", + "text" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "blob", + "null" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "null", + "integer" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "null", + "real" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "null", + "text" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "null", + "blob" + ], + "error": "unable to use function matchinfo in the requested context" + }, + { + "args": [ + "null", + "null" + ], + "error": "unable to use function matchinfo in the requested context" + } + ] + } + ], + "max": [ + { + "name": "max", + "type": "s", + "narg": -3, + "variadic": true, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "real" + ], + "result": "real" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + }, + { + "name": "max", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "median": [ + { + "name": "median", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "error": "input to median() is not numeric" + }, + { + "args": [ + "blob" + ], + "error": "input to median() is not numeric" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "min": [ + { + "name": "min", + "type": "s", + "narg": -3, + "variadic": true, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "real" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "text" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "real" + }, + { + "args": [ + "real", + "blob" + ], + "result": "real" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "text", + "real" + ], + "result": "real" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "blob", + "real" + ], + "result": "real" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + }, + { + "name": "min", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "mod": [ + { + "name": "mod", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "real" + }, + { + "args": [ + "integer", + "real" + ], + "result": "real" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "nth_value": [ + { + "name": "nth_value", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "real" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "integer", + "text" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "integer", + "null" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "real", + "text" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "real", + "blob" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "real", + "null" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "text", + "text" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "text", + "blob" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "text", + "null" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "blob", + "text" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "blob", + "null" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "null", + "text" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "null", + "blob" + ], + "error": "second argument to nth_value must be a positive integer" + }, + { + "args": [ + "null", + "null" + ], + "error": "second argument to nth_value must be a positive integer" + } + ] + } + ], + "ntile": [ + { + "name": "ntile", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "error": "argument of ntile must be a positive integer" + }, + { + "args": [ + "blob" + ], + "error": "argument of ntile must be a positive integer" + }, + { + "args": [ + "null" + ], + "error": "argument of ntile must be a positive integer" + } + ] + } + ], + "nullif": [ + { + "name": "nullif", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "text" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "integer" + }, + { + "args": [ + "integer", + "null" + ], + "result": "integer" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "real" + }, + { + "args": [ + "real", + "blob" + ], + "result": "real" + }, + { + "args": [ + "real", + "null" + ], + "result": "real" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "blob" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "octet_length": [ + { + "name": "octet_length", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "offsets": [ + { + "name": "offsets", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "error": "unable to use function offsets in the requested context" + }, + { + "args": [ + "real" + ], + "error": "unable to use function offsets in the requested context" + }, + { + "args": [ + "text" + ], + "error": "unable to use function offsets in the requested context" + }, + { + "args": [ + "blob" + ], + "error": "unable to use function offsets in the requested context" + }, + { + "args": [ + "null" + ], + "error": "unable to use function offsets in the requested context" + } + ] + } + ], + "optimize": [ + { + "name": "optimize", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "error": "unable to use function optimize in the requested context" + }, + { + "args": [ + "real" + ], + "error": "unable to use function optimize in the requested context" + }, + { + "args": [ + "text" + ], + "error": "unable to use function optimize in the requested context" + }, + { + "args": [ + "blob" + ], + "error": "unable to use function optimize in the requested context" + }, + { + "args": [ + "null" + ], + "error": "unable to use function optimize in the requested context" + } + ] + } + ], + "percent_rank": [ + { + "name": "percent_rank", + "type": "w", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "real" + } + ] + } + ], + "percentile": [ + { + "name": "percentile", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "real" + }, + { + "args": [ + "integer", + "real" + ], + "result": "real" + }, + { + "args": [ + "integer", + "text" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "integer", + "null" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "real", + "blob" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "real", + "null" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "text", + "integer" + ], + "error": "input to percentile() is not numeric" + }, + { + "args": [ + "text", + "real" + ], + "error": "input to percentile() is not numeric" + }, + { + "args": [ + "text", + "text" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "text", + "blob" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "text", + "null" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "input to percentile() is not numeric" + }, + { + "args": [ + "blob", + "real" + ], + "error": "input to percentile() is not numeric" + }, + { + "args": [ + "blob", + "text" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "blob", + "null" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "null", + "blob" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + }, + { + "args": [ + "null", + "null" + ], + "error": "the fraction argument to percentile() is not between 0.0 and 100.0" + } + ] + } + ], + "percentile_cont": [ + { + "name": "percentile_cont", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "real" + }, + { + "args": [ + "integer", + "real" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "text" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "null" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "real", + "text" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "real", + "blob" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "real", + "null" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "text", + "integer" + ], + "error": "input to percentile_cont() is not numeric" + }, + { + "args": [ + "text", + "real" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "text", + "text" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "text", + "blob" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "text", + "null" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "input to percentile_cont() is not numeric" + }, + { + "args": [ + "blob", + "real" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "text" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "null" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "null", + "text" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "null", + "blob" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + }, + { + "args": [ + "null", + "null" + ], + "error": "the fraction argument to percentile_cont() is not between 0.0 and 1.0" + } + ] + } + ], + "percentile_disc": [ + { + "name": "percentile_disc", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "real" + }, + { + "args": [ + "integer", + "real" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "text" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "integer", + "null" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "real", + "text" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "real", + "blob" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "real", + "null" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "text", + "integer" + ], + "error": "input to percentile_disc() is not numeric" + }, + { + "args": [ + "text", + "real" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "text", + "text" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "text", + "blob" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "text", + "null" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "input to percentile_disc() is not numeric" + }, + { + "args": [ + "blob", + "real" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "text" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "blob", + "null" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "null", + "text" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "null", + "blob" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + }, + { + "args": [ + "null", + "null" + ], + "error": "the fraction argument to percentile_disc() is not between 0.0 and 1.0" + } + ] + } + ], + "pi": [ + { + "name": "pi", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "real" + } + ] + } + ], + "pow": [ + { + "name": "pow", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "real" + }, + { + "args": [ + "integer", + "real" + ], + "result": "real" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "power": [ + { + "name": "power", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "real" + }, + { + "args": [ + "integer", + "real" + ], + "result": "real" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "printf": [ + { + "name": "printf", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "quote": [ + { + "name": "quote", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + } + ] + } + ], + "radians": [ + { + "name": "radians", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "random": [ + { + "name": "random", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "integer" + } + ] + } + ], + "randomblob": [ + { + "name": "randomblob", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "blob" + } + ] + } + ], + "rank": [ + { + "name": "rank", + "type": "w", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "integer" + } + ] + } + ], + "replace": [ + { + "name": "replace", + "type": "s", + "narg": 3, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "round": [ + { + "name": "round", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "real" + }, + { + "args": [ + "blob" + ], + "result": "real" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "round", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "real" + }, + { + "args": [ + "integer", + "real" + ], + "result": "real" + }, + { + "args": [ + "integer", + "text" + ], + "result": "real" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "real" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "real" + }, + { + "args": [ + "real", + "real" + ], + "result": "real" + }, + { + "args": [ + "real", + "text" + ], + "result": "real" + }, + { + "args": [ + "real", + "blob" + ], + "result": "real" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "real" + }, + { + "args": [ + "text", + "real" + ], + "result": "real" + }, + { + "args": [ + "text", + "text" + ], + "result": "real" + }, + { + "args": [ + "text", + "blob" + ], + "result": "real" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "real" + }, + { + "args": [ + "blob", + "real" + ], + "result": "real" + }, + { + "args": [ + "blob", + "text" + ], + "result": "real" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "real" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "row_number": [ + { + "name": "row_number", + "type": "w", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "integer" + } + ] + } + ], + "rtreecheck": [ + { + "name": "rtreecheck", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "error": "SQL logic error" + }, + { + "args": [ + "real" + ], + "error": "SQL logic error" + }, + { + "args": [ + "text" + ], + "error": "SQL logic error" + }, + { + "args": [ + "blob" + ], + "error": "SQL logic error" + }, + { + "args": [ + "null" + ], + "error": "SQL logic error" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "SQL logic error" + }, + { + "args": [ + "integer", + "real" + ], + "error": "SQL logic error" + }, + { + "args": [ + "integer", + "text" + ], + "error": "SQL logic error" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "SQL logic error" + }, + { + "args": [ + "integer", + "null" + ], + "error": "SQL logic error" + }, + { + "args": [ + "real", + "integer" + ], + "error": "SQL logic error" + }, + { + "args": [ + "real", + "real" + ], + "error": "SQL logic error" + }, + { + "args": [ + "real", + "text" + ], + "error": "SQL logic error" + }, + { + "args": [ + "real", + "blob" + ], + "error": "SQL logic error" + }, + { + "args": [ + "real", + "null" + ], + "error": "SQL logic error" + }, + { + "args": [ + "text", + "integer" + ], + "error": "SQL logic error" + }, + { + "args": [ + "text", + "real" + ], + "error": "SQL logic error" + }, + { + "args": [ + "text", + "text" + ], + "error": "SQL logic error" + }, + { + "args": [ + "text", + "blob" + ], + "error": "SQL logic error" + }, + { + "args": [ + "text", + "null" + ], + "error": "SQL logic error" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "SQL logic error" + }, + { + "args": [ + "blob", + "real" + ], + "error": "SQL logic error" + }, + { + "args": [ + "blob", + "text" + ], + "error": "SQL logic error" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "SQL logic error" + }, + { + "args": [ + "blob", + "null" + ], + "error": "SQL logic error" + }, + { + "args": [ + "null", + "integer" + ], + "error": "SQL logic error" + }, + { + "args": [ + "null", + "real" + ], + "error": "SQL logic error" + }, + { + "args": [ + "null", + "text" + ], + "error": "SQL logic error" + }, + { + "args": [ + "null", + "blob" + ], + "error": "SQL logic error" + }, + { + "args": [ + "null", + "null" + ], + "error": "SQL logic error" + } + ] + } + ], + "rtreedepth": [ + { + "name": "rtreedepth", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "error": "Invalid argument to rtreedepth()" + }, + { + "args": [ + "real" + ], + "error": "Invalid argument to rtreedepth()" + }, + { + "args": [ + "text" + ], + "error": "Invalid argument to rtreedepth()" + }, + { + "args": [ + "blob" + ], + "error": "Invalid argument to rtreedepth()" + }, + { + "args": [ + "null" + ], + "error": "Invalid argument to rtreedepth()" + } + ] + } + ], + "rtreenode": [ + { + "name": "rtreenode", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "rtrim": [ + { + "name": "rtrim", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "rtrim", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "sign": [ + { + "name": "sign", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "sin": [ + { + "name": "sin", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "sinh": [ + { + "name": "sinh", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "snippet": [ + { + "name": "snippet", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "real" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "text" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "blob" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "null" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "integer", + "integer" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "integer", + "real" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "integer", + "text" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "integer", + "blob" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "integer", + "null" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "real", + "integer" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "real", + "real" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "real", + "text" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "real", + "blob" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "real", + "null" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "text", + "integer" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "text", + "real" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "text", + "text" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "text", + "blob" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "text", + "null" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "blob", + "integer" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "blob", + "real" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "blob", + "text" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "blob", + "blob" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "blob", + "null" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "null", + "integer" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "null", + "real" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "null", + "text" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "null", + "blob" + ], + "error": "unable to use function snippet in the requested context" + }, + { + "args": [ + "null", + "null" + ], + "error": "unable to use function snippet in the requested context" + } + ] + } + ], + "soundex": [ + { + "name": "soundex", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + } + ] + } + ], + "sqlite_compileoption_get": [ + { + "name": "sqlite_compileoption_get", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + } + ] + } + ], + "sqlite_compileoption_used": [ + { + "name": "sqlite_compileoption_used", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "sqlite_log": [ + { + "name": "sqlite_log", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "sqlite_source_id": [ + { + "name": "sqlite_source_id", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "text" + } + ] + } + ], + "sqlite_version": [ + { + "name": "sqlite_version", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "text" + } + ] + } + ], + "sqrt": [ + { + "name": "sqrt", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "strftime": [ + { + "name": "strftime", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "string_agg": [ + { + "name": "string_agg", + "type": "w", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "text" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "text" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "text" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "text" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "substr": [ + { + "name": "substr", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + }, + { + "name": "substr", + "type": "s", + "narg": 3, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "substring": [ + { + "name": "substring", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "real" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + }, + { + "name": "substring", + "type": "s", + "narg": 3, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null", + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "subtype": [ + { + "name": "subtype", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "integer" + } + ] + } + ], + "sum": [ + { + "name": "sum", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "real" + }, + { + "args": [ + "blob" + ], + "result": "real" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "tan": [ + { + "name": "tan", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "tanh": [ + { + "name": "tanh", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "time": [ + { + "name": "time", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "timediff": [ + { + "name": "timediff", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "total": [ + { + "name": "total", + "type": "w", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "real" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "real" + }, + { + "args": [ + "blob" + ], + "result": "real" + }, + { + "args": [ + "null" + ], + "result": "real" + } + ] + } + ], + "total_changes": [ + { + "name": "total_changes", + "type": "s", + "narg": 0, + "variadic": false, + "observations": [ + { + "args": [], + "result": "integer" + } + ] + } + ], + "trim": [ + { + "name": "trim", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "trim", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "text" + }, + { + "args": [ + "integer", + "real" + ], + "result": "text" + }, + { + "args": [ + "integer", + "text" + ], + "result": "text" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "text" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "text" + }, + { + "args": [ + "real", + "real" + ], + "result": "text" + }, + { + "args": [ + "real", + "text" + ], + "result": "text" + }, + { + "args": [ + "real", + "blob" + ], + "result": "text" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "text" + }, + { + "args": [ + "text", + "real" + ], + "result": "text" + }, + { + "args": [ + "text", + "text" + ], + "result": "text" + }, + { + "args": [ + "text", + "blob" + ], + "result": "text" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "text" + }, + { + "args": [ + "blob", + "real" + ], + "result": "text" + }, + { + "args": [ + "blob", + "text" + ], + "result": "text" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "text" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "trunc": [ + { + "name": "trunc", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "typeof": [ + { + "name": "typeof", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + } + ] + } + ], + "unhex": [ + { + "name": "unhex", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "null" + }, + { + "args": [ + "real" + ], + "result": "null" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + }, + { + "name": "unhex", + "type": "s", + "narg": 2, + "variadic": false, + "observations": [ + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "blob" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "blob" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "unicode": [ + { + "name": "unicode", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "integer" + }, + { + "args": [ + "blob" + ], + "result": "integer" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "unistr": [ + { + "name": "unistr", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "unistr_quote": [ + { + "name": "unistr_quote", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "text" + } + ] + } + ], + "unixepoch": [ + { + "name": "unixepoch", + "type": "s", + "narg": -1, + "variadic": true, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "integer" + }, + { + "args": [ + "text" + ], + "result": "null" + }, + { + "args": [ + "blob" + ], + "result": "null" + }, + { + "args": [ + "null" + ], + "result": "null" + }, + { + "args": [ + "integer", + "integer" + ], + "result": "null" + }, + { + "args": [ + "integer", + "real" + ], + "result": "null" + }, + { + "args": [ + "integer", + "text" + ], + "result": "null" + }, + { + "args": [ + "integer", + "blob" + ], + "result": "null" + }, + { + "args": [ + "integer", + "null" + ], + "result": "null" + }, + { + "args": [ + "real", + "integer" + ], + "result": "null" + }, + { + "args": [ + "real", + "real" + ], + "result": "null" + }, + { + "args": [ + "real", + "text" + ], + "result": "null" + }, + { + "args": [ + "real", + "blob" + ], + "result": "null" + }, + { + "args": [ + "real", + "null" + ], + "result": "null" + }, + { + "args": [ + "text", + "integer" + ], + "result": "null" + }, + { + "args": [ + "text", + "real" + ], + "result": "null" + }, + { + "args": [ + "text", + "text" + ], + "result": "null" + }, + { + "args": [ + "text", + "blob" + ], + "result": "null" + }, + { + "args": [ + "text", + "null" + ], + "result": "null" + }, + { + "args": [ + "blob", + "integer" + ], + "result": "null" + }, + { + "args": [ + "blob", + "real" + ], + "result": "null" + }, + { + "args": [ + "blob", + "text" + ], + "result": "null" + }, + { + "args": [ + "blob", + "blob" + ], + "result": "null" + }, + { + "args": [ + "blob", + "null" + ], + "result": "null" + }, + { + "args": [ + "null", + "integer" + ], + "result": "null" + }, + { + "args": [ + "null", + "real" + ], + "result": "null" + }, + { + "args": [ + "null", + "text" + ], + "result": "null" + }, + { + "args": [ + "null", + "blob" + ], + "result": "null" + }, + { + "args": [ + "null", + "null" + ], + "result": "null" + } + ] + } + ], + "unlikely": [ + { + "name": "unlikely", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "integer" + }, + { + "args": [ + "real" + ], + "result": "real" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "upper": [ + { + "name": "upper", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "text" + }, + { + "args": [ + "real" + ], + "result": "text" + }, + { + "args": [ + "text" + ], + "result": "text" + }, + { + "args": [ + "blob" + ], + "result": "text" + }, + { + "args": [ + "null" + ], + "result": "null" + } + ] + } + ], + "zeroblob": [ + { + "name": "zeroblob", + "type": "s", + "narg": 1, + "variadic": false, + "observations": [ + { + "args": [ + "integer" + ], + "result": "blob" + }, + { + "args": [ + "real" + ], + "result": "blob" + }, + { + "args": [ + "text" + ], + "result": "blob" + }, + { + "args": [ + "blob" + ], + "result": "blob" + }, + { + "args": [ + "null" + ], + "result": "blob" + } + ] + } + ] + } +} diff --git a/src/types/sqlite/generate.ts b/src/types/sqlite/generate.ts new file mode 100644 index 0000000..8d286d7 --- /dev/null +++ b/src/types/sqlite/generate.ts @@ -0,0 +1,411 @@ +// SQLite function-signature inference tool. +// +// Phase 1.1 (SQLite generalization plan). +// +// Reads `pragma_function_list` from an in-memory sqlite instance, runs +// a typed input matrix through each function, and records the observed +// return types per input combination. Output is a JSON snapshot at +// `functions.json` that Phase 1.1 substep C will turn into TS class +// definitions. +// +// ----------------------------------------------------------------------- +// Known limits of runtime-only inference (fix later — see plan below): +// +// 1. Null-return ambiguity: `abs(NULL) → NULL` is legitimate null +// propagation; `datetime(-1) → NULL` is an *error signal*. Both look +// identical to `SELECT typeof(...)`. We can't tell whether a signature +// is "valid but nullable" or "invalid — reject at type level". +// 2. Nonsensical coercions surface as valid: SQLite quietly coerces +// X'01' (blob) → a numeric for `acos()`, so we emit `Blob.acos()`. +// Semantically wrong; a user would never write that. +// 3. Aggregates/windows probed with a specific arg type get bucketed +// onto that type: `Integer.count()` gets emitted because we probed +// count with an integer. `count` really belongs on the shared +// SqliteValue base (works over any expression). +// 4. Multi-arity overloads collapse: we keep only the shortest arity +// per (owner, name) to avoid TS "duplicate implementation" errors. +// `format()`, `substr(x,y)`/`substr(x,y,z)`, etc. lose overloads. +// 5. Heterogeneous arg combinations skipped entirely (see argTuples). +// `substr(text, int, int)` isn't emitted. +// +// ----------------------------------------------------------------------- +// Best final plan (defer to Phase 1.4-ish): +// +// LLM-over-docs with runtime as sanity check. Concretely: +// +// a. Fetch the SQLite doc pages (lang_corefunc.html, lang_datefunc.html, +// lang_aggfunc.html, lang_mathfunc.html, json1.html, windowfunctions.html) +// into a vendored snapshot. Version-pin to the sqlite build we +// target so codegen stays reproducible in CI. +// +// b. Provide the model a **deterministic template** — one JSON schema +// per function that must be filled: +// { +// name: string, +// overloads: [{ +// args: Array<{ type: SqliteType | "any", nullable: boolean, notes?: string }>, +// variadic: boolean, +// returnType: SqliteType | "arg[0]" | "arg[N]", // may reference args +// returnNullable: "propagates" | "always" | "on_error", +// kind: "scalar" | "aggregate" | "window", +// jsDoc: string +// }], +// } +// The schema forces the model to commit to null semantics +// (propagates vs error-signal) and canonical return types, which is +// exactly what runtime probing can't disambiguate. +// +// c. Batch by doc page (~20-30 functions each) to amortize prompt cost +// and keep the model's context focused on a coherent group. +// +// d. **Sanity check** by replaying this runtime tool's observations +// against the LLM output. Divergences are flagged, not silently +// preferred either way — a human confirms. Cases: +// - Model says arg X is invalid, runtime succeeds → probably fine +// (SQLite's affinity coercion is looser than docs). +// - Model says arg X returns Y, runtime returns Z → hard mismatch, +// block codegen until resolved. +// - Model omits a function pragma_function_list emits → block. +// +// e. Emit .ts from the *merged* signature (docs-primary, runtime-verified). +// Runtime file (this one) keeps generating `functions.json` as the +// inventory; the LLM step produces `signatures.json` on top. +// +// The current runtime-only output serves as a useful diff target for step +// (d) — divergences point at exactly the semantically-nonsense methods +// (Blob.acos etc.) that docs would prune. +// +// ----------------------------------------------------------------------- +// Current design choices (this file): +// - Same-type matrix (all args the same storage class) covers polymorphic +// dispatch on primary type: abs(int)→int, abs(real)→real, etc. +// Heterogeneous combinations (e.g. substr(text, int, int)) are skipped. +// - narg semantics: 0..N = fixed arity; -1 = variadic; -3 = "≥ 2" (min/max). +// Variadic gets probed at arity 1 and 2. narg > 3 skipped (rare). +// - Aggregates ('a') and window functions ('w') are noted but their +// return-type inference happens over a single-row grouping so `typeof()` +// works. Windows use OVER () so they compile as expressions. +// - Blob input literal is `X'01'` (a single byte, enough to trigger blob +// handling paths). +import Database from "better-sqlite3"; +import * as fs from "node:fs"; +import * as path from "node:path"; + +type SqliteType = "integer" | "real" | "text" | "blob" | "null"; +const TYPES: SqliteType[] = ["integer", "real", "text", "blob", "null"]; + +// SQL literal that produces each type. `typeof(literal)` returns the +// storage class name; we use these both as inputs and to key our matrix. +const LITERALS: Record = { + integer: "1", + real: "1.5", + text: "'x'", + blob: "X'01'", + null: "NULL", +}; + +interface FunctionRow { + name: string; + builtin: number; + type: "s" | "a" | "w"; + enc: string; + narg: number; + flags: number; +} + +interface Observation { + args: readonly SqliteType[]; + result?: SqliteType; + error?: string; +} + +interface FunctionSig { + name: string; + type: "s" | "a" | "w"; + narg: number; // raw from pragma; -1 variadic, -3 ≥2 + variadic: boolean; + observations: Observation[]; +} + +const listFunctions = (db: Database.Database): FunctionRow[] => { + return db + .prepare<[], FunctionRow>("SELECT name, builtin, type, enc, narg, flags FROM pragma_function_list ORDER BY name, narg") + .all(); +}; + +// Probe arities to try for a given narg. Positive → that exact arity. +// -1 (variadic) → 1, 2. -3 (min/max: ≥2) → 2, 3. Skip narg > 3. +const aritiesToProbe = (narg: number): number[] => { + if (narg === 0) {return [0];} + if (narg > 0 && narg <= 3) {return [narg];} + if (narg > 3) {return [];} // skip; hand-curate + if (narg === -1) {return [1, 2];} + if (narg === -3) {return [2, 3];} + return []; // unknown negative; skip +}; + +// Enumerate arg-type tuples for a given arity. For arity ≤ 2 we do the +// full 5^arity Cartesian product; for arity 3 we only do same-type tuples +// to keep the matrix small. +const argTuples = (arity: number): SqliteType[][] => { + if (arity === 0) {return [[]];} + if (arity === 1) {return TYPES.map((t) => [t]);} + if (arity === 2) {return TYPES.flatMap((a) => TYPES.map((b) => [a, b]));} + if (arity === 3) {return TYPES.map((t) => [t, t, t]);} + return []; +}; + +// Build the actual probe SQL. For scalar functions: `SELECT typeof(fn(...))`. +// For aggregates: same but wrap in a subquery so the aggregate has a row +// to consume. For windows: `SELECT typeof(fn(...) OVER ())` — again inside +// a subquery so there's data. +const probeSql = (fn: FunctionRow, args: SqliteType[]): string => { + const argList = args.map((t) => LITERALS[t]).join(", "); + const call = `${fn.name}(${argList})`; + if (fn.type === "s") { + return `SELECT typeof(${call}) AS t`; + } + if (fn.type === "a") { + // Aggregate needs rows to aggregate over. Feed a 1-row dummy. + return `SELECT typeof(${call}) AS t FROM (SELECT 1)`; + } + // Window + return `SELECT typeof(${call} OVER ()) AS t FROM (SELECT 1)`; +}; + +const probe = (db: Database.Database, fn: FunctionRow, args: SqliteType[]): Observation => { + const sql = probeSql(fn, args); + try { + const row = db.prepare(sql).get() as { t: string } | undefined; + const result = (row?.t ?? "null") as SqliteType; + return { args: [...args], result }; + } catch (e) { + return { args: [...args], error: (e as Error).message }; + } +}; + +const inferFunctionSig = (db: Database.Database, fn: FunctionRow): FunctionSig => { + const arities = aritiesToProbe(fn.narg); + const observations: Observation[] = []; + for (const a of arities) { + for (const tuple of argTuples(a)) { + observations.push(probe(db, fn, tuple)); + } + } + return { + name: fn.name, + type: fn.type, + narg: fn.narg, + variadic: fn.narg < 0, + observations, + }; +}; + +// Group by function name so overloads (same name, different arities like +// count(0), count(1)) show up as separate arity entries under one function. +const groupByName = (sigs: FunctionSig[]): { [name: string]: FunctionSig[] } => { + const acc = new Map(); + for (const s of sigs) { + const arr = acc.get(s.name) ?? []; + arr.push(s); + acc.set(s.name, arr); + } + return Object.fromEntries(acc); +}; + +// --- Class distribution + TS emission ----------------------------------- + +// Storage-class name → typegres class name. +const CLASS_FOR: Record, string> = { + integer: "Integer", + real: "Real", + text: "Text", + blob: "Blob", +}; + +// A method to emit on a class: name (camelCased), the SQL function name, +// the arg-type sequence (first arg is the receiver, so args[0] === owner), +// and the observed return storage class. +interface Method { + tsName: string; // e.g. "abs" + sqlName: string; // e.g. "abs" + ownerType: Exclude; + argTypes: readonly Exclude[]; // after arg[0] (owner) — remaining args + resultType: Exclude; + fnType: "s" | "a" | "w"; + variadic: boolean; +} + +// Camelcase without a dependency — small enough to inline. +const camel = (s: string): string => + s.replace(/_([a-z])/g, (_, c: string) => c.toUpperCase()); + +// Distribute a function's observations into per-owner-type Methods. Rules: +// - Consider only "clean" same-type observations (all args same storage +// class, non-null result, no error). Heterogeneous overloads (e.g. +// substr(text, int, int)) are punted to hand-curated overrides. +// - For each type X where args=[X,...,X] gives result R (non-null), +// emit a method on X returning R. +// - Zero-arg functions (arity 0) become static on SqliteValue — collected +// separately below. +const methodsFor = (sig: FunctionSig): Method[] => { + const out: Method[] = []; + for (const obs of sig.observations) { + if (obs.error || !obs.result || obs.result === "null") {continue;} + if (obs.args.length === 0) {continue;} + const first = obs.args[0]!; + if (first === "null") {continue;} + const allSame = obs.args.every((a) => a === first); + if (!allSame) {continue;} // heterogeneous — defer + out.push({ + tsName: camel(sig.name), + sqlName: sig.name, + ownerType: first, + argTypes: obs.args.slice(1) as Exclude[], + resultType: obs.result as Exclude, + fnType: sig.type, + variadic: sig.variadic, + }); + } + return out; +}; + +// Deduplicate methods with the same (owner, tsName) — keep the shortest +// arity (usually the base overload; TS overloads require a unified +// implementation signature which the first-pass codegen doesn't emit, +// so multiple declarations per method name collide as duplicate +// implementations. Multi-arity overloads land in a follow-up). +const dedup = (methods: Method[]): Method[] => { + const seen = new Map(); + for (const m of methods) { + const k = `${m.ownerType}::${m.tsName}`; + const prev = seen.get(k); + if (!prev || m.argTypes.length < prev.argTypes.length) {seen.set(k, m);} + } + return [...seen.values()]; +}; + +const emitClassFile = ( + ownerType: Exclude, + methods: readonly Method[], +): string => { + const className = CLASS_FOR[ownerType]; + const argClass = (t: Exclude): string => `types.${CLASS_FOR[t]}`; + const lines: string[] = []; + lines.push("// Auto-generated by src/types/sqlite/generate.ts — do not edit."); + lines.push("// First-pass codegen: one method per (owner-type, function-name);"); + lines.push("// same-type-args only. Heterogeneous overloads (e.g. substr) will"); + lines.push("// be added via hand-curated overrides (Phase 1.4)."); + lines.push('import { SqliteValue } from "../base";'); + lines.push('import { sql, type Sql } from "../../../builder/sql";'); + lines.push('import { meta } from "../../runtime";'); + lines.push('import type { NullOf, StrictNull } from "../../runtime";'); + lines.push('import * as types from "../index";'); + lines.push(""); + lines.push(`export class ${className} extends SqliteValue {`); + lines.push(" declare [meta]: {"); + lines.push(` __class: typeof ${className};`); + lines.push(" __raw: Sql;"); + lines.push(" __nullability: N;"); + lines.push(` __nullable: ${className}<0 | 1>;`); + lines.push(` __nonNullable: ${className}<1>;`); + lines.push(` __aggregate: ${className};`); + lines.push(` __any: ${className};`); + lines.push(" };"); + lines.push(` static override __typname = sql\`${ownerType.toUpperCase()}\`;`); + lines.push(` static override __typnameText = "${ownerType}";`); + lines.push(""); + + for (const m of methods) { + const retClass = argClass(m.resultType); + // Build TS arg params: arg0, arg1, ... each typed as `dialect_class | prim`. + // For the first-cut TS we don't do overload dispatch; just take the + // typegres instances (no primitive coercion yet). Simplify. + const params = m.argTypes.map((t, i) => `arg${i}: ${argClass(t)}`).join(", "); + // Result nullability: null propagates from any arg (strict). + const nullTerms = ["N", ...m.argTypes.map((_, i) => `NullOf`)]; + const nullExpr = nullTerms.length === 1 ? nullTerms[0]! : `StrictNull<${nullTerms.join(" | ")}>`; + const argForwarding = m.argTypes.map((_, i) => `\${arg${i}.toSql()}`).join(", "); + const call = m.argTypes.length > 0 + ? `${m.sqlName}(\${this.toSql()}, ${argForwarding})` + : `${m.sqlName}(\${this.toSql()})`; + lines.push(` ${m.tsName}(${params}): ${retClass}<${nullExpr}> {`); + lines.push(` return ${retClass}.from(sql\`${call}\`) as any;`); + lines.push(" }"); + } + lines.push("}"); + lines.push(""); + return lines.join("\n"); +}; + +const emitClasses = ( + sigs: FunctionSig[], + generatedDir: string, +): void => { + const allMethods = sigs.flatMap(methodsFor); + const byOwner: Record, Method[]> = { + integer: [], real: [], text: [], blob: [], + }; + for (const m of allMethods) { + byOwner[m.ownerType].push(m); + } + + for (const owner of Object.keys(byOwner) as Exclude[]) { + const methods = dedup(byOwner[owner]).sort((a, b) => a.tsName.localeCompare(b.tsName)); + const src = emitClassFile(owner, methods); + const out = path.join(generatedDir, `${owner}.ts`); + fs.writeFileSync(out, src); + console.log(` ${owner}.ts: ${methods.length} methods`); + } +}; + +const main = () => { + const db = new Database(":memory:"); + const sqliteVersion = (db.prepare("SELECT sqlite_version() AS v").get() as { v: string }).v; + const functions = listFunctions(db); + + const sigs: FunctionSig[] = []; + for (const fn of functions) { + sigs.push(inferFunctionSig(db, fn)); + } + db.close(); + + const output = { + sqlite_version: sqliteVersion, + generated_at: new Date().toISOString(), + function_count: functions.length, + functions: groupByName(sigs), + }; + + const outDirFlag = process.argv.indexOf("--out-dir"); + const outDir = outDirFlag >= 0 + ? path.resolve(process.argv[outDirFlag + 1]!) + : path.resolve(import.meta.dirname); + const jsonPath = path.join(outDir, "functions.json"); + fs.writeFileSync(jsonPath, JSON.stringify(output, null, 2) + "\n"); + console.log(`Wrote ${functions.length} functions to ${jsonPath}`); + + const generatedDir = path.join(outDir, "generated"); + fs.mkdirSync(generatedDir, { recursive: true }); + emitClasses(sigs, generatedDir); + updateBarrel(path.join(outDir, "index.ts")); +}; + +// Rewrite the [generated-start]...[generated-end] block of index.ts to +// list all classes we just emitted, plus the hand-written Bool. Same +// pattern PG codegen uses for its barrel. +const updateBarrel = (barrelPath: string): void => { + const classes = ["Blob", "Bool", "Integer", "Real", "Text"]; + const block = + "// [generated-start]\n" + + classes.map((c) => `export { ${c} } from "./generated/${c.toLowerCase()}";`).join("\n") + + "\n// [generated-end]"; + const cur = fs.readFileSync(barrelPath, "utf8"); + const next = cur.replace( + /\/\/ \[generated-start\][\s\S]*?\/\/ \[generated-end\]/, + block, + ); + fs.writeFileSync(barrelPath, next); +}; + +main(); diff --git a/src/types/sqlite/generated/blob.ts b/src/types/sqlite/generated/blob.ts new file mode 100644 index 0000000..a8de393 --- /dev/null +++ b/src/types/sqlite/generated/blob.ts @@ -0,0 +1,252 @@ +// Auto-generated by src/types/sqlite/generate.ts — do not edit. +// First-pass codegen: one method per (owner-type, function-name); +// same-type-args only. Heterogeneous overloads (e.g. substr) will +// be added via hand-curated overrides (Phase 1.4). +import { SqliteValue } from "../base"; +import { sql, type Sql } from "../../../builder/sql"; +import { meta } from "../../runtime"; +import type { NullOf, StrictNull } from "../../runtime"; +import * as types from "../index"; + +export class Blob extends SqliteValue { + declare [meta]: { + __class: typeof Blob; + __raw: Sql; + __nullability: N; + __nullable: Blob<0 | 1>; + __nonNullable: Blob<1>; + __aggregate: Blob; + __any: Blob; + }; + static override __typname = sql`BLOB`; + static override __typnameText = "blob"; + + abs(): types.Real { + return types.Real.from(sql`abs(${this.toSql()})`) as any; + } + avg(): types.Real { + return types.Real.from(sql`avg(${this.toSql()})`) as any; + } + char(): types.Text { + return types.Text.from(sql`char(${this.toSql()})`) as any; + } + concat(arg0: types.Blob): types.Text>> { + return types.Text.from(sql`concat(${this.toSql()}, ${arg0.toSql()})`) as any; + } + count(): types.Integer { + return types.Integer.from(sql`count(${this.toSql()})`) as any; + } + firstValue(): types.Blob { + return types.Blob.from(sql`first_value(${this.toSql()})`) as any; + } + format(): types.Text { + return types.Text.from(sql`format(${this.toSql()})`) as any; + } + fts5Insttoken(): types.Blob { + return types.Blob.from(sql`fts5_insttoken(${this.toSql()})`) as any; + } + fts5Locale(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`fts5_locale(${this.toSql()}, ${arg0.toSql()})`) as any; + } + glob(arg0: types.Blob): types.Integer>> { + return types.Integer.from(sql`glob(${this.toSql()}, ${arg0.toSql()})`) as any; + } + groupConcat(): types.Text { + return types.Text.from(sql`group_concat(${this.toSql()})`) as any; + } + hex(): types.Text { + return types.Text.from(sql`hex(${this.toSql()})`) as any; + } + ifnull(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`ifnull(${this.toSql()}, ${arg0.toSql()})`) as any; + } + instr(arg0: types.Blob): types.Integer>> { + return types.Integer.from(sql`instr(${this.toSql()}, ${arg0.toSql()})`) as any; + } + json(): types.Text { + return types.Text.from(sql`json(${this.toSql()})`) as any; + } + jsonArray(): types.Text { + return types.Text.from(sql`json_array(${this.toSql()})`) as any; + } + jsonArrayInsert(): types.Text { + return types.Text.from(sql`json_array_insert(${this.toSql()})`) as any; + } + jsonArrayLength(): types.Integer { + return types.Integer.from(sql`json_array_length(${this.toSql()})`) as any; + } + jsonb(): types.Blob { + return types.Blob.from(sql`jsonb(${this.toSql()})`) as any; + } + jsonbArray(): types.Blob { + return types.Blob.from(sql`jsonb_array(${this.toSql()})`) as any; + } + jsonbArrayInsert(): types.Blob { + return types.Blob.from(sql`jsonb_array_insert(${this.toSql()})`) as any; + } + jsonbGroupArray(): types.Blob { + return types.Blob.from(sql`jsonb_group_array(${this.toSql()})`) as any; + } + jsonbGroupObject(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`jsonb_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonbInsert(): types.Blob { + return types.Blob.from(sql`jsonb_insert(${this.toSql()})`) as any; + } + jsonbPatch(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`jsonb_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonbRemove(): types.Blob { + return types.Blob.from(sql`jsonb_remove(${this.toSql()})`) as any; + } + jsonbReplace(): types.Blob { + return types.Blob.from(sql`jsonb_replace(${this.toSql()})`) as any; + } + jsonbSet(): types.Blob { + return types.Blob.from(sql`jsonb_set(${this.toSql()})`) as any; + } + jsonErrorPosition(): types.Integer { + return types.Integer.from(sql`json_error_position(${this.toSql()})`) as any; + } + jsonGroupArray(): types.Text { + return types.Text.from(sql`json_group_array(${this.toSql()})`) as any; + } + jsonGroupObject(arg0: types.Blob): types.Text>> { + return types.Text.from(sql`json_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonInsert(): types.Text { + return types.Text.from(sql`json_insert(${this.toSql()})`) as any; + } + jsonPatch(arg0: types.Blob): types.Text>> { + return types.Text.from(sql`json_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonPretty(): types.Text { + return types.Text.from(sql`json_pretty(${this.toSql()})`) as any; + } + jsonQuote(): types.Text { + return types.Text.from(sql`json_quote(${this.toSql()})`) as any; + } + jsonRemove(): types.Text { + return types.Text.from(sql`json_remove(${this.toSql()})`) as any; + } + jsonReplace(): types.Text { + return types.Text.from(sql`json_replace(${this.toSql()})`) as any; + } + jsonSet(): types.Text { + return types.Text.from(sql`json_set(${this.toSql()})`) as any; + } + jsonType(): types.Text { + return types.Text.from(sql`json_type(${this.toSql()})`) as any; + } + jsonValid(): types.Integer { + return types.Integer.from(sql`json_valid(${this.toSql()})`) as any; + } + lag(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`lag(${this.toSql()}, ${arg0.toSql()})`) as any; + } + lastValue(): types.Blob { + return types.Blob.from(sql`last_value(${this.toSql()})`) as any; + } + lead(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`lead(${this.toSql()}, ${arg0.toSql()})`) as any; + } + length(): types.Integer { + return types.Integer.from(sql`length(${this.toSql()})`) as any; + } + like(arg0: types.Blob): types.Integer>> { + return types.Integer.from(sql`like(${this.toSql()}, ${arg0.toSql()})`) as any; + } + likely(): types.Blob { + return types.Blob.from(sql`likely(${this.toSql()})`) as any; + } + lower(): types.Text { + return types.Text.from(sql`lower(${this.toSql()})`) as any; + } + ltrim(): types.Text { + return types.Text.from(sql`ltrim(${this.toSql()})`) as any; + } + max(): types.Blob { + return types.Blob.from(sql`max(${this.toSql()})`) as any; + } + min(): types.Blob { + return types.Blob.from(sql`min(${this.toSql()})`) as any; + } + octetLength(): types.Integer { + return types.Integer.from(sql`octet_length(${this.toSql()})`) as any; + } + printf(): types.Text { + return types.Text.from(sql`printf(${this.toSql()})`) as any; + } + quote(): types.Text { + return types.Text.from(sql`quote(${this.toSql()})`) as any; + } + randomblob(): types.Blob { + return types.Blob.from(sql`randomblob(${this.toSql()})`) as any; + } + replace(arg0: types.Blob, arg1: types.Blob): types.Text | NullOf>> { + return types.Text.from(sql`replace(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + } + round(): types.Real { + return types.Real.from(sql`round(${this.toSql()})`) as any; + } + rtrim(): types.Text { + return types.Text.from(sql`rtrim(${this.toSql()})`) as any; + } + soundex(): types.Text { + return types.Text.from(sql`soundex(${this.toSql()})`) as any; + } + sqliteCompileoptionGet(): types.Text { + return types.Text.from(sql`sqlite_compileoption_get(${this.toSql()})`) as any; + } + sqliteCompileoptionUsed(): types.Integer { + return types.Integer.from(sql`sqlite_compileoption_used(${this.toSql()})`) as any; + } + strftime(): types.Text { + return types.Text.from(sql`strftime(${this.toSql()})`) as any; + } + stringAgg(arg0: types.Blob): types.Text>> { + return types.Text.from(sql`string_agg(${this.toSql()}, ${arg0.toSql()})`) as any; + } + substr(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`substr(${this.toSql()}, ${arg0.toSql()})`) as any; + } + substring(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`substring(${this.toSql()}, ${arg0.toSql()})`) as any; + } + subtype(): types.Integer { + return types.Integer.from(sql`subtype(${this.toSql()})`) as any; + } + sum(): types.Real { + return types.Real.from(sql`sum(${this.toSql()})`) as any; + } + total(): types.Real { + return types.Real.from(sql`total(${this.toSql()})`) as any; + } + trim(): types.Text { + return types.Text.from(sql`trim(${this.toSql()})`) as any; + } + typeof(): types.Text { + return types.Text.from(sql`typeof(${this.toSql()})`) as any; + } + unhex(arg0: types.Blob): types.Blob>> { + return types.Blob.from(sql`unhex(${this.toSql()}, ${arg0.toSql()})`) as any; + } + unicode(): types.Integer { + return types.Integer.from(sql`unicode(${this.toSql()})`) as any; + } + unistr(): types.Text { + return types.Text.from(sql`unistr(${this.toSql()})`) as any; + } + unistrQuote(): types.Text { + return types.Text.from(sql`unistr_quote(${this.toSql()})`) as any; + } + unlikely(): types.Blob { + return types.Blob.from(sql`unlikely(${this.toSql()})`) as any; + } + upper(): types.Text { + return types.Text.from(sql`upper(${this.toSql()})`) as any; + } + zeroblob(): types.Blob { + return types.Blob.from(sql`zeroblob(${this.toSql()})`) as any; + } +} diff --git a/src/types/sqlite/generated/bool.ts b/src/types/sqlite/generated/bool.ts new file mode 100644 index 0000000..c774f18 --- /dev/null +++ b/src/types/sqlite/generated/bool.ts @@ -0,0 +1,40 @@ +// Hand-written placeholder for SQLite's Bool. The inference tool +// (`../generate.ts`) will overwrite this file with a full codegen'd +// class in Phase 1.1 substep C. This stub exists so `base.ts` can +// reference `types.Bool` and the barrel resolves. +// +// SQLite has no native bool type — the storage class is INTEGER 0/1. +// `__typname = INTEGER` for CAST(...); `__typnameText = "bool"` keys +// into the deserialize registry (which knows 0/1 → boolean). +import { SqliteValue } from "../base"; +import { boolAnd, boolOr, boolNot } from "../../bool-mixin"; +import { sql, type Sql } from "../../../builder/sql"; +import { meta } from "../../runtime"; +import type { StrictNull, NullOf } from "../../runtime"; + +export class Bool extends SqliteValue { + declare [meta]: { + __class: typeof Bool; + __raw: Sql; + __nullability: N; + __nullable: Bool<0 | 1>; + __nonNullable: Bool<1>; + __aggregate: Bool; + __any: Bool; + }; + static override __typname = sql`INTEGER`; + static override __typnameText = "bool"; + declare deserialize: (raw: string) => boolean; + + and | boolean>(other: M): Bool>> { + return Bool.from(boolAnd(this.toSql(), other, Bool.__typname)) as any; + } + + or | boolean>(other: M): Bool>> { + return Bool.from(boolOr(this.toSql(), other, Bool.__typname)) as any; + } + + not(): Bool { + return Bool.from(boolNot(this.toSql())) as any; + } +} diff --git a/src/types/sqlite/generated/integer.ts b/src/types/sqlite/generated/integer.ts new file mode 100644 index 0000000..30360fe --- /dev/null +++ b/src/types/sqlite/generated/integer.ts @@ -0,0 +1,372 @@ +// Auto-generated by src/types/sqlite/generate.ts — do not edit. +// First-pass codegen: one method per (owner-type, function-name); +// same-type-args only. Heterogeneous overloads (e.g. substr) will +// be added via hand-curated overrides (Phase 1.4). +import { SqliteValue } from "../base"; +import { sql, type Sql } from "../../../builder/sql"; +import { meta } from "../../runtime"; +import type { NullOf, StrictNull } from "../../runtime"; +import * as types from "../index"; + +export class Integer extends SqliteValue { + declare [meta]: { + __class: typeof Integer; + __raw: Sql; + __nullability: N; + __nullable: Integer<0 | 1>; + __nonNullable: Integer<1>; + __aggregate: Integer; + __any: Integer; + }; + static override __typname = sql`INTEGER`; + static override __typnameText = "integer"; + + abs(): types.Integer { + return types.Integer.from(sql`abs(${this.toSql()})`) as any; + } + acos(): types.Real { + return types.Real.from(sql`acos(${this.toSql()})`) as any; + } + acosh(): types.Real { + return types.Real.from(sql`acosh(${this.toSql()})`) as any; + } + asin(): types.Real { + return types.Real.from(sql`asin(${this.toSql()})`) as any; + } + asinh(): types.Real { + return types.Real.from(sql`asinh(${this.toSql()})`) as any; + } + atan(): types.Real { + return types.Real.from(sql`atan(${this.toSql()})`) as any; + } + atan2(arg0: types.Integer): types.Real>> { + return types.Real.from(sql`atan2(${this.toSql()}, ${arg0.toSql()})`) as any; + } + atanh(): types.Real { + return types.Real.from(sql`atanh(${this.toSql()})`) as any; + } + avg(): types.Real { + return types.Real.from(sql`avg(${this.toSql()})`) as any; + } + ceil(): types.Integer { + return types.Integer.from(sql`ceil(${this.toSql()})`) as any; + } + ceiling(): types.Integer { + return types.Integer.from(sql`ceiling(${this.toSql()})`) as any; + } + char(): types.Text { + return types.Text.from(sql`char(${this.toSql()})`) as any; + } + concat(arg0: types.Integer): types.Text>> { + return types.Text.from(sql`concat(${this.toSql()}, ${arg0.toSql()})`) as any; + } + cos(): types.Real { + return types.Real.from(sql`cos(${this.toSql()})`) as any; + } + cosh(): types.Real { + return types.Real.from(sql`cosh(${this.toSql()})`) as any; + } + count(): types.Integer { + return types.Integer.from(sql`count(${this.toSql()})`) as any; + } + date(): types.Text { + return types.Text.from(sql`date(${this.toSql()})`) as any; + } + datetime(): types.Text { + return types.Text.from(sql`datetime(${this.toSql()})`) as any; + } + degrees(): types.Real { + return types.Real.from(sql`degrees(${this.toSql()})`) as any; + } + exp(): types.Real { + return types.Real.from(sql`exp(${this.toSql()})`) as any; + } + firstValue(): types.Integer { + return types.Integer.from(sql`first_value(${this.toSql()})`) as any; + } + floor(): types.Integer { + return types.Integer.from(sql`floor(${this.toSql()})`) as any; + } + format(): types.Text { + return types.Text.from(sql`format(${this.toSql()})`) as any; + } + fts5Insttoken(): types.Integer { + return types.Integer.from(sql`fts5_insttoken(${this.toSql()})`) as any; + } + fts5Locale(arg0: types.Integer): types.Blob>> { + return types.Blob.from(sql`fts5_locale(${this.toSql()}, ${arg0.toSql()})`) as any; + } + glob(arg0: types.Integer): types.Integer>> { + return types.Integer.from(sql`glob(${this.toSql()}, ${arg0.toSql()})`) as any; + } + groupConcat(): types.Text { + return types.Text.from(sql`group_concat(${this.toSql()})`) as any; + } + hex(): types.Text { + return types.Text.from(sql`hex(${this.toSql()})`) as any; + } + ifnull(arg0: types.Integer): types.Integer>> { + return types.Integer.from(sql`ifnull(${this.toSql()}, ${arg0.toSql()})`) as any; + } + instr(arg0: types.Integer): types.Integer>> { + return types.Integer.from(sql`instr(${this.toSql()}, ${arg0.toSql()})`) as any; + } + json(): types.Text { + return types.Text.from(sql`json(${this.toSql()})`) as any; + } + jsonArray(): types.Text { + return types.Text.from(sql`json_array(${this.toSql()})`) as any; + } + jsonArrayInsert(): types.Text { + return types.Text.from(sql`json_array_insert(${this.toSql()})`) as any; + } + jsonArrayLength(): types.Integer { + return types.Integer.from(sql`json_array_length(${this.toSql()})`) as any; + } + jsonb(): types.Blob { + return types.Blob.from(sql`jsonb(${this.toSql()})`) as any; + } + jsonbArray(): types.Blob { + return types.Blob.from(sql`jsonb_array(${this.toSql()})`) as any; + } + jsonbArrayInsert(): types.Blob { + return types.Blob.from(sql`jsonb_array_insert(${this.toSql()})`) as any; + } + jsonbGroupArray(): types.Blob { + return types.Blob.from(sql`jsonb_group_array(${this.toSql()})`) as any; + } + jsonbGroupObject(arg0: types.Integer): types.Blob>> { + return types.Blob.from(sql`jsonb_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonbInsert(): types.Blob { + return types.Blob.from(sql`jsonb_insert(${this.toSql()})`) as any; + } + jsonbPatch(arg0: types.Integer): types.Blob>> { + return types.Blob.from(sql`jsonb_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonbRemove(): types.Blob { + return types.Blob.from(sql`jsonb_remove(${this.toSql()})`) as any; + } + jsonbReplace(): types.Blob { + return types.Blob.from(sql`jsonb_replace(${this.toSql()})`) as any; + } + jsonbSet(): types.Blob { + return types.Blob.from(sql`jsonb_set(${this.toSql()})`) as any; + } + jsonErrorPosition(): types.Integer { + return types.Integer.from(sql`json_error_position(${this.toSql()})`) as any; + } + jsonGroupArray(): types.Text { + return types.Text.from(sql`json_group_array(${this.toSql()})`) as any; + } + jsonGroupObject(arg0: types.Integer): types.Text>> { + return types.Text.from(sql`json_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonInsert(): types.Text { + return types.Text.from(sql`json_insert(${this.toSql()})`) as any; + } + jsonPatch(arg0: types.Integer): types.Text>> { + return types.Text.from(sql`json_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonPretty(): types.Text { + return types.Text.from(sql`json_pretty(${this.toSql()})`) as any; + } + jsonQuote(): types.Text { + return types.Text.from(sql`json_quote(${this.toSql()})`) as any; + } + jsonRemove(): types.Text { + return types.Text.from(sql`json_remove(${this.toSql()})`) as any; + } + jsonReplace(): types.Text { + return types.Text.from(sql`json_replace(${this.toSql()})`) as any; + } + jsonSet(): types.Text { + return types.Text.from(sql`json_set(${this.toSql()})`) as any; + } + jsonType(): types.Text { + return types.Text.from(sql`json_type(${this.toSql()})`) as any; + } + jsonValid(): types.Integer { + return types.Integer.from(sql`json_valid(${this.toSql()})`) as any; + } + julianday(): types.Real { + return types.Real.from(sql`julianday(${this.toSql()})`) as any; + } + lag(arg0: types.Integer, arg1: types.Integer): types.Integer | NullOf>> { + return types.Integer.from(sql`lag(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + } + lastValue(): types.Integer { + return types.Integer.from(sql`last_value(${this.toSql()})`) as any; + } + lead(arg0: types.Integer, arg1: types.Integer): types.Integer | NullOf>> { + return types.Integer.from(sql`lead(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + } + length(): types.Integer { + return types.Integer.from(sql`length(${this.toSql()})`) as any; + } + like(arg0: types.Integer): types.Integer>> { + return types.Integer.from(sql`like(${this.toSql()}, ${arg0.toSql()})`) as any; + } + likely(): types.Integer { + return types.Integer.from(sql`likely(${this.toSql()})`) as any; + } + ln(): types.Real { + return types.Real.from(sql`ln(${this.toSql()})`) as any; + } + log(): types.Real { + return types.Real.from(sql`log(${this.toSql()})`) as any; + } + log10(): types.Real { + return types.Real.from(sql`log10(${this.toSql()})`) as any; + } + log2(): types.Real { + return types.Real.from(sql`log2(${this.toSql()})`) as any; + } + lower(): types.Text { + return types.Text.from(sql`lower(${this.toSql()})`) as any; + } + ltrim(): types.Text { + return types.Text.from(sql`ltrim(${this.toSql()})`) as any; + } + max(): types.Integer { + return types.Integer.from(sql`max(${this.toSql()})`) as any; + } + median(): types.Real { + return types.Real.from(sql`median(${this.toSql()})`) as any; + } + min(): types.Integer { + return types.Integer.from(sql`min(${this.toSql()})`) as any; + } + mod(arg0: types.Integer): types.Real>> { + return types.Real.from(sql`mod(${this.toSql()}, ${arg0.toSql()})`) as any; + } + nthValue(arg0: types.Integer): types.Integer>> { + return types.Integer.from(sql`nth_value(${this.toSql()}, ${arg0.toSql()})`) as any; + } + ntile(): types.Integer { + return types.Integer.from(sql`ntile(${this.toSql()})`) as any; + } + octetLength(): types.Integer { + return types.Integer.from(sql`octet_length(${this.toSql()})`) as any; + } + percentile(arg0: types.Integer): types.Real>> { + return types.Real.from(sql`percentile(${this.toSql()}, ${arg0.toSql()})`) as any; + } + percentileCont(arg0: types.Integer): types.Real>> { + return types.Real.from(sql`percentile_cont(${this.toSql()}, ${arg0.toSql()})`) as any; + } + percentileDisc(arg0: types.Integer): types.Real>> { + return types.Real.from(sql`percentile_disc(${this.toSql()}, ${arg0.toSql()})`) as any; + } + pow(arg0: types.Integer): types.Real>> { + return types.Real.from(sql`pow(${this.toSql()}, ${arg0.toSql()})`) as any; + } + power(arg0: types.Integer): types.Real>> { + return types.Real.from(sql`power(${this.toSql()}, ${arg0.toSql()})`) as any; + } + printf(): types.Text { + return types.Text.from(sql`printf(${this.toSql()})`) as any; + } + quote(): types.Text { + return types.Text.from(sql`quote(${this.toSql()})`) as any; + } + radians(): types.Real { + return types.Real.from(sql`radians(${this.toSql()})`) as any; + } + randomblob(): types.Blob { + return types.Blob.from(sql`randomblob(${this.toSql()})`) as any; + } + replace(arg0: types.Integer, arg1: types.Integer): types.Text | NullOf>> { + return types.Text.from(sql`replace(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + } + round(): types.Real { + return types.Real.from(sql`round(${this.toSql()})`) as any; + } + rtrim(): types.Text { + return types.Text.from(sql`rtrim(${this.toSql()})`) as any; + } + sign(): types.Integer { + return types.Integer.from(sql`sign(${this.toSql()})`) as any; + } + sin(): types.Real { + return types.Real.from(sql`sin(${this.toSql()})`) as any; + } + sinh(): types.Real { + return types.Real.from(sql`sinh(${this.toSql()})`) as any; + } + soundex(): types.Text { + return types.Text.from(sql`soundex(${this.toSql()})`) as any; + } + sqliteCompileoptionGet(): types.Text { + return types.Text.from(sql`sqlite_compileoption_get(${this.toSql()})`) as any; + } + sqliteCompileoptionUsed(): types.Integer { + return types.Integer.from(sql`sqlite_compileoption_used(${this.toSql()})`) as any; + } + sqrt(): types.Real { + return types.Real.from(sql`sqrt(${this.toSql()})`) as any; + } + strftime(): types.Text { + return types.Text.from(sql`strftime(${this.toSql()})`) as any; + } + stringAgg(arg0: types.Integer): types.Text>> { + return types.Text.from(sql`string_agg(${this.toSql()}, ${arg0.toSql()})`) as any; + } + substr(arg0: types.Integer): types.Text>> { + return types.Text.from(sql`substr(${this.toSql()}, ${arg0.toSql()})`) as any; + } + substring(arg0: types.Integer): types.Text>> { + return types.Text.from(sql`substring(${this.toSql()}, ${arg0.toSql()})`) as any; + } + subtype(): types.Integer { + return types.Integer.from(sql`subtype(${this.toSql()})`) as any; + } + sum(): types.Integer { + return types.Integer.from(sql`sum(${this.toSql()})`) as any; + } + tan(): types.Real { + return types.Real.from(sql`tan(${this.toSql()})`) as any; + } + tanh(): types.Real { + return types.Real.from(sql`tanh(${this.toSql()})`) as any; + } + time(): types.Text { + return types.Text.from(sql`time(${this.toSql()})`) as any; + } + timediff(arg0: types.Integer): types.Text>> { + return types.Text.from(sql`timediff(${this.toSql()}, ${arg0.toSql()})`) as any; + } + total(): types.Real { + return types.Real.from(sql`total(${this.toSql()})`) as any; + } + trim(): types.Text { + return types.Text.from(sql`trim(${this.toSql()})`) as any; + } + trunc(): types.Integer { + return types.Integer.from(sql`trunc(${this.toSql()})`) as any; + } + typeof(): types.Text { + return types.Text.from(sql`typeof(${this.toSql()})`) as any; + } + unicode(): types.Integer { + return types.Integer.from(sql`unicode(${this.toSql()})`) as any; + } + unistr(): types.Text { + return types.Text.from(sql`unistr(${this.toSql()})`) as any; + } + unistrQuote(): types.Text { + return types.Text.from(sql`unistr_quote(${this.toSql()})`) as any; + } + unixepoch(): types.Integer { + return types.Integer.from(sql`unixepoch(${this.toSql()})`) as any; + } + unlikely(): types.Integer { + return types.Integer.from(sql`unlikely(${this.toSql()})`) as any; + } + upper(): types.Text { + return types.Text.from(sql`upper(${this.toSql()})`) as any; + } + zeroblob(): types.Blob { + return types.Blob.from(sql`zeroblob(${this.toSql()})`) as any; + } +} diff --git a/src/types/sqlite/generated/real.ts b/src/types/sqlite/generated/real.ts new file mode 100644 index 0000000..f7d0b9f --- /dev/null +++ b/src/types/sqlite/generated/real.ts @@ -0,0 +1,354 @@ +// Auto-generated by src/types/sqlite/generate.ts — do not edit. +// First-pass codegen: one method per (owner-type, function-name); +// same-type-args only. Heterogeneous overloads (e.g. substr) will +// be added via hand-curated overrides (Phase 1.4). +import { SqliteValue } from "../base"; +import { sql, type Sql } from "../../../builder/sql"; +import { meta } from "../../runtime"; +import type { NullOf, StrictNull } from "../../runtime"; +import * as types from "../index"; + +export class Real extends SqliteValue { + declare [meta]: { + __class: typeof Real; + __raw: Sql; + __nullability: N; + __nullable: Real<0 | 1>; + __nonNullable: Real<1>; + __aggregate: Real; + __any: Real; + }; + static override __typname = sql`REAL`; + static override __typnameText = "real"; + + abs(): types.Real { + return types.Real.from(sql`abs(${this.toSql()})`) as any; + } + acosh(): types.Real { + return types.Real.from(sql`acosh(${this.toSql()})`) as any; + } + asinh(): types.Real { + return types.Real.from(sql`asinh(${this.toSql()})`) as any; + } + atan(): types.Real { + return types.Real.from(sql`atan(${this.toSql()})`) as any; + } + atan2(arg0: types.Real): types.Real>> { + return types.Real.from(sql`atan2(${this.toSql()}, ${arg0.toSql()})`) as any; + } + avg(): types.Real { + return types.Real.from(sql`avg(${this.toSql()})`) as any; + } + ceil(): types.Real { + return types.Real.from(sql`ceil(${this.toSql()})`) as any; + } + ceiling(): types.Real { + return types.Real.from(sql`ceiling(${this.toSql()})`) as any; + } + char(): types.Text { + return types.Text.from(sql`char(${this.toSql()})`) as any; + } + concat(arg0: types.Real): types.Text>> { + return types.Text.from(sql`concat(${this.toSql()}, ${arg0.toSql()})`) as any; + } + cos(): types.Real { + return types.Real.from(sql`cos(${this.toSql()})`) as any; + } + cosh(): types.Real { + return types.Real.from(sql`cosh(${this.toSql()})`) as any; + } + count(): types.Integer { + return types.Integer.from(sql`count(${this.toSql()})`) as any; + } + date(): types.Text { + return types.Text.from(sql`date(${this.toSql()})`) as any; + } + datetime(): types.Text { + return types.Text.from(sql`datetime(${this.toSql()})`) as any; + } + degrees(): types.Real { + return types.Real.from(sql`degrees(${this.toSql()})`) as any; + } + exp(): types.Real { + return types.Real.from(sql`exp(${this.toSql()})`) as any; + } + firstValue(): types.Real { + return types.Real.from(sql`first_value(${this.toSql()})`) as any; + } + floor(): types.Real { + return types.Real.from(sql`floor(${this.toSql()})`) as any; + } + format(): types.Text { + return types.Text.from(sql`format(${this.toSql()})`) as any; + } + fts5Insttoken(): types.Real { + return types.Real.from(sql`fts5_insttoken(${this.toSql()})`) as any; + } + fts5Locale(arg0: types.Real): types.Blob>> { + return types.Blob.from(sql`fts5_locale(${this.toSql()}, ${arg0.toSql()})`) as any; + } + glob(arg0: types.Real): types.Integer>> { + return types.Integer.from(sql`glob(${this.toSql()}, ${arg0.toSql()})`) as any; + } + groupConcat(): types.Text { + return types.Text.from(sql`group_concat(${this.toSql()})`) as any; + } + hex(): types.Text { + return types.Text.from(sql`hex(${this.toSql()})`) as any; + } + ifnull(arg0: types.Real): types.Real>> { + return types.Real.from(sql`ifnull(${this.toSql()}, ${arg0.toSql()})`) as any; + } + instr(arg0: types.Real): types.Integer>> { + return types.Integer.from(sql`instr(${this.toSql()}, ${arg0.toSql()})`) as any; + } + json(): types.Text { + return types.Text.from(sql`json(${this.toSql()})`) as any; + } + jsonArray(): types.Text { + return types.Text.from(sql`json_array(${this.toSql()})`) as any; + } + jsonArrayInsert(): types.Text { + return types.Text.from(sql`json_array_insert(${this.toSql()})`) as any; + } + jsonArrayLength(): types.Integer { + return types.Integer.from(sql`json_array_length(${this.toSql()})`) as any; + } + jsonb(): types.Blob { + return types.Blob.from(sql`jsonb(${this.toSql()})`) as any; + } + jsonbArray(): types.Blob { + return types.Blob.from(sql`jsonb_array(${this.toSql()})`) as any; + } + jsonbArrayInsert(): types.Blob { + return types.Blob.from(sql`jsonb_array_insert(${this.toSql()})`) as any; + } + jsonbGroupArray(): types.Blob { + return types.Blob.from(sql`jsonb_group_array(${this.toSql()})`) as any; + } + jsonbGroupObject(arg0: types.Real): types.Blob>> { + return types.Blob.from(sql`jsonb_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonbInsert(): types.Blob { + return types.Blob.from(sql`jsonb_insert(${this.toSql()})`) as any; + } + jsonbPatch(arg0: types.Real): types.Blob>> { + return types.Blob.from(sql`jsonb_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonbRemove(): types.Blob { + return types.Blob.from(sql`jsonb_remove(${this.toSql()})`) as any; + } + jsonbReplace(): types.Blob { + return types.Blob.from(sql`jsonb_replace(${this.toSql()})`) as any; + } + jsonbSet(): types.Blob { + return types.Blob.from(sql`jsonb_set(${this.toSql()})`) as any; + } + jsonErrorPosition(): types.Integer { + return types.Integer.from(sql`json_error_position(${this.toSql()})`) as any; + } + jsonGroupArray(): types.Text { + return types.Text.from(sql`json_group_array(${this.toSql()})`) as any; + } + jsonGroupObject(arg0: types.Real): types.Text>> { + return types.Text.from(sql`json_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonInsert(): types.Text { + return types.Text.from(sql`json_insert(${this.toSql()})`) as any; + } + jsonPatch(arg0: types.Real): types.Text>> { + return types.Text.from(sql`json_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonPretty(): types.Text { + return types.Text.from(sql`json_pretty(${this.toSql()})`) as any; + } + jsonQuote(): types.Text { + return types.Text.from(sql`json_quote(${this.toSql()})`) as any; + } + jsonRemove(): types.Text { + return types.Text.from(sql`json_remove(${this.toSql()})`) as any; + } + jsonReplace(): types.Text { + return types.Text.from(sql`json_replace(${this.toSql()})`) as any; + } + jsonSet(): types.Text { + return types.Text.from(sql`json_set(${this.toSql()})`) as any; + } + jsonType(): types.Text { + return types.Text.from(sql`json_type(${this.toSql()})`) as any; + } + jsonValid(): types.Integer { + return types.Integer.from(sql`json_valid(${this.toSql()})`) as any; + } + julianday(): types.Real { + return types.Real.from(sql`julianday(${this.toSql()})`) as any; + } + lag(arg0: types.Real, arg1: types.Real): types.Real | NullOf>> { + return types.Real.from(sql`lag(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + } + lastValue(): types.Real { + return types.Real.from(sql`last_value(${this.toSql()})`) as any; + } + lead(arg0: types.Real, arg1: types.Real): types.Real | NullOf>> { + return types.Real.from(sql`lead(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + } + length(): types.Integer { + return types.Integer.from(sql`length(${this.toSql()})`) as any; + } + like(arg0: types.Real): types.Integer>> { + return types.Integer.from(sql`like(${this.toSql()}, ${arg0.toSql()})`) as any; + } + likely(): types.Real { + return types.Real.from(sql`likely(${this.toSql()})`) as any; + } + ln(): types.Real { + return types.Real.from(sql`ln(${this.toSql()})`) as any; + } + log(): types.Real { + return types.Real.from(sql`log(${this.toSql()})`) as any; + } + log10(): types.Real { + return types.Real.from(sql`log10(${this.toSql()})`) as any; + } + log2(): types.Real { + return types.Real.from(sql`log2(${this.toSql()})`) as any; + } + lower(): types.Text { + return types.Text.from(sql`lower(${this.toSql()})`) as any; + } + ltrim(): types.Text { + return types.Text.from(sql`ltrim(${this.toSql()})`) as any; + } + max(): types.Real { + return types.Real.from(sql`max(${this.toSql()})`) as any; + } + median(): types.Real { + return types.Real.from(sql`median(${this.toSql()})`) as any; + } + min(): types.Real { + return types.Real.from(sql`min(${this.toSql()})`) as any; + } + mod(arg0: types.Real): types.Real>> { + return types.Real.from(sql`mod(${this.toSql()}, ${arg0.toSql()})`) as any; + } + ntile(): types.Integer { + return types.Integer.from(sql`ntile(${this.toSql()})`) as any; + } + octetLength(): types.Integer { + return types.Integer.from(sql`octet_length(${this.toSql()})`) as any; + } + percentile(arg0: types.Real): types.Real>> { + return types.Real.from(sql`percentile(${this.toSql()}, ${arg0.toSql()})`) as any; + } + pow(arg0: types.Real): types.Real>> { + return types.Real.from(sql`pow(${this.toSql()}, ${arg0.toSql()})`) as any; + } + power(arg0: types.Real): types.Real>> { + return types.Real.from(sql`power(${this.toSql()}, ${arg0.toSql()})`) as any; + } + printf(): types.Text { + return types.Text.from(sql`printf(${this.toSql()})`) as any; + } + quote(): types.Text { + return types.Text.from(sql`quote(${this.toSql()})`) as any; + } + radians(): types.Real { + return types.Real.from(sql`radians(${this.toSql()})`) as any; + } + randomblob(): types.Blob { + return types.Blob.from(sql`randomblob(${this.toSql()})`) as any; + } + replace(arg0: types.Real, arg1: types.Real): types.Text | NullOf>> { + return types.Text.from(sql`replace(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + } + round(): types.Real { + return types.Real.from(sql`round(${this.toSql()})`) as any; + } + rtrim(): types.Text { + return types.Text.from(sql`rtrim(${this.toSql()})`) as any; + } + sign(): types.Integer { + return types.Integer.from(sql`sign(${this.toSql()})`) as any; + } + sin(): types.Real { + return types.Real.from(sql`sin(${this.toSql()})`) as any; + } + sinh(): types.Real { + return types.Real.from(sql`sinh(${this.toSql()})`) as any; + } + soundex(): types.Text { + return types.Text.from(sql`soundex(${this.toSql()})`) as any; + } + sqliteCompileoptionGet(): types.Text { + return types.Text.from(sql`sqlite_compileoption_get(${this.toSql()})`) as any; + } + sqliteCompileoptionUsed(): types.Integer { + return types.Integer.from(sql`sqlite_compileoption_used(${this.toSql()})`) as any; + } + sqrt(): types.Real { + return types.Real.from(sql`sqrt(${this.toSql()})`) as any; + } + strftime(): types.Text { + return types.Text.from(sql`strftime(${this.toSql()})`) as any; + } + stringAgg(arg0: types.Real): types.Text>> { + return types.Text.from(sql`string_agg(${this.toSql()}, ${arg0.toSql()})`) as any; + } + substr(arg0: types.Real): types.Text>> { + return types.Text.from(sql`substr(${this.toSql()}, ${arg0.toSql()})`) as any; + } + substring(arg0: types.Real): types.Text>> { + return types.Text.from(sql`substring(${this.toSql()}, ${arg0.toSql()})`) as any; + } + subtype(): types.Integer { + return types.Integer.from(sql`subtype(${this.toSql()})`) as any; + } + sum(): types.Real { + return types.Real.from(sql`sum(${this.toSql()})`) as any; + } + tan(): types.Real { + return types.Real.from(sql`tan(${this.toSql()})`) as any; + } + tanh(): types.Real { + return types.Real.from(sql`tanh(${this.toSql()})`) as any; + } + time(): types.Text { + return types.Text.from(sql`time(${this.toSql()})`) as any; + } + timediff(arg0: types.Real): types.Text>> { + return types.Text.from(sql`timediff(${this.toSql()}, ${arg0.toSql()})`) as any; + } + total(): types.Real { + return types.Real.from(sql`total(${this.toSql()})`) as any; + } + trim(): types.Text { + return types.Text.from(sql`trim(${this.toSql()})`) as any; + } + trunc(): types.Real { + return types.Real.from(sql`trunc(${this.toSql()})`) as any; + } + typeof(): types.Text { + return types.Text.from(sql`typeof(${this.toSql()})`) as any; + } + unicode(): types.Integer { + return types.Integer.from(sql`unicode(${this.toSql()})`) as any; + } + unistr(): types.Text { + return types.Text.from(sql`unistr(${this.toSql()})`) as any; + } + unistrQuote(): types.Text { + return types.Text.from(sql`unistr_quote(${this.toSql()})`) as any; + } + unixepoch(): types.Integer { + return types.Integer.from(sql`unixepoch(${this.toSql()})`) as any; + } + unlikely(): types.Real { + return types.Real.from(sql`unlikely(${this.toSql()})`) as any; + } + upper(): types.Text { + return types.Text.from(sql`upper(${this.toSql()})`) as any; + } + zeroblob(): types.Blob { + return types.Blob.from(sql`zeroblob(${this.toSql()})`) as any; + } +} diff --git a/src/types/sqlite/generated/text.ts b/src/types/sqlite/generated/text.ts new file mode 100644 index 0000000..f52813c --- /dev/null +++ b/src/types/sqlite/generated/text.ts @@ -0,0 +1,210 @@ +// Auto-generated by src/types/sqlite/generate.ts — do not edit. +// First-pass codegen: one method per (owner-type, function-name); +// same-type-args only. Heterogeneous overloads (e.g. substr) will +// be added via hand-curated overrides (Phase 1.4). +import { SqliteValue } from "../base"; +import { sql, type Sql } from "../../../builder/sql"; +import { meta } from "../../runtime"; +import type { NullOf, StrictNull } from "../../runtime"; +import * as types from "../index"; + +export class Text extends SqliteValue { + declare [meta]: { + __class: typeof Text; + __raw: Sql; + __nullability: N; + __nullable: Text<0 | 1>; + __nonNullable: Text<1>; + __aggregate: Text; + __any: Text; + }; + static override __typname = sql`TEXT`; + static override __typnameText = "text"; + + abs(): types.Real { + return types.Real.from(sql`abs(${this.toSql()})`) as any; + } + avg(): types.Real { + return types.Real.from(sql`avg(${this.toSql()})`) as any; + } + char(): types.Text { + return types.Text.from(sql`char(${this.toSql()})`) as any; + } + concat(arg0: types.Text): types.Text>> { + return types.Text.from(sql`concat(${this.toSql()}, ${arg0.toSql()})`) as any; + } + count(): types.Integer { + return types.Integer.from(sql`count(${this.toSql()})`) as any; + } + firstValue(): types.Text { + return types.Text.from(sql`first_value(${this.toSql()})`) as any; + } + format(): types.Text { + return types.Text.from(sql`format(${this.toSql()})`) as any; + } + fts5Insttoken(): types.Text { + return types.Text.from(sql`fts5_insttoken(${this.toSql()})`) as any; + } + fts5Locale(arg0: types.Text): types.Blob>> { + return types.Blob.from(sql`fts5_locale(${this.toSql()}, ${arg0.toSql()})`) as any; + } + geopolyGroupBbox(): types.Blob { + return types.Blob.from(sql`geopoly_group_bbox(${this.toSql()})`) as any; + } + glob(arg0: types.Text): types.Integer>> { + return types.Integer.from(sql`glob(${this.toSql()}, ${arg0.toSql()})`) as any; + } + groupConcat(): types.Text { + return types.Text.from(sql`group_concat(${this.toSql()})`) as any; + } + hex(): types.Text { + return types.Text.from(sql`hex(${this.toSql()})`) as any; + } + ifnull(arg0: types.Text): types.Text>> { + return types.Text.from(sql`ifnull(${this.toSql()}, ${arg0.toSql()})`) as any; + } + instr(arg0: types.Text): types.Integer>> { + return types.Integer.from(sql`instr(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonArray(): types.Text { + return types.Text.from(sql`json_array(${this.toSql()})`) as any; + } + jsonbArray(): types.Blob { + return types.Blob.from(sql`jsonb_array(${this.toSql()})`) as any; + } + jsonbGroupArray(): types.Blob { + return types.Blob.from(sql`jsonb_group_array(${this.toSql()})`) as any; + } + jsonbGroupObject(arg0: types.Text): types.Blob>> { + return types.Blob.from(sql`jsonb_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonbObject(arg0: types.Text): types.Blob>> { + return types.Blob.from(sql`jsonb_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonErrorPosition(): types.Integer { + return types.Integer.from(sql`json_error_position(${this.toSql()})`) as any; + } + jsonGroupArray(): types.Text { + return types.Text.from(sql`json_group_array(${this.toSql()})`) as any; + } + jsonGroupObject(arg0: types.Text): types.Text>> { + return types.Text.from(sql`json_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonObject(arg0: types.Text): types.Text>> { + return types.Text.from(sql`json_object(${this.toSql()}, ${arg0.toSql()})`) as any; + } + jsonQuote(): types.Text { + return types.Text.from(sql`json_quote(${this.toSql()})`) as any; + } + jsonValid(): types.Integer { + return types.Integer.from(sql`json_valid(${this.toSql()})`) as any; + } + lag(arg0: types.Text): types.Text>> { + return types.Text.from(sql`lag(${this.toSql()}, ${arg0.toSql()})`) as any; + } + lastValue(): types.Text { + return types.Text.from(sql`last_value(${this.toSql()})`) as any; + } + lead(arg0: types.Text): types.Text>> { + return types.Text.from(sql`lead(${this.toSql()}, ${arg0.toSql()})`) as any; + } + length(): types.Integer { + return types.Integer.from(sql`length(${this.toSql()})`) as any; + } + like(arg0: types.Text): types.Integer>> { + return types.Integer.from(sql`like(${this.toSql()}, ${arg0.toSql()})`) as any; + } + likely(): types.Text { + return types.Text.from(sql`likely(${this.toSql()})`) as any; + } + lower(): types.Text { + return types.Text.from(sql`lower(${this.toSql()})`) as any; + } + ltrim(): types.Text { + return types.Text.from(sql`ltrim(${this.toSql()})`) as any; + } + max(): types.Text { + return types.Text.from(sql`max(${this.toSql()})`) as any; + } + min(): types.Text { + return types.Text.from(sql`min(${this.toSql()})`) as any; + } + octetLength(): types.Integer { + return types.Integer.from(sql`octet_length(${this.toSql()})`) as any; + } + printf(): types.Text { + return types.Text.from(sql`printf(${this.toSql()})`) as any; + } + quote(): types.Text { + return types.Text.from(sql`quote(${this.toSql()})`) as any; + } + randomblob(): types.Blob { + return types.Blob.from(sql`randomblob(${this.toSql()})`) as any; + } + replace(arg0: types.Text, arg1: types.Text): types.Text | NullOf>> { + return types.Text.from(sql`replace(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + } + round(): types.Real { + return types.Real.from(sql`round(${this.toSql()})`) as any; + } + rtrim(): types.Text { + return types.Text.from(sql`rtrim(${this.toSql()})`) as any; + } + soundex(): types.Text { + return types.Text.from(sql`soundex(${this.toSql()})`) as any; + } + sqliteCompileoptionGet(): types.Text { + return types.Text.from(sql`sqlite_compileoption_get(${this.toSql()})`) as any; + } + sqliteCompileoptionUsed(): types.Integer { + return types.Integer.from(sql`sqlite_compileoption_used(${this.toSql()})`) as any; + } + strftime(): types.Text { + return types.Text.from(sql`strftime(${this.toSql()})`) as any; + } + stringAgg(arg0: types.Text): types.Text>> { + return types.Text.from(sql`string_agg(${this.toSql()}, ${arg0.toSql()})`) as any; + } + substr(arg0: types.Text): types.Text>> { + return types.Text.from(sql`substr(${this.toSql()}, ${arg0.toSql()})`) as any; + } + substring(arg0: types.Text): types.Text>> { + return types.Text.from(sql`substring(${this.toSql()}, ${arg0.toSql()})`) as any; + } + subtype(): types.Integer { + return types.Integer.from(sql`subtype(${this.toSql()})`) as any; + } + sum(): types.Real { + return types.Real.from(sql`sum(${this.toSql()})`) as any; + } + total(): types.Real { + return types.Real.from(sql`total(${this.toSql()})`) as any; + } + trim(): types.Text { + return types.Text.from(sql`trim(${this.toSql()})`) as any; + } + typeof(): types.Text { + return types.Text.from(sql`typeof(${this.toSql()})`) as any; + } + unhex(arg0: types.Text): types.Blob>> { + return types.Blob.from(sql`unhex(${this.toSql()}, ${arg0.toSql()})`) as any; + } + unicode(): types.Integer { + return types.Integer.from(sql`unicode(${this.toSql()})`) as any; + } + unistr(): types.Text { + return types.Text.from(sql`unistr(${this.toSql()})`) as any; + } + unistrQuote(): types.Text { + return types.Text.from(sql`unistr_quote(${this.toSql()})`) as any; + } + unlikely(): types.Text { + return types.Text.from(sql`unlikely(${this.toSql()})`) as any; + } + upper(): types.Text { + return types.Text.from(sql`upper(${this.toSql()})`) as any; + } + zeroblob(): types.Blob { + return types.Blob.from(sql`zeroblob(${this.toSql()})`) as any; + } +} diff --git a/src/types/sqlite/index.ts b/src/types/sqlite/index.ts new file mode 100644 index 0000000..4ac6c92 --- /dev/null +++ b/src/types/sqlite/index.ts @@ -0,0 +1,11 @@ +// SQLite dialect barrel. Codegen (`./generate.ts`) will populate +// generated/*.ts and augment this file between the [generated-*] +// markers below. Hand-written entries live outside the markers. +export { SqliteValue } from "./base"; +// [generated-start] +export { Blob } from "./generated/blob"; +export { Bool } from "./generated/bool"; +export { Integer } from "./generated/integer"; +export { Real } from "./generated/real"; +export { Text } from "./generated/text"; +// [generated-end] From 47e80be24a2d852e727dbe203b87effaf357867d Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 13:02:07 -0700 Subject: [PATCH 08/33] feat(sqlite): SqliteDriver + end-to-end smoke tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `SqliteDriver` wraps better-sqlite3 to satisfy the async `Driver` contract. Single in-process db, so `runInSingleConnection` is a pass-through. `.execute()` dispatches SELECT-shaped statements via `.all()` and non-reader statements via `.run()`. Row values from better-sqlite3 come back as typed JS (number, string, Buffer, bigint, null). Normalized to strings at the driver boundary so downstream `deserialize()` code keeps working against the PG-style `{[key: string]: string}` contract. Buffer → \\x-prefixed hex to match PG's bytea repr. Smoke tests exercise the full pipeline end-to-end: typed-value construction → composed method calls (abs, upper, lower, length, isNull/isNotNull) → compile with sqlite ctx (validates `?` placeholder emission, no `$N`) → better-sqlite3 execute → normalized rows. 8 tests, all passing. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/driver.ts | 75 ++++++++++++++++++++++++++++++ src/types/sqlite/smoke.test.ts | 85 ++++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 src/types/sqlite/smoke.test.ts diff --git a/src/driver.ts b/src/driver.ts index be50adc..0857465 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -2,6 +2,7 @@ import type { Sql } from "./builder/sql"; import { compile } from "./builder/sql"; import type { DialectName } from "./types/deserialize"; import type pg from "pg"; +import type BetterSqlite3 from "better-sqlite3"; // Rows come back as plain objects keyed by column name. Values are always // strings here because every type parser is overridden to return raw text; @@ -109,3 +110,77 @@ export class PgliteDriver implements Driver { await this.db.close(); } } + +// better-sqlite3 adapter. Synchronous under the hood; we wrap in +// Promise.resolve to satisfy the async Driver contract. Single +// in-process db serves all requests, so runInSingleConnection is a +// pass-through (nothing to acquire/release). +// +// Row value normalization: better-sqlite3 returns typed JS values +// (number, string, Buffer, bigint, null). Typegres' downstream +// deserialize() expects strings (PG contract). We stringify here so +// SQLite reads round-trip through the same code path. Details: +// - number, bigint → String(v) +// - Buffer → hex ("\xDEADBEEF"-style, mirrors PG's bytea repr) +// - null → null (passthrough — SQL NULL preserved) +// - string → identity +// Once the SQLite driver picks up bespoke handling for typed values +// this normalization can move down to just the deserializer layer. +export class SqliteDriver implements Driver { + readonly dialect: DialectName = "sqlite"; + + static async create( + filename: string = ":memory:", + options: BetterSqlite3.Options = {}, + ): Promise { + // eslint-disable-next-line no-restricted-syntax -- optional peer, matches PgDriver/PgliteDriver pattern + const mod = (await import("better-sqlite3")).default; + const db = new mod(filename, options); + return new SqliteDriver(db); + } + + private constructor(private db: BetterSqlite3.Database) {} + + async execute(query: Sql): Promise { + const c = compile(query, { dialect: this.dialect }); + return this.runOne(c.text, c.values); + } + + private runOne(text: string, values: readonly unknown[]): QueryResult { + const stmt = this.db.prepare(text); + // .all() only works on SELECT-like statements. For INSERT/UPDATE/ + // DELETE that lack RETURNING, .all() throws — fall back to .run(). + if (stmt.reader) { + const rows = stmt.all(...values) as { [key: string]: unknown }[]; + return { rows: rows.map(normalizeRow) }; + } + stmt.run(...values); + return { rows: [] }; + } + + async runInSingleConnection(cb: (execute: ExecuteFn) => Promise): Promise { + return cb((query) => Promise.resolve(this.execute(query))); + } + + async close(): Promise { + this.db.close(); + return Promise.resolve(); + } +} + +const normalizeValue = (v: unknown): string => { + if (v === null || v === undefined) { + // Preserved as null via cast; downstream checks for null-ness. + return v as unknown as string; + } + if (typeof v === "string") {return v;} + if (typeof v === "number" || typeof v === "bigint" || typeof v === "boolean") {return String(v);} + if (v instanceof Uint8Array) { + // Match PG bytea repr: \x-prefixed lowercase hex. + return "\\x" + Buffer.from(v).toString("hex"); + } + return String(v); +}; + +const normalizeRow = (row: { [key: string]: unknown }): { [key: string]: string } => + Object.fromEntries(Object.entries(row).map(([k, v]) => [k, normalizeValue(v)])); diff --git a/src/types/sqlite/smoke.test.ts b/src/types/sqlite/smoke.test.ts new file mode 100644 index 0000000..ae8535c --- /dev/null +++ b/src/types/sqlite/smoke.test.ts @@ -0,0 +1,85 @@ +// End-to-end smoke tests for the SQLite dialect. Exercises the full +// pipeline: typed-value construction → composed method calls → +// compile with sqlite ctx (? placeholders) → better-sqlite3 execute +// → row normalization → user gets a value. +// +// These tests are the first-real-world validation of the Phase 0 +// dialect wiring on the SQLite side. If the ctx doesn't dispatch, +// the tests fail with `$1` in the SQL text; if the codegen'd methods +// don't compose, TS fails at build time; if the driver adapter is +// broken, the runtime throws. +import { test, expect, beforeAll, afterAll } from "vitest"; +import { SqliteDriver } from "../../driver"; +import { Database } from "../../database"; +import { compile, sql } from "../../builder/sql"; +import { Integer, Text } from "./index"; + +let driver: SqliteDriver; +let db: Database; + +beforeAll(async () => { + driver = await SqliteDriver.create(":memory:"); + db = new Database(driver); +}); + +afterAll(async () => { + await driver.close(); +}); + +test("Integer.abs on a negative literal", async () => { + const expr = Integer.from(-5).abs(); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("5"); +}); + +test("Integer.abs composed with itself is idempotent", async () => { + const expr = Integer.from(-3).abs().abs(); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("3"); +}); + +test("Text.upper on a literal", async () => { + const expr = Text.from("hello").upper(); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("HELLO"); +}); + +test("Text.upper composed with Text.length", async () => { + const expr = Text.from("hello").upper().length(); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("5"); +}); + +test("Text.lower composed with Text.upper (round-trip)", async () => { + const expr = Text.from("Hello").upper().lower(); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("hello"); +}); + +test("isNull returns 1 for NULL, 0 for a value", async () => { + const nullExpr = Text.from(sql`NULL`).isNull(); + const notNullExpr = Text.from("x").isNull(); + const r = await db.execute( + sql`SELECT ${nullExpr.toSql()} AS n, ${notNullExpr.toSql()} AS nn`, + ); + // SQLite returns 1/0 as integer for boolean expressions; we normalize to strings + expect(r.rows[0]!["n"]).toBe("1"); + expect(r.rows[0]!["nn"]).toBe("0"); +}); + +test("isNotNull is inverse of isNull", async () => { + const expr = Text.from("x").isNotNull(); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("1"); +}); + +test("placeholder emission uses ? not $N", async () => { + // Integer.from(5) wraps in a TypedParam; compile should emit `?`. + const expr = Integer.from(5); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("5"); + // Direct compile probe — belt-and-suspenders. + const compiled = compile(expr.toSql(), { dialect: "sqlite" }); + expect(compiled.text).toContain("?"); + expect(compiled.text).not.toContain("$"); +}); From 83e7f1597ffed4513224da507b1708b14db5ac02 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 13:31:40 -0700 Subject: [PATCH 09/33] feat(sqlite): Table + QueryBuilder work end-to-end over SQLite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Widens the query/mutation builders from PG-only (`instanceof Any`) to dialect-agnostic (`instanceof SqlValue`) across ~15 runtime dispatch points + ~20 type refs. PG callers unchanged — Any still is-a SqlValue. Changes by file: - src/table.ts, src/util.ts, src/builder/{values,insert,update,query}.ts: Any → SqlValue at instanceof checks + type positions. `isColumn` / `getColumn` imports moved from postgres/overrides/any (re-export) to src/types/any (source). - src/types/runtime.ts: `NullOf`, `TsTypeOf`, `Aggregate`, `AggregateRow` widened from `T extends Any<...>` to `T extends SqlValue<...>` so the utilities work uniformly over PG's Any and SQLite's SqliteValue. - src/types/bool.ts: the shared `Bool` interface loses `and`/`or`/`not` and becomes a nominal marker. Concrete Bool classes' `.and(other: X | boolean)` are contravariantly incompatible with a shared method signature — trying to require the ops here breaks assignment from concrete to shared. Chaining callers cast through `any` (see `combinePredicates`); runtime validation still uses the `isBool` identity predicate. - src/types/meta.ts (new): extracted the `meta` symbol into its own tiny module. `types/any.ts` used to import `meta` from `runtime.ts`, but `runtime.ts` also does `import * as types from "./index"` which triggers the PG barrel chain — extending SqlValue via PG's generated any before any.ts had defined it. Splitting `meta` out breaks the cycle. - src/driver.ts (SqliteDriver): unwraps a single matched outer paren pair from compiled SQL. `QueryBuilder.FinalizedQuery.bind()` wraps its output in `(...)` for subquery-splicing; PG tolerates a parenthesized top-level, SQLite does not. - src/builder/{delete,update,query}.ts: `@expose` validators swapped from `z.instanceof(Bool)` (PG-only) to `z.custom> (isBool)` (dialect-agnostic via the identity predicate). Note: the broader "same-database provenance" concern is filed as ISSUES.md #16; this changes the check from PG-nominal to dialect-nominal (catches cross-dialect but not cross-tenant). - src/types/sqlite/table.test.ts (new): 7 end-to-end tests through the full Table → QueryBuilder → SqliteDriver stack — INSERT, SELECT with method composition (.upper()), .where predicates, INSERT/UPDATE/ DELETE ... RETURNING. Deferred (documented as comments in place, not blocking Phase 1): - QueryBuilder.scalar() stays PG-only — emits ROW() + array_agg + COALESCE(..., '{}'). Phase 2.1 Scalar AST node lands the SQLite dispatch (json_object + json_group_array). - `.where(true)` shorthand in delete/update still constructs a PG `Bool` — sqlite-only apps that need this will hit a nominal mismatch until the shorthand becomes dialect-aware. Test totals: 28 files, 550 passed, 1 skipped (was 27/544). PG suite green throughout. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/ISSUES.md | 48 ++++++++++++++ src/builder/delete.ts | 13 ++-- src/builder/insert.ts | 2 +- src/builder/query.test.ts | 6 +- src/builder/query.ts | 117 +++++++++++++++++++-------------- src/builder/update.ts | 17 ++--- src/builder/values.ts | 18 ++--- src/driver.ts | 27 +++++++- src/table.ts | 4 +- src/types/any.ts | 2 +- src/types/bool.ts | 25 ++++--- src/types/meta.ts | 11 ++++ src/types/runtime.ts | 33 ++++++---- src/types/sqlite/table.test.ts | 112 +++++++++++++++++++++++++++++++ src/util.ts | 16 ++--- 15 files changed, 343 insertions(+), 108 deletions(-) create mode 100644 src/types/meta.ts create mode 100644 src/types/sqlite/table.test.ts diff --git a/docs/ISSUES.md b/docs/ISSUES.md index 0ce78eb..dc95203 100644 --- a/docs/ISSUES.md +++ b/docs/ISSUES.md @@ -95,3 +95,51 @@ 14. ~~**`.live()` subscriptions**~~ — done (PR #72). Predicate extraction, reverse-index bus, MVCC-snapshot-aware re-iteration. + +16. **Cross-database provenance for typed values (RPC security).** Runtime + validators today check `v instanceof SqlValue` — "is this a typegres + value?" but not "*whose* typegres value?" Over RPC (exoeval), a client + can construct a `Bool` (or any typed expression) and hand it to + `db.execute(qb.where(theirBool))`. The check passes if the object is + a proper SqlValue instance; nothing verifies it was built *for the + Database the RPC handler is bound to*. + + Threats: + + - **Cross-dialect smuggling:** attacker on a SQLite-backed session + injects a Bool constructed against a Postgres schema. SQL emission + collides (`?` vs `$N` placeholders, wrong typenames). Coarsely + addressed by the dialect check that comes with the `Any` → `SqlValue` + sweep (Table+QB dialect-agnostic work), because `v.constructor.dialect.name` + is authoritative per class. + - **Cross-tenant smuggling** (same dialect, different DB instances): + values from tenant B's schema get spliced into tenant A's query. + Column names / OIDs matching by coincidence → info leak. Dialect + check does *not* catch this. + - **Cross-session smuggling** within one Database: some values carry + session-scoped state via `db.scope(principal)`. Bypassing the tag = + privilege escalation. + + Design options: + + - **Instance-scoped tagging.** Each `Database` mints a `Symbol()`; + values built through a db-scoped factory (`db.Int4.from(5)` instead + of `Int4.from(5)`) carry that tag. Runtime checks `v[dbIdKey] === this.dbId`. + Catches all three. Cost: breaking API change for existing PG callers; + RPC serialization needs to preserve the tag across the wire. + - **Scope-only.** Don't tag values; validate the compiled Sql tree at + `db.execute()` time — walk it and reject any SqlValue whose dialect + doesn't match ctx. Cheap, addresses cross-dialect only. + - **Opt-in session tagging.** Untagged values keep working (interop). + `db.scope(session).typedValue(x)` explicitly binds. Session-sensitive + methods (mutation, sensitive-table `.where`) refuse untagged values. + Backwards-compatible; enforcement lives where the security matters. + + Operator/method checks have the same story — `int.plus(other)` today + accepts any Int4-ish arg; under instance-tagging, `runtime.match()` + would enforce the tag matches `this`. Single code path to protect. + + Not blocking Phase 1 (SQLite dialect work), but *is* blocking any RPC + production deployment with multi-tenant or cross-dialect setups. Fold + into the exoeval hardening pass (relates to #13 gas accounting — both + are RPC-boundary threats). diff --git a/src/builder/delete.ts b/src/builder/delete.ts index ddfc80b..65502a9 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -1,6 +1,7 @@ import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; import { Bool } from "../types"; +import { isBool, type Bool as SharedBool } from "../types/bool"; import type { RowType, RowTypeToTsType } from "./query"; import { combinePredicates, compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; @@ -12,7 +13,7 @@ type Namespace = { [K in Name]: T }; type DeleteOpts = { instance: T; - where?: (ns: Namespace) => Bool; + where?: (ns: Namespace) => SharedBool; returning?: (ns: Namespace) => R; }; @@ -23,7 +24,7 @@ type FinalizedDeleteOpts; + where: SharedBool; returning?: R; }; @@ -59,10 +60,10 @@ export class DeleteBuilder z.instanceof(Bool)))])) - where(fn: ((ns: Namespace) => Bool) | true): DeleteBuilder { - const wrapped: (ns: Namespace) => Bool = - fn === true ? () => Bool.from(sql`TRUE`) as Bool : fn; + @expose(z.union([z.literal(true), fn.returns(z.custom>(isBool))])) + where(fn: ((ns: Namespace) => SharedBool) | true): DeleteBuilder { + const wrapped: (ns: Namespace) => SharedBool = + fn === true ? () => Bool.from(sql`TRUE`) as SharedBool : fn; return new DeleteBuilder({ ...this.#opts, where: combinePredicates(this.#opts.where, wrapped), diff --git a/src/builder/insert.ts b/src/builder/insert.ts index 7c091e8..9a2eb70 100644 --- a/src/builder/insert.ts +++ b/src/builder/insert.ts @@ -4,7 +4,7 @@ import type { RowType, RowTypeToTsType } from "./query"; import { compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; import { Database } from "../database"; -import { getColumn } from "../types/postgres/overrides/any"; +import { getColumn } from "../types/any"; import { meta } from "../types/runtime"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; diff --git a/src/builder/query.test.ts b/src/builder/query.test.ts index dc0e468..8fedab2 100644 --- a/src/builder/query.test.ts +++ b/src/builder/query.test.ts @@ -834,7 +834,11 @@ test("where defers callback validation — bad return only throws at compile", ( .values({ a: Int4.from(1) }) // @ts-expect-error — callback must return Bool .where(() => 42); - expectReturnValidationError(() => compile(q, pgCtx), /expected Bool, received number/); + // With the shared `isBool` predicate (`z.custom(isBool)`), Zod emits a + // generic `Invalid input` message. The typed `expected Bool, received + // number` output was specific to `z.instanceof(Bool)`; there's no way + // to recover the same message via z.custom without a message override. + expectReturnValidationError(() => compile(q, pgCtx), /Invalid input/); }); test("orderBy defers — empty array fails .min(1) at compile", () => { diff --git a/src/builder/query.ts b/src/builder/query.ts index 53372fb..f0ad5f1 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -1,8 +1,17 @@ import type { BoundSql } from "./sql"; import { sql, Sql, Alias, compile, pgCtx } from "./sql"; import { Database } from "../database"; -import { Bool } from "../types"; -import { Any, Anyarray, Record } from "../types"; +// Anyarray / Record stay pinned to PG — scalar() below emits ROW() / +// array_agg / COALESCE which are PG-specific. When the Scalar AST node +// dispatches per-dialect (Phase 2.1) these will be gated by ctx.dialect. +import { Anyarray, Record } from "../types"; +// Dialect-agnostic base for shape/predicate/instanceof checks — accepts +// PG's Any or SQLite's SqliteValue uniformly. +import { SqlValue } from "../types/any"; +// Shared Bool detection — RPC validators check "is this a Bool?" without +// caring which dialect produced it. isBool uses each class's dialect +// object to identify Bool identity. +import { isBool, type Bool as SharedBool } from "../types/bool"; import { type TsTypeOf, type Nullable, type AggregateRow, meta } from "../types/runtime"; import { fn, expose } from "../exoeval/tool"; import { isTableClass, TableBase } from "../table"; @@ -13,7 +22,7 @@ import { Values } from "./values"; export const compileSelectList = (output: RowType, omitAliases = false): Sql => { return sql.join( Object.entries(output).flatMap(([k, v]) => - v instanceof Any ? [ + v instanceof SqlValue ? [ omitAliases ? v.toSql() : sql`${v.toSql()} as ${sql.ident(k)}`] : [], ), @@ -24,12 +33,12 @@ export const reAlias = (row: R, alias: Alias): R => { // Preserve the prototype so Table-subclass methods, instanceof checks, // and isRowType all behave the same as on the source. Copy every own // descriptor — including symbol-keyed ones like toolFieldsSymbol — - // generically, replacing Any-typed columns with an alias-qualified + // generically, replacing typed columns with an alias-qualified // reference along the way. const out = Object.create(Object.getPrototypeOf(row)); for (const key of Reflect.ownKeys(row)) { const desc = Object.getOwnPropertyDescriptor(row, key)!; - if (desc.value instanceof Any) { + if (desc.value instanceof SqlValue) { Object.defineProperty(out, key, { ...desc, value: desc.value[meta].__class.from(sql.column(alias, sql.ident(key as string))), @@ -42,9 +51,10 @@ export const reAlias = (row: R, alias: Alias): R => { }; // Hydrate raw rows into typed instances that share the shape's prototype. -// Each column field is an Any wrapping a CAST(param) of the deserialized -// value — so methods on the class that reference `this.col` can compose -// into follow-up queries (operator methods accept Any via match()). +// Each column field is a SqlValue wrapping a CAST(param) of the +// deserialized value — so methods on the class that reference `this.col` +// can compose into follow-up queries (operator methods accept SqlValue +// via match()). // // This is the materializing counterpart to deserializeRows: instead of // plain JS primitives, you get class instances with callable methods. @@ -61,7 +71,7 @@ export const hydrateRows = ( for (const [k, raw] of Object.entries(row)) { const col = shape[k]; let value: unknown; - if (col instanceof Any) { + if (col instanceof SqlValue) { const deserialized = raw === null || raw === undefined ? null : col.deserialize(String(raw)); value = col[meta].__class.from(deserialized); @@ -75,7 +85,7 @@ export const hydrateRows = ( }; // Mapping of row name to type (class instance) -export type RowType = TableBase | { [k: string]: Any }; +export type RowType = TableBase | { [k: string]: SqlValue }; export const isRowType = (obj: unknown): obj is RowType => { if (obj === null || typeof obj !== "object") { return false; @@ -87,7 +97,7 @@ export const isRowType = (obj: unknown): obj is RowType => { if (proto !== Object.prototype && proto !== null) { return false; } - return Object.entries(obj).every(([_, v]) => v instanceof Any); + return Object.entries(obj).every(([_, v]) => v instanceof SqlValue); }; // All of the row types in the current namespace @@ -142,20 +152,24 @@ const isFromable = (obj: unknown): obj is Fromable => { ); }; +// The concrete Bool has `.and()`; the shared marker interface does not +// (see src/types/bool.ts — omitted for variance reasons). Cast through +// `any` for chaining; the runtime call succeeds on the concrete class. +type Chainable = { and(other: SharedBool): SharedBool }; export const combinePredicates = ( - left: ((ns: N) => Bool) | undefined, - right: (ns: N) => Bool, + left: ((ns: N) => SharedBool) | undefined, + right: (ns: N) => SharedBool, ) => { if (!left) { return right; } - return (ns: N) => left(ns).and(right(ns)); + return (ns: N) => (left(ns) as unknown as Chainable).and(right(ns)); }; // Bool-valued predicate combine (used by UPDATE/DELETE where the predicate // has already been evaluated against the single-table namespace). -export const combineBoolPredicates = (left: Bool | undefined, right: Bool): Bool => - left ? left.and(right) : right; +export const combineBoolPredicates = (left: SharedBool | undefined, right: SharedBool): SharedBool => + left ? (left as unknown as Chainable).and(right) : right; // Compose two RETURNING callbacks into one that returns their merged // shape. Throws on key conflict — used by mutation builders' returningMerge @@ -180,32 +194,32 @@ export const mergeReturning = | [Any, OrderDirection]; +type OrderByEntry = SqlValue | [SqlValue, OrderDirection]; const isOrderByEntry = (obj: unknown): obj is OrderByEntry => - obj instanceof Any || + obj instanceof SqlValue || (Array.isArray(obj) && obj.length === 2 && - obj[0] instanceof Any && + obj[0] instanceof SqlValue && (obj[1] === "asc" || obj[1] === "desc")); type Cardinality = "one" | "maybe" | "many"; const ZCardinality = z.union([z.literal("one"), z.literal("maybe"), z.literal("many")]); -export type QueryBuilderOptions[]> = { +export type QueryBuilderOptions[]> = { // Preferred name only. The QueryBuilder ctor creates its own fresh Alias // identity from this string, so every builder instance in a chain — and // each reuse — registers independently. tsAlias: string; select?: (ns: N) => O; - where?: (ns: N) => Bool; + where?: (ns: N) => SharedBool; groupBy?: (ns: N) => GB; - having?: (ns: N) => Bool; + having?: (ns: N) => SharedBool; orderBy?: (ns: N) => OrderByEntry[]; tables: [ { type: "from"; source: Fromable }, ...{ source: Fromable; - on: (ns: N) => Bool; + on: (ns: N) => SharedBool; type: "join" | "leftJoin"; }[], ]; @@ -216,7 +230,7 @@ export type QueryBuilderOptions[], + GB extends SqlValue[], Card extends Cardinality = "many", > extends Sql { public readonly opts: QueryBuilderOptions; @@ -239,8 +253,8 @@ export class QueryBuilder< } // Multiple `where` calls are combined with AND - @expose(fn.returns(z.lazy(() => z.instanceof(Bool)))) - where(where: (n: N) => Bool): QueryBuilder { + @expose(fn.returns(z.custom>(isBool))) + where(where: (n: N) => SharedBool): QueryBuilder { return new QueryBuilder({ ...this.opts, where: combinePredicates(this.opts.where, where), @@ -266,14 +280,14 @@ export class QueryBuilder< // the concrete subclass type (`Owners`, `Pets`, …). join( from: T, - on: (ns: N & { [K in T["tsAlias"]]: InstanceType }) => Bool, + on: (ns: N & { [K in T["tsAlias"]]: InstanceType }) => SharedBool, ): QueryBuilder }, O, GB>; join( from: Fromable, - on: (ns: N & { [k in A]: R }) => Bool, + on: (ns: N & { [k in A]: R }) => SharedBool, ): QueryBuilder; - @expose(z.custom(isFromable), fn.returns(z.lazy(() => z.instanceof(Bool)))) - join(from: Fromable, on: (ns: any) => Bool): any { + @expose(z.custom(isFromable), fn.returns(z.custom>(isBool))) + join(from: Fromable, on: (ns: any) => SharedBool): any { this.#assertNotInNamespace(from.tsAlias); return new QueryBuilder({ ...this.opts, @@ -283,14 +297,14 @@ export class QueryBuilder< leftJoin( from: T, - on: (ns: N & { [K in T["tsAlias"]]: RowTypeToNullable> }) => Bool, + on: (ns: N & { [K in T["tsAlias"]]: RowTypeToNullable> }) => SharedBool, ): QueryBuilder> }, O, GB>; leftJoin( from: Fromable, - onFn: (ns: N & { [k in A]: RowTypeToNullable }) => Bool, + onFn: (ns: N & { [k in A]: RowTypeToNullable }) => SharedBool, ): QueryBuilder }, O, GB>; - @expose(z.custom(isFromable), fn.returns(z.lazy(() => z.instanceof(Bool)))) - leftJoin(from: Fromable, onFn: (ns: any) => Bool): any { + @expose(z.custom(isFromable), fn.returns(z.custom>(isBool))) + leftJoin(from: Fromable, onFn: (ns: any) => SharedBool): any { this.#assertNotInNamespace(from.tsAlias); return new QueryBuilder({ ...this.opts, @@ -304,11 +318,11 @@ export class QueryBuilder< // No args = whole-table aggregate (no GROUP BY clause emitted). // Multiple groupBy calls are concatenated (GROUP BY a, b, c). groupBy(): QueryBuilder<{ [K in keyof N]: AggregateRow }, {}, GB, Card>; - groupBy[]>( + groupBy[]>( groupBy: (n: N) => [...G], ): QueryBuilder<{ [K in keyof N]: AggregateRow } & G, {}, [...GB, ...G], Card>; - @expose(fn.returns(z.array(z.lazy(() => z.instanceof(Any)))).optional()) - groupBy(groupBy?: (n: N) => Any[]): any { + @expose(fn.returns(z.array(z.lazy(() => z.instanceof(SqlValue)))).optional()) + groupBy(groupBy?: (n: N) => SqlValue[]): any { const { select: _, ...opts } = this.opts; if (!groupBy) { // Whole-table aggregate: clear output, don't modify groupBy @@ -317,14 +331,14 @@ export class QueryBuilder< const prev = this.opts.groupBy; const mergedGroupBy = (ns: N) => - [...(prev?.(ns) ?? []), ...groupBy(ns)] as [...GB, ...Any[]]; + [...(prev?.(ns) ?? []), ...groupBy(ns)] as [...GB, ...SqlValue[]]; return new QueryBuilder({ ...opts, groupBy: mergedGroupBy } as any, this.card); } // Multiple `having` calls are combined with AND - @expose(fn.returns(z.lazy(() => z.instanceof(Bool)))) - having(having: (n: N) => Bool): QueryBuilder { + @expose(fn.returns(z.custom>(isBool))) + having(having: (n: N) => SharedBool): QueryBuilder { return new QueryBuilder({ ...this.opts, having: combinePredicates(this.opts.having, having), @@ -345,8 +359,8 @@ export class QueryBuilder< const result = orderBy(ns); // Normalize: single entry → array const entries: OrderByEntry[] = - result instanceof Any || - (Array.isArray(result) && result[0] instanceof Any && typeof result[1] === "string") + result instanceof SqlValue || + (Array.isArray(result) && result[0] instanceof SqlValue && typeof result[1] === "string") ? [result as OrderByEntry] : (result as OrderByEntry[]); return [...(prev?.(ns) ?? []), ...entries]; @@ -405,6 +419,13 @@ export class QueryBuilder< // TODO: ROW(), array_agg(), COALESCE should be regular typed ops once we support them // Conditional return type avoids overload resolution quirks: TS's `this:` // overloads can pick the wrong branch when the Card type is already narrowed. + // + // Currently PG-only: emits ROW() + array_agg + COALESCE(..., '{}'). SQLite + // needs json_object + json_group_array; that dispatch lands with the + // Phase 2.1 Scalar AST node. Until then, calling scalar() on a query + // that will run against SQLite raises at bind-time via the first source + // Table's dialect. Detection defers to bind() because construction + // doesn't know the Database yet. scalar(): [Card] extends ["one"] ? Record : [Card] extends ["maybe"] @@ -518,15 +539,15 @@ export class QueryBuilder< type AppliedOpts = { select: RowType; - where?: Bool | undefined; - groupBy?: Any[] | undefined; - having?: Bool | undefined; + where?: SharedBool | undefined; + groupBy?: SqlValue[] | undefined; + having?: SharedBool | undefined; orderBy?: OrderByEntry[] | undefined; tables: [ { type: "from"; source: Fromable; alias: Alias }, ...{ source: Fromable; - on: Bool; + on: SharedBool; type: "join" | "leftJoin"; alias: Alias; }[], @@ -550,7 +571,7 @@ export class FinalizedQuery extends Sql { ...(this.opts.groupBy?.map((g) => g.toSql()) ?? []), this.opts.having?.toSql(), ...(this.opts.orderBy?.flatMap((entry) => - entry instanceof Any ? [entry.toSql()] : [entry[0].toSql()], + entry instanceof SqlValue ? [entry.toSql()] : [entry[0].toSql()], ) ?? []), ].filter((x) => x instanceof Sql); } @@ -583,7 +604,7 @@ export class FinalizedQuery extends Sql { this.opts.orderBy && sql`ORDER BY ${sql.join( this.opts.orderBy.map((entry) => { - if (entry instanceof Any) { + if (entry instanceof SqlValue) { return entry.toSql(); } const [expr, dir] = entry; diff --git a/src/builder/update.ts b/src/builder/update.ts index 36db8b6..138e9a4 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -1,6 +1,7 @@ import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; import { Bool } from "../types"; +import { isBool, type Bool as SharedBool } from "../types/bool"; import type { SetRow } from "../types/runtime"; import { isSetRow } from "../types/runtime"; import { meta } from "../types/runtime"; @@ -8,7 +9,7 @@ import type { RowType, RowTypeToTsType } from "./query"; import { combinePredicates, compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; import { Database } from "../database"; -import { Any, getColumn } from "../types/postgres/overrides/any"; +import { SqlValue, getColumn } from "../types/any"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; @@ -16,7 +17,7 @@ type Namespace = { [K in Name]: T }; type UpdateOpts = { instance: T; - where?: (ns: Namespace) => Bool; + where?: (ns: Namespace) => SharedBool; set?: (ns: Namespace) => SetRow; returning?: (ns: Namespace) => R; }; @@ -27,7 +28,7 @@ type FinalizedUpdateOpts; + where: SharedBool; setRow: SetRow; returning?: R; }; @@ -58,7 +59,7 @@ export const compileSetClauses = ( setRow: SetRow, ): Sql[] => Object.entries(setRow as { [key: string]: unknown }).map(([k, v]) => { - if (v instanceof Any) { + if (v instanceof SqlValue) { return sql`${sql.ident(k)} = ${v.toSql()}`; } const col = getColumn(instance, k); @@ -78,10 +79,10 @@ export class UpdateBuilder z.instanceof(Bool)))])) - where(fn: ((ns: Namespace) => Bool) | true): UpdateBuilder { - const wrapped: (ns: Namespace) => Bool = - fn === true ? () => Bool.from(sql`TRUE`) as Bool : fn; + @expose(z.union([z.literal(true), fn.returns(z.custom>(isBool))])) + where(fn: ((ns: Namespace) => SharedBool) | true): UpdateBuilder { + const wrapped: (ns: Namespace) => SharedBool = + fn === true ? () => Bool.from(sql`TRUE`) as SharedBool : fn; return new UpdateBuilder({ ...this.#opts, where: combinePredicates(this.#opts.where, wrapped), diff --git a/src/builder/values.ts b/src/builder/values.ts index 4ec408e..bef458a 100644 --- a/src/builder/values.ts +++ b/src/builder/values.ts @@ -1,6 +1,6 @@ import type { BoundSql} from "./sql"; import { sql, Sql } from "./sql"; -import { Any } from "../types"; +import { SqlValue } from "../types/any"; import { meta } from "../types/runtime"; import { type RowType, type RowTypeToTsType, type Fromable } from "./query"; @@ -22,12 +22,12 @@ export class Values extends Sql implements Fromable { rowType(): R { return Object.fromEntries( Object.entries(this.vals0 as { [k: string]: unknown }).map(([k, v]) => { - if (!(v instanceof Any)) { + if (!(v instanceof SqlValue)) { throw new Error( - `db.values({ ${k}: ... }) — values column '${k}' must be a typed pg expression (e.g. Int4.from(5)), got ${typeof v}.`, + `db.values({ ${k}: ... }) — values column '${k}' must be a typed expression (e.g. Int4.from(5)), got ${typeof v}.`, ); } - return [k, (v[meta].__class as typeof Any).from(sql.unbound())]; + return [k, (v[meta].__class as typeof SqlValue).from(sql.unbound())]; }), ) as R; } @@ -38,16 +38,16 @@ export class Values extends Sql implements Fromable { const rowSqls = [this.vals0, ...this.valsRest].map((row) => { const vals = columnNames.map((k) => { let v = (row as { [key: string]: unknown })[k]; - if (!(v instanceof Any)) { + if (!(v instanceof SqlValue)) { const type = this.vals0[k as keyof R]; - if (!(type instanceof Any)) { + if (!(type instanceof SqlValue)) { throw new Error( - `db.values(): column '${k}' in the first row must be a typed pg expression so subsequent rows can coerce against it.`, + `db.values(): column '${k}' in the first row must be a typed expression so subsequent rows can coerce against it.`, ); } - v = (type[meta].__class as typeof Any).from(v); + v = (type[meta].__class as typeof SqlValue).from(v); } - return (v as Any).toSql(); + return (v as SqlValue).toSql(); }); return sql`(${sql.join(vals)})`; }); diff --git a/src/driver.ts b/src/driver.ts index 0857465..1596148 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -143,7 +143,14 @@ export class SqliteDriver implements Driver { async execute(query: Sql): Promise { const c = compile(query, { dialect: this.dialect }); - return this.runOne(c.text, c.values); + // QueryBuilder.FinalizedQuery.bind() wraps its output in `(...)` so + // it can be spliced as a subquery. SQLite refuses to prepare a + // top-level parenthesized statement ("near '(': syntax error"), + // while PG tolerates it. Unwrap one layer here as a driver-side + // affordance; only strips a *matched* outer pair to avoid mangling + // user-authored `sql\`(SELECT ...)\`` fragments. + const text = stripMatchedOuterParens(c.text); + return this.runOne(text, c.values); } private runOne(text: string, values: readonly unknown[]): QueryResult { @@ -168,6 +175,24 @@ export class SqliteDriver implements Driver { } } +// Strip one outer pair of parentheses iff they balance to enclose the +// entire string. `(SELECT 1)` → `SELECT 1`; `(SELECT 1) UNION (SELECT 2)` +// stays as-is (the leading `(` closes early and re-opens). This keeps +// the driver honest about what it's unwrapping. +const stripMatchedOuterParens = (s: string): string => { + const t = s.trim(); + if (!t.startsWith("(") || !t.endsWith(")")) {return s;} + let depth = 0; + for (let i = 0; i < t.length; i++) { + if (t[i] === "(") {depth++;} + else if (t[i] === ")") { + depth--; + if (depth === 0 && i !== t.length - 1) {return s;} + } + } + return t.slice(1, -1); +}; + const normalizeValue = (v: unknown): string => { if (v === null || v === undefined) { // Preserved as null via cast; downstream checks for null-ness. diff --git a/src/table.ts b/src/table.ts index ae57963..5ee8faf 100644 --- a/src/table.ts +++ b/src/table.ts @@ -5,7 +5,7 @@ import { QueryBuilder } from "./builder/query"; import { DeleteBuilder } from "./builder/delete"; import { UpdateBuilder } from "./builder/update"; import { InsertBuilder } from "./builder/insert"; -import { isColumn } from "./types/postgres/overrides/any"; +import { isColumn } from "./types/any"; import type { InsertRow } from "./types/runtime"; // A per-op SQL rewrite hook. Tables opt in via the `transformer` option; @@ -143,7 +143,7 @@ export abstract class TableBase { } // Enumerate column field names on a Table instance. Columns are field -// initializers that hold an Any with an Unbound sentinel; isColumn +// initializers that hold a SqlValue with an Unbound sentinel; isColumn // filters out expressions and non-column fields. export const columnFieldNames = (instance: TableBase): string[] => { return Object.getOwnPropertyNames(instance).filter( diff --git a/src/types/any.ts b/src/types/any.ts index 6e6b41a..329065c 100644 --- a/src/types/any.ts +++ b/src/types/any.ts @@ -21,7 +21,7 @@ import { Cast, Column, Param, sql, Sql, TypedParam, Unbound } from "../builder/sql"; import { isPlainData } from "../util"; import { getTypeDef, type DialectName } from "./deserialize"; -import { meta } from "./runtime"; +import { meta } from "./meta"; import type { BoolClass } from "./bool"; import type { NullOf } from "./runtime"; diff --git a/src/types/bool.ts b/src/types/bool.ts index 57e7c06..ccdfa72 100644 --- a/src/types/bool.ts +++ b/src/types/bool.ts @@ -1,20 +1,25 @@ -// Dialect-agnostic Bool interface. Each dialect ships a concrete Bool -// class; the shared surface for `.isNull()`, `.in()`, etc. is captured -// here so SqlValue can return `Bool` without importing a concrete -// class from either dialect. +// Dialect-agnostic Bool marker interface. Each dialect ships a concrete +// Bool class with its own dialect-specific method surface (pg_catalog +// operators on PG, SQLite scalar comparisons on SQLite). This interface +// is intentionally minimal — just a nominal marker — because concrete +// Bool classes' `and`/`or`/`not` take contravariant arg types (each +// dialect's own concrete Bool). Trying to require them here creates a +// TS variance mismatch when a concrete class is assigned to `Bool`. +// +// Callers that need chaining (`combinePredicates`, etc.) should widen +// through `SqlValue` or use raw sql templates. RPC-boundary +// validation uses `isBool` at runtime — the identity check catches +// misuse without depending on the type system. // // isBool detection uses `v.constructor === v.constructor.dialect.bool` // — each dialect's Bool class is the canonical value of `dialect.bool`, // so the identity check is enough. No separate marker symbol needed. import type { Sql } from "../builder/sql"; import { SqlValue } from "./any"; -import type { StrictNull, NullOf } from "./runtime"; -export interface Bool extends SqlValue { - and | boolean>(other: M): Bool>>; - or | boolean>(other: M): Bool>>; - not(): Bool; -} +// Intentionally empty (structural extension of SqlValue) — see file +// comment on why chainable ops aren't declared here. +export interface Bool extends SqlValue {} // Constructor / static surface each dialect's Bool exposes. SqlValue's // isNull/isNotNull/in reach through `dialect.bool.from(...)` at call time. diff --git a/src/types/meta.ts b/src/types/meta.ts new file mode 100644 index 0000000..c19c089 --- /dev/null +++ b/src/types/meta.ts @@ -0,0 +1,11 @@ +// Global metadata symbol — hides internals from autocomplete. All type +// metadata (__class, __nullability, __aggregate, __nullable, etc.) +// lives under this key on `SqlValue` instances. +// +// Lives in its own tiny module so both `any.ts` (defines `SqlValue`) +// and `runtime.ts` (uses the symbol in type-utility definitions) can +// import it without triggering a load cycle. Previously the symbol +// lived in `runtime.ts`, but `runtime.ts` also does `import * as types +// from "./index"` which triggers the PG barrel — extending `SqlValue` +// via any generated class before `any.ts` had defined it. +export const meta = Symbol("typegres"); diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 86ea220..3b637e4 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -4,13 +4,19 @@ import type { BoundSql, Raw } from "../builder/sql"; import { Func, Op, Sql, sql } from "../builder/sql"; import * as types from "./index"; import type { Any } from "./index"; +// Shared base for type-level utilities (NullOf, TsTypeOf, Aggregate). +// Extracting an N from a typed value works uniformly across dialects +// because every dialect's root class extends SqlValue. +import type { SqlValue } from "./any"; import { getTypeDef } from "./deserialize"; import { isPlainData } from "../util"; import type { RowType } from "../builder/query"; -// Global metadata symbol — hides internals from autocomplete. -// All type metadata (__class, __nullable, __nonNullable, etc.) lives under this key. -export const meta = Symbol("typegres"); +// Global metadata symbol — re-exported here for existing callers. The +// authoritative source is `./meta.ts`, which sits below `any.ts` in the +// load order so it can't trigger the PG barrel chain. +export { meta } from "./meta"; +import { meta } from "./meta"; // Nullability: 0 = null, 1 = non-null, 0|1 = nullable, number = aggregate/unknown // StrictNull: null propagates — if any arg is null, result is null (proisstrict = true) @@ -18,14 +24,15 @@ export type StrictNull = number extends T ? number : T; // MaybeNull: function can return null even with non-null args (proisstrict = false) export type MaybeNull = number extends T ? number : 0 | T; -// Extract nullability from a pg expression or TS primitive -// Pg types extend Any → extract N. TS primitives (number, string, etc.) → 1 (non-null). -export type NullOf = T extends Any ? N : 1; +// Extract nullability from a typed value or TS primitive. +// Typed values extend SqlValue → extract N. TS primitives (number, +// string, etc.) → 1 (non-null). Works across dialects. +export type NullOf = T extends SqlValue ? N : 1; -// Extract the TS type that a pg type deserializes to. +// Extract the TS type that a dialect type deserializes to. // Uses the return type of deserialize(). For primitives passed directly, it's the type itself. // Resolve the runtime JS type of a column / typegres expression. -// Non-Any inputs collapse to `never` — methods, derived-column +// Non-SqlValue inputs collapse to `never` — methods, derived-column // functions, arbitrary class keys aren't deserialized and have no // "TS-side" type here. The fallback was previously `T`, which leaked // method types into row results (caller would think `row.method` @@ -33,7 +40,7 @@ export type NullOf = T extends Any ? N : 1; // // Nullability: N=0 → null, N=0|1 → U|null, N=1 → U, N=number → U (aggregate/unknown, not null). export type TsTypeOf = - T extends Any + T extends SqlValue ? T extends { deserialize: (_: any) => infer U } ? number extends N ? U @@ -45,15 +52,15 @@ export type TsTypeOf = : unknown : never; -// Extract the nullable variant of a pg type via the [meta] bag +// Extract the nullable variant of a dialect type via the [meta] bag export type Nullable = T extends { [meta]: { __nullable: infer U } } ? U : T; -// Extract the aggregate variant (N=number) of a pg type via the [meta] bag -export type Aggregate> = T[typeof meta]['__aggregate']; +// Extract the aggregate variant (N=number) of a dialect type via the [meta] bag +export type Aggregate> = T[typeof meta]['__aggregate']; // Transform a row type to aggregate context — all columns become N=number export type AggregateRow = { - [K in keyof R]: R[K] extends Any ? Aggregate : never; + [K in keyof R]: R[K] extends SqlValue ? Aggregate : never; }; // Keys of R that are column descriptors (have the __required brand from column()) diff --git a/src/types/sqlite/table.test.ts b/src/types/sqlite/table.test.ts new file mode 100644 index 0000000..1d70713 --- /dev/null +++ b/src/types/sqlite/table.test.ts @@ -0,0 +1,112 @@ +// Table + QueryBuilder smoke tests against SQLite. Extends the +// generated-method smoke suite (./smoke.test.ts) into the mutation +// path: Table("users") + INSERT / SELECT / UPDATE / DELETE, with +// RETURNING where useful. +// +// SQLite 3.35+ speaks the same RETURNING syntax as PG, so the mutation +// builders should compile identically once the receiving driver +// dispatches placeholders (`?` vs `$N`). +import { test, expect, beforeAll, afterAll } from "vitest"; +import { SqliteDriver } from "../../driver"; +import { Database } from "../../database"; +import { sql } from "../../builder/sql"; +import { Table } from "../../table"; +import { expose } from "../../exoeval/tool"; +import { Integer, Text } from "./index"; + +class Users extends Table("users") { + @expose() + id = Integer.column({ nonNull: true }); + @expose() + name = Text.column({ nonNull: true }); +} + +let driver: SqliteDriver; +let db: Database; + +beforeAll(async () => { + driver = await SqliteDriver.create(":memory:"); + db = new Database(driver); + // Bootstrap schema. The Table("users") class only owns the *shape*; + // the actual CREATE lives in application-land (or a codegen'd migration). + await db.execute(sql`CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL)`); +}); + +afterAll(async () => { + await driver.close(); +}); + +test("INSERT rows and read them back with .from()", async () => { + await Users.insert({ id: 1, name: "alice" }).execute(db); + await Users.insert({ id: 2, name: "bob" }).execute(db); + const rows = await Users.from().execute(db); + expect(rows.length).toBe(2); + // Rows come out in insertion order (SQLite rowid ordering). + expect(rows[0]!.name).toBe("alice"); + expect(rows[1]!.name).toBe("bob"); +}); + +test("INSERT ... RETURNING id", async () => { + const returned = await Users.insert({ id: 3, name: "carol" }) + .returning(({ users }) => ({ id: users.id })) + .execute(db); + expect(returned).toEqual([{ id: 3 }]); +}); + +test("SELECT projection with method composition (upper)", async () => { + const rows = await Users.from() + .select((u) => ({ upperName: u.users.name.upper() })) + .execute(db); + expect(rows.map((r) => r.upperName)).toEqual(["ALICE", "BOB", "CAROL"]); +}); + +test("WHERE with sql template + .isNull()", async () => { + const rows = await Users.from() + .where((u) => u.users.name.isNotNull()) + .execute(db); + expect(rows.length).toBe(3); +}); + +test("WHERE with raw sql predicate + placeholder is `?`", async () => { + // The QB accepts any Bool-typed expression. Constructing one from a + // raw sql template exercises the ctx placeholder dispatch inside a + // WHERE clause (rather than in a bare projection). + const target = Text.from("alice"); + const rows = await Users.from() + .where((u) => + // Bool via raw template — the equivalent of an .eq() operator + // (which the codegen'd sqlite Text class doesn't have yet). + Text.from(sql`(${u.users.name.toSql()} = ${target.toSql()})`).isNotNull().and( + // The above always returns 1 for non-null result of `=` — including 0-valued + // matches. To get actual filter behavior, wrap in the raw comparison: + Text.from(sql`(${u.users.name.toSql()} = ${target.toSql()})`).isNotNull(), + ), + ) + .execute(db); + // isNotNull composed with itself matches all non-null equalities (i.e. + // all rows) — this test mainly validates that placeholders emit as + // `?` inside a compiled WHERE. Row count == full table means it did + // execute successfully. + expect(rows.length).toBe(3); +}); + +test("UPDATE ... RETURNING name", async () => { + const returned = await Users.update() + .where((u) => u.users.id.isNotNull()) + .set(() => ({ name: "renamed" })) + .returning(({ users }) => ({ name: users.name })) + .execute(db); + // Three rows updated → three returned. + expect(returned.length).toBe(3); + expect(returned.every((r) => r.name === "renamed")).toBe(true); +}); + +test("DELETE ... RETURNING id", async () => { + const returned = await Users.delete() + .where((u) => u.users.id.isNotNull()) + .returning(({ users }) => ({ id: users.id })) + .execute(db); + expect(returned.length).toBe(3); + const remaining = await Users.from().execute(db); + expect(remaining.length).toBe(0); +}); diff --git a/src/util.ts b/src/util.ts index c644559..e199911 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,5 +1,5 @@ import type { RowType } from "./builder/query"; -import {Any} from './types/index'; +import { SqlValue } from "./types/any"; import { exposedFieldsOf } from "./exoeval/tool"; // Plain-data check, recursive. Is this a value that's JSON-safe all @@ -9,12 +9,12 @@ import { exposedFieldsOf } from "./exoeval/tool"; // - plain objects (Object.prototype or null-proto), recursively // - arrays, recursively // Rejects any class instance at any depth — Date, Map, Set, custom -// classes, typegres `Any` expressions, etc. +// classes, typegres typed values (SqlValue), etc. // // Used as a security boundary at serialization (RPC wire) and at -// type-level wrapping (Any.from, Any.in). A class instance buried -// three levels deep is just as bad as one at the top, so the check -// recurses. +// type-level wrapping (SqlValue.from, SqlValue.in). A class instance +// buried three levels deep is just as bad as one at the top, so the +// check recurses. // // Cycles aren't handled — typegres callers don't pass cyclic data; // JSON.stringify would fail downstream anyway. A cyclic input here @@ -69,10 +69,10 @@ export const deserializeRows = ( .filter(([k]) => !exposed || exposed.has(k)) .map(([k, v]) => { const type = (shape as { [k: string]: unknown })[k]; - if (!(type instanceof Any)) { + if (!(type instanceof SqlValue)) { throw new Error( - `deserializeRows: output column '${k}' is not a typed pg expression (got ${JSON.stringify(type)}). ` + - `The select callback must return an object whose values are Any instances.`, + `deserializeRows: output column '${k}' is not a typed expression (got ${JSON.stringify(type)}). ` + + `The select callback must return an object whose values are typegres SqlValue instances.`, ); } if (v == null) { From 3c21f8e2d4271fe56b99833c5f099060b50e963b Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 15:34:34 -0700 Subject: [PATCH 10/33] refactor(compile): CompileContext carries Database; drivers take text+values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ground work for the provenance/tagging refactor (ISSUES.md #16). - `CompileContext = { database: DatabaseRef }` (was `{ dialect }`). DatabaseRef is a minimal structural view (id: symbol, dialect) declared in sql.ts to sidestep a value-import cycle; the concrete `Database` class implements it. - `Driver.execute(text, values)` — drivers no longer see the Sql tree. Compilation happens in `Database.#exec`, which supplies its own DatabaseRef as the ctx. `runInSingleConnection`'s callback signature updated in lockstep. - `Ident` grows an optional `database` slot + provenance check in `bind(ctx)`. Untagged Idents (server-authored raw templates, escape hatch) still pass through; tagged Idents that mismatch throw. Table classes and their emitted Idents remain untagged in this commit; the sweep to route them through `db.scopedIdent` comes next. - `Database` implements DatabaseRef (id, dialect, name?). Txn-bound Databases inherit their parent's id so a Table built outside the txn still compiles inside it. Adds `db.scopedIdent(name)` factory. - `Bus` takes a `Database` (not `Driver`) so it can compile via db.execute. - Test-helpers, live/db-live, bus tests, postgres/index.test all updated to use `db.execute(sql)` instead of `driver.execute(sql)`. All 550 tests green. Placeholder emission now reads `ctx.database.dialect`; sentinel pgCtx/sqliteCtx still work for compile-only paths (SQL emission tests, .debug()). Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/sql.ts | 58 +++++++++++++++++++++++++------- src/database.ts | 48 ++++++++++++++++++++------ src/driver.ts | 31 +++++++---------- src/live/bus.test.ts | 16 ++++----- src/live/bus.ts | 8 ++--- src/live/db-live.test.ts | 14 ++++---- src/live/test-helpers.ts | 6 ++-- src/types/postgres/index.test.ts | 7 ++-- src/types/sqlite/smoke.test.ts | 4 +-- 9 files changed, 125 insertions(+), 67 deletions(-) diff --git a/src/builder/sql.ts b/src/builder/sql.ts index 6afc8c7..4d54d8f 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -3,13 +3,35 @@ import type { DialectName } from "../types/deserialize"; export type CompiledSql = { text: string; values: unknown[] }; -// Threaded through bind() and compile() so dialect-aware nodes (Cast, -// Scalar, future per-dialect operator emission) can dispatch without -// baking dialect into the node at construction time. -export type CompileContext = { dialect: DialectName }; +// Minimal structural view of a Database — placed here to avoid a +// value-import cycle with database.ts. The concrete class implements +// this interface. +// +// `id` is the provenance identity (a `Symbol()` per Database). +// `dialect` gates syntax-specific emission (placeholder shape, +// operator/function names, typenames). +export interface DatabaseRef { + readonly id: symbol; + readonly dialect: DialectName; + readonly name?: string; +} -export const pgCtx: CompileContext = { dialect: "postgres" }; -export const sqliteCtx: CompileContext = { dialect: "sqlite" }; +// Threaded through bind() and compile(). `database` supplies dialect +// (for syntax dispatch) and provenance identity (checked against every +// tagged node at bind time). Untagged Ident/Func/Op nodes (server +// local, raw templates, escape hatch) pass through unchecked. +export type CompileContext = { database: DatabaseRef }; + +// Sentinel DatabaseRefs for compile-only paths (debug print, unit +// tests of SQL emission) where no real Database is present. Any +// Database-tagged node will mismatch and throw — tests that construct +// tagged nodes should build their own ctx from a real db. +export const pgCtx: CompileContext = { + database: { id: Symbol("pgCtx-sentinel"), dialect: "postgres" }, +}; +export const sqliteCtx: CompileContext = { + database: { id: Symbol("sqliteCtx-sentinel"), dialect: "sqlite" }, +}; // --- Root --- @@ -29,9 +51,7 @@ export abstract class Sql { // Base returns Promise so builder subclasses can narrow to // their specific row-array types without the covariance rules // complaining (QueryResult and a row array are disjoint shapes, so - // neither is a subtype of the other). For a raw `sql\`...\`` template - // the narrower type is QueryResult — callers can `db.execute(raw)` to - // get it typed, or cast the result of `raw.execute(db)`. + // neither is a subtype of the other). execute(db: Database): Promise { return db.execute(this); } @@ -91,8 +111,22 @@ export class Raw extends Sql { } export class Ident extends Sql { - constructor(readonly name: string) { super(); } - bind(): BoundSql { return this; } + // `database` is optional to keep the escape hatch alive: raw templates + // (`sql.ident("x")`) construct untagged Idents that pass through + // unchecked — trusted server-authored SQL. Table classes attached via + // `db.Table(name)` propagate their database to their emitted Idents; + // those are checked against ctx.database at bind time. + constructor(readonly name: string, readonly database?: DatabaseRef) { super(); } + bind(ctx: CompileContext): BoundSql { + if (this.database && this.database.id !== ctx.database.id) { + throw new Error( + `Ident '${this.name}' provenance mismatch: constructed in database ` + + `${this.database.name ?? this.database.id.toString()} but compiled against ` + + `${ctx.database.name ?? ctx.database.id.toString()}.`, + ); + } + return this; + } } export class Param extends Sql { @@ -235,7 +269,7 @@ export const compile = (root: Sql, ctx: CompileContext = pgCtx): CompiledSql => out.push(quoteIdent(atom.name)); } else if (atom instanceof Param) { values.push(atom.value); - out.push(ctx.dialect === "postgres" ? `$${values.length}` : "?"); + out.push(ctx.database.dialect === "postgres" ? `$${values.length}` : "?"); } else if (atom instanceof Alias) { const resolved = scope.resolve(atom); if (!resolved) { diff --git a/src/database.ts b/src/database.ts index 4362954..6969809 100644 --- a/src/database.ts +++ b/src/database.ts @@ -3,7 +3,7 @@ import type { Fromable, RowType, RowTypeToTsType } from "./builder/query"; import { QueryBuilder, hydrateRows } from "./builder/query"; import { deserializeRows } from "./util"; import type { Sql } from "./builder/sql"; -import { sql } from "./builder/sql"; +import { compile, sql, Ident, type DatabaseRef } from "./builder/sql"; import { Table, type TableBase, type TableOptions } from "./table"; import { Values } from "./builder/values"; import { InsertBuilder } from "./builder/insert"; @@ -39,7 +39,12 @@ const ISOLATION: { [K in TransactionIsolation]: { rank: number; begin: Sql } } = // `db.Table(name)` so every codegen-emitted class picks up the same C // without changing the generator. Default `undefined` matches the // pre-context behavior. -export class Database { +export class Database implements DatabaseRef { + // Per-Database provenance identity. Ident nodes constructed via this + // Database (through `db.scopedIdent`, `db.Table`, etc.) carry this id; + // compile checks match against ctx.database.id. + readonly id: symbol = Symbol("Database"); + readonly name?: string; #boundExecute?: ExecuteFn; // Active isolation on a txn-bound Database. `undefined` means either // pool-backed (no active txn) or ambient (txn opened without an @@ -51,13 +56,31 @@ export class Database { // through the driver's pool. A transaction-bound Database (constructed // internally via .transaction()) carries a single-connection ExecuteFn // so every query inside the txn callback lands on the same connection. - constructor(private driver: Driver, boundExecute?: ExecuteFn, isolation?: TransactionIsolation) { + // + // txn-bound databases share their parent's `id` — the Idents attached + // to a Table stay valid across the parent → txn boundary, so tests + // that build queries outside the txn and execute inside it still + // compile. + constructor(private driver: Driver, boundExecute?: ExecuteFn, isolation?: TransactionIsolation, parentId?: symbol) { if (boundExecute) { this.#boundExecute = boundExecute; } if (isolation) { this.#isolation = isolation; } + if (parentId) { this.id = parentId; } + } + + // Dialect forwarded from driver so provenance/compile checks can + // read it directly off the Database (DatabaseRef contract). + get dialect() { return this.driver.dialect; } + + // Provenance-tagged identifier factory. Prefer this over free-standing + // `sql.ident(name)` for anything that references schema (column, + // table, alias). Compile then enforces "same db" at bind time. + scopedIdent(name: string): Ident { + return new Ident(name, this); } #exec(query: Sql): Promise { - return (this.#boundExecute ?? this.driver.execute.bind(this.driver))(query); + const { text, values } = compile(query, { database: this }); + return (this.#boundExecute ?? this.driver.execute.bind(this.driver))(text, values); } // Overload resolution matches top-to-bottom and stops on the first @@ -167,18 +190,22 @@ export class Database { return fn(this); } return this.driver.runInSingleConnection(async (execute) => { - const tx = new Database(this.driver, execute, opts?.isolation); - await execute(opts?.isolation ? ISOLATION[opts.isolation].begin : sql`BEGIN`); + const tx = new Database(this.driver, execute, opts?.isolation, this.id); + const runSql = async (s: Sql) => { + const { text, values } = compile(s, { database: tx }); + return execute(text, values); + }; + await runSql(opts?.isolation ? ISOLATION[opts.isolation].begin : sql`BEGIN`); try { const result = await fn(tx); - await execute(sql`COMMIT`); + await runSql(sql`COMMIT`); return result; } catch (e) { // Preserve the original error even if ROLLBACK itself fails // (connection lost, etc.). Log the rollback failure but rethrow // the user's exception — it's the one they care about. try { - await execute(sql`ROLLBACK`); + await runSql(sql`ROLLBACK`); } catch (rollbackErr) { console.error("ROLLBACK failed after transaction error:", rollbackErr); } @@ -240,7 +267,8 @@ export class Database { // `startLive` does not run DDL — it assumes this table already exists. async installLiveEvents(): Promise { for (const stmt of eventsTableSqlStatements()) { - await this.driver.execute(stmt); + const { text, values } = compile(stmt, { database: this }); + await this.driver.execute(text, values); } } @@ -249,7 +277,7 @@ export class Database { throw new Error("startLive() must be called on a pool-backed Database, not inside a transaction"); } if (this.#bus) { throw new Error("Live bus already started"); } - this.#bus = new Bus(this.driver, opts); + this.#bus = new Bus(this, opts); await this.#bus.start(); } diff --git a/src/driver.ts b/src/driver.ts index 1596148..aa5dff5 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -1,5 +1,3 @@ -import type { Sql } from "./builder/sql"; -import { compile } from "./builder/sql"; import type { DialectName } from "./types/deserialize"; import type pg from "pg"; import type BetterSqlite3 from "better-sqlite3"; @@ -8,7 +6,11 @@ import type BetterSqlite3 from "better-sqlite3"; // strings here because every type parser is overridden to return raw text; // typed coercion happens downstream in QueryBuilder/InsertBuilder/etc. export type QueryResult = { rows: { [key: string]: string }[] }; -export type ExecuteFn = (query: Sql) => Promise; +// Drivers receive already-compiled text + values. Compilation happens in +// Database (which owns the CompileContext/DatabaseRef); the driver's +// only job is to hand the query to its underlying pool/wasm and normalize +// the result rows. +export type ExecuteFn = (text: string, values: readonly unknown[]) => Promise; export interface Driver { readonly dialect: DialectName; @@ -42,18 +44,14 @@ export class PgDriver implements Driver { private constructor(private pool: pg.Pool) {} - async execute(query: Sql): Promise { - const c = compile(query, { dialect: this.dialect }); - return this.pool.query(c.text, c.values); + async execute(text: string, values: readonly unknown[]): Promise { + return this.pool.query(text, values as unknown[]); } async runInSingleConnection(cb: (execute: ExecuteFn) => Promise): Promise { const client = await this.pool.connect(); try { - return await cb(async (query) => { - const c = compile(query, { dialect: this.dialect }); - return client.query(c.text, c.values); - }); + return await cb((text, values) => client.query(text, values as unknown[])); } finally { client.release(); } @@ -97,9 +95,8 @@ export class PgliteDriver implements Driver { private parsers: { [key: number]: (v: string) => string }, ) {} - async execute(query: Sql): Promise { - const c = compile(query, { dialect: this.dialect }); - return this.db.query(c.text, c.values, { parsers: this.parsers }) as Promise; + async execute(text: string, values: readonly unknown[]): Promise { + return this.db.query(text, values as unknown[], { parsers: this.parsers }) as Promise; } async runInSingleConnection(cb: (execute: ExecuteFn) => Promise): Promise { @@ -141,16 +138,14 @@ export class SqliteDriver implements Driver { private constructor(private db: BetterSqlite3.Database) {} - async execute(query: Sql): Promise { - const c = compile(query, { dialect: this.dialect }); + async execute(text: string, values: readonly unknown[]): Promise { // QueryBuilder.FinalizedQuery.bind() wraps its output in `(...)` so // it can be spliced as a subquery. SQLite refuses to prepare a // top-level parenthesized statement ("near '(': syntax error"), // while PG tolerates it. Unwrap one layer here as a driver-side // affordance; only strips a *matched* outer pair to avoid mangling // user-authored `sql\`(SELECT ...)\`` fragments. - const text = stripMatchedOuterParens(c.text); - return this.runOne(text, c.values); + return this.runOne(stripMatchedOuterParens(text), values); } private runOne(text: string, values: readonly unknown[]): QueryResult { @@ -166,7 +161,7 @@ export class SqliteDriver implements Driver { } async runInSingleConnection(cb: (execute: ExecuteFn) => Promise): Promise { - return cb((query) => Promise.resolve(this.execute(query))); + return cb((text, values) => Promise.resolve(this.execute(text, values))); } async close(): Promise { diff --git a/src/live/bus.test.ts b/src/live/bus.test.ts index 67a1774..4f29e97 100644 --- a/src/live/bus.test.ts +++ b/src/live/bus.test.ts @@ -1,6 +1,6 @@ import { test, expect } from "vitest"; import { sql } from "../builder/sql"; -import { driver, setupDb } from "../test-helpers"; +import { db, setupDb } from "../test-helpers"; import { Bus, CursorTooOldError, type Subscription } from "./bus"; import { type Cursor, parseSnapshot } from "./snapshot"; import { setupLiveEvents } from "./test-helpers"; @@ -9,12 +9,12 @@ setupDb(); setupLiveEvents(); const grabSnapshot = async (): Promise => { - const r = await driver.execute(sql`SELECT pg_current_snapshot()::text AS s`); + const r = await db.execute(sql`SELECT pg_current_snapshot()::text AS s`); return parseSnapshot((r.rows as { s: string }[])[0]!.s); }; const insertEvent = async (table: string, before: object | null, after: object | null) => { - await driver.execute(sql` + await db.execute(sql` INSERT INTO _typegres_live_events (xid, "table", before, after) VALUES ( pg_current_xact_id(), @@ -34,7 +34,7 @@ const waitedWithin = async (sub: Subscription, ms = 50): Promise => ]); test("Bus signals a subscription whose cursor doesn't see a matching event", async () => { - const bus = new Bus(driver); + const bus = new Bus(db); await bus.start(); const sub = bus.subscribe( @@ -52,7 +52,7 @@ test("Bus signals a subscription whose cursor doesn't see a matching event", asy }); test("Bus does not signal when the cursor already sees the event", async () => { - const bus = new Bus(driver); + const bus = new Bus(db); await bus.start(); // Insert event FIRST, then capture cursor — sub's snapshot sees it. @@ -70,7 +70,7 @@ test("Bus does not signal when the cursor already sees the event", async () => { }); test("subscribe returns undefined when in-memory backfill already shows a matching event", async () => { - const bus = new Bus(driver); + const bus = new Bus(db); await bus.start(); // Capture cursor BEFORE the event commits (sub won't see it). @@ -97,7 +97,7 @@ test("subscribe returns undefined when in-memory backfill already shows a matchi test("subscribe throws CursorTooOldError when cursor is older than the buffer floor", async () => { // Tiny window of 2 — easy to roll the floor past an old cursor. - const bus = new Bus(driver, { windowSize: 2 }); + const bus = new Bus(db, { windowSize: 2 }); await bus.start(); // Snapshot held by an "ancient" cursor predating any committed events. @@ -117,7 +117,7 @@ test("subscribe throws CursorTooOldError when cursor is older than the buffer fl }); test("subscribe throws if bus is not started", () => { - const bus = new Bus(driver); + const bus = new Bus(db); expect(() => bus.subscribe({ xmin: 0n, xmax: 0n, xip: new Set() }, new Map()), ).toThrow(/not started/); diff --git a/src/live/bus.ts b/src/live/bus.ts index 337e400..73286e8 100644 --- a/src/live/bus.ts +++ b/src/live/bus.ts @@ -1,4 +1,4 @@ -import type { Driver } from "../driver"; +import type { Database } from "../database"; import { sql } from "../builder/sql"; import { type Cursor, parseSnapshot, visible } from "./snapshot"; import type { PredicateSet } from "./extractor"; @@ -108,7 +108,7 @@ export class Bus { readonly #windowSize: number; constructor( - private driver: Driver, + private db: Database, opts: BusOptions = {}, ) { this.#intervalMs = opts.intervalMs ?? 100; @@ -284,7 +284,7 @@ export class Bus { } async #readCursor(): Promise { - const r = await this.driver.execute(sql`SELECT pg_current_snapshot()::text AS s`); + const r = await this.db.execute(sql`SELECT pg_current_snapshot()::text AS s`); return parseSnapshot((r.rows as { s: string }[])[0]!.s); } @@ -299,7 +299,7 @@ export class Bus { // refined by per-row visibility against both cursors. pg_snapshot // can't bind as a typed param so cursor text round-trips through // `::pg_snapshot`. - const r = await this.driver.execute(sql` + const r = await this.db.execute(sql` SELECT xid::text AS xid, "table", before::text AS before, after::text AS after FROM ${sql.ident(EVENTS_TABLE)} WHERE xid >= pg_snapshot_xmin(${sql.param(cursorToText(prev))}::pg_snapshot) diff --git a/src/live/db-live.test.ts b/src/live/db-live.test.ts index d16b765..1527167 100644 --- a/src/live/db-live.test.ts +++ b/src/live/db-live.test.ts @@ -2,7 +2,7 @@ import { test, expect, afterEach } from "vitest"; import { Int8, Text } from "../types"; import { sql } from "../builder/sql"; import { Table } from "../table"; -import { db, driver, setupDb } from "../test-helpers"; +import { db, setupDb } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; import { setupLiveEvents } from "./test-helpers"; setupDb(); @@ -15,13 +15,13 @@ afterEach(async () => { // db.stopLive may have already been called by the test — guarded by // its idempotent semantics. await db.stopLive(); - await driver.execute(sql`DROP TABLE IF EXISTS notes`); - await driver.execute(sql`DROP TABLE IF EXISTS users`); - await driver.execute(sql`DROP TABLE IF EXISTS dogs`); + await db.execute(sql`DROP TABLE IF EXISTS notes`); + await db.execute(sql`DROP TABLE IF EXISTS users`); + await db.execute(sql`DROP TABLE IF EXISTS dogs`); }); const makeNotesTable = async () => { - await driver.execute(sql`CREATE TABLE notes ( + await db.execute(sql`CREATE TABLE notes ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, user_id int8 NOT NULL, body text NOT NULL @@ -125,11 +125,11 @@ test("DELETE on a matching row re-yields with the row removed", async () => { }, 10_000); test("join: mutation on either side triggers re-yield (literal propagates across edge)", async () => { - await driver.execute(sql`CREATE TABLE users ( + await db.execute(sql`CREATE TABLE users ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL )`); - await driver.execute(sql`INSERT INTO users (id, name) OVERRIDING SYSTEM VALUE VALUES (5, 'alice')`); + await db.execute(sql`INSERT INTO users (id, name) OVERRIDING SYSTEM VALUE VALUES (5, 'alice')`); const Notes = await makeNotesTable(); class Users extends Table("users", { transformer: TypegresLiveEvents.makeTransformer() }) { diff --git a/src/live/test-helpers.ts b/src/live/test-helpers.ts index 3a76e6a..a4da5eb 100644 --- a/src/live/test-helpers.ts +++ b/src/live/test-helpers.ts @@ -1,6 +1,6 @@ import { afterEach, beforeAll } from "vitest"; import { sql } from "../builder/sql"; -import { driver } from "../test-helpers"; +import { db } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; // Opt-in for live tests: creates `_typegres_live_events` once at the start @@ -8,9 +8,9 @@ import { TypegresLiveEvents } from "./events"; // starts clean — no per-test boilerplate. export const setupLiveEvents = (): void => { beforeAll(async () => { - await driver.execute(TypegresLiveEvents.createTableSql()); + await db.execute(TypegresLiveEvents.createTableSql()); }); afterEach(async () => { - await driver.execute(sql`TRUNCATE _typegres_live_events`); + await db.execute(sql`TRUNCATE _typegres_live_events`); }); }; diff --git a/src/types/postgres/index.test.ts b/src/types/postgres/index.test.ts index d9915e3..971bb91 100644 --- a/src/types/postgres/index.test.ts +++ b/src/types/postgres/index.test.ts @@ -7,12 +7,13 @@ import { compile, pgCtx } from "../../builder/sql"; import { sql } from "../../builder/sql"; import { PgDriver } from "../../driver"; import { requireDatabaseUrl } from "../../pg"; -import type { Driver } from "../../driver"; +import { Database } from "../../database"; -let exec: Driver; +let exec: Database; beforeAll(async () => { - exec = await PgDriver.create(requireDatabaseUrl(), { max: 1 }); + const driver = await PgDriver.create(requireDatabaseUrl(), { max: 1 }); + exec = new Database(driver); }); afterAll(async () => { diff --git a/src/types/sqlite/smoke.test.ts b/src/types/sqlite/smoke.test.ts index ae8535c..262fc73 100644 --- a/src/types/sqlite/smoke.test.ts +++ b/src/types/sqlite/smoke.test.ts @@ -11,7 +11,7 @@ import { test, expect, beforeAll, afterAll } from "vitest"; import { SqliteDriver } from "../../driver"; import { Database } from "../../database"; -import { compile, sql } from "../../builder/sql"; +import { compile, sql, sqliteCtx } from "../../builder/sql"; import { Integer, Text } from "./index"; let driver: SqliteDriver; @@ -79,7 +79,7 @@ test("placeholder emission uses ? not $N", async () => { const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("5"); // Direct compile probe — belt-and-suspenders. - const compiled = compile(expr.toSql(), { dialect: "sqlite" }); + const compiled = compile(expr.toSql(), sqliteCtx); expect(compiled.text).toContain("?"); expect(compiled.text).not.toContain("$"); }); From 312065a1c4812c3c9e4bdfd2d4dc9496ff9979de Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 15:38:31 -0700 Subject: [PATCH 11/33] feat(provenance): Ident tagging via db.Table + column re-alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `Table(name, opts, database?)` factory takes an optional DatabaseRef; `db.Table(name)` supplies `this`. Static `Table("users")` leaves the new `database` static undefined (escape hatch, existing callers unchanged). - `TableBase.bind()` emits `new Ident(tableName, this.database)`. `TableBase.ident(name)` convenience for column-name idents from a Table class. - Mutation builders (insert/update/delete) route their tableName + column-name idents through `instance.constructor.ident(...)`, so a db-scoped Table propagates its provenance to every emitted Ident. - `reAlias` picks up the source Table's database when rewriting column refs into alias-qualified `Column(alias, Ident(name, db))`. - `QB.debug()` / mutation `.debug()` derive ctx from the first Table's database instead of hardcoding `pgCtx`. Falls back to sentinel for non-Table sources (db.values etc.). 550 tests green. Provenance enforcement is now active for any query whose Idents come from `db.Table(name)` — cross-db mismatches throw at compile with a clear message. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/delete.ts | 8 +++++--- src/builder/insert.ts | 8 +++++--- src/builder/query.ts | 18 +++++++++++++++--- src/builder/update.ts | 11 +++++++---- src/database.ts | 2 +- src/table.ts | 28 ++++++++++++++++++++++++---- 6 files changed, 57 insertions(+), 18 deletions(-) diff --git a/src/builder/delete.ts b/src/builder/delete.ts index 65502a9..88bd508 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -37,9 +37,10 @@ export class FinalizedDelete sql.ident(k)); + const tableCls = instance.constructor; + const columns = columnNames.map((k) => tableCls.ident(k)); const rowSqls = rows.map((row) => { const vals = columnNames.map((k) => { const v = row[k]; @@ -48,7 +49,7 @@ export class FinalizedInsert(row: R, alias: Alias): R => { // descriptor — including symbol-keyed ones like toolFieldsSymbol — // generically, replacing typed columns with an alias-qualified // reference along the way. + // + // Column-name Idents inherit their database from the source Table (so + // compile-time provenance follows through joins/aliases). Non-Table + // rows (plain object shapes from db.values, select-callback outputs) + // have no db — untagged Idents, escape-hatch behavior. + const database = row instanceof TableBase ? row.constructor.database : undefined; const out = Object.create(Object.getPrototypeOf(row)); for (const key of Reflect.ownKeys(row)) { const desc = Object.getOwnPropertyDescriptor(row, key)!; if (desc.value instanceof SqlValue) { Object.defineProperty(out, key, { ...desc, - value: desc.value[meta].__class.from(sql.column(alias, sql.ident(key as string))), + value: desc.value[meta].__class.from(sql.column(alias, new Ident(key as string, database))), }); } else { Object.defineProperty(out, key, desc); @@ -531,7 +537,13 @@ export class QueryBuilder< @expose() debug(): this { - const compiled = compile(this, pgCtx); + // Derive ctx from the first table's database if any — QB-emitted + // Idents inherit that provenance. Falls back to pgCtx (sentinel) + // for QBs built via db.values / non-Table sources. + const first = this.opts.tables[0]?.source; + const database = isTableClass(first) ? first.database : undefined; + const ctx = database ? { database } : pgCtx; + const compiled = compile(this, ctx); console.log("Debugging query:", { sql: compiled.text, parameters: compiled.values }); return this; } diff --git a/src/builder/update.ts b/src/builder/update.ts index 138e9a4..3105339 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -43,8 +43,9 @@ export class FinalizedUpdate( setRow: SetRow, ): Sql[] => Object.entries(setRow as { [key: string]: unknown }).map(([k, v]) => { + const ident = instance.constructor.ident(k); if (v instanceof SqlValue) { - return sql`${sql.ident(k)} = ${v.toSql()}`; + return sql`${ident} = ${v.toSql()}`; } const col = getColumn(instance, k); - return sql`${sql.ident(k)} = ${col[meta].__class.from(v).toSql()}`; + return sql`${ident} = ${col[meta].__class.from(v).toSql()}`; }); export class UpdateBuilder extends Sql { @@ -160,7 +162,8 @@ export class UpdateBuilder implements DatabaseRef { // generator. `Table` constrains `scope()` to accept only // values assignable to C, and pins `contextOf()`'s return type. public Table = (name: Name, opts: TableOptions = {}) => - Table(name, opts); + Table(name, opts, this); // --- Live queries --- // Bus is per-Driver (per-pool); a tx-bound Database delegates to its diff --git a/src/table.ts b/src/table.ts index 5ee8faf..d6b2348 100644 --- a/src/table.ts +++ b/src/table.ts @@ -1,5 +1,5 @@ -import { sql } from "./builder/sql"; -import type { BoundSql, Sql } from "./builder/sql"; +import { sql, Ident } from "./builder/sql"; +import type { BoundSql, DatabaseRef, Sql } from "./builder/sql"; import type { Fromable} from "./builder/query"; import { QueryBuilder } from "./builder/query"; import { DeleteBuilder } from "./builder/delete"; @@ -40,6 +40,12 @@ export type TableOptions = { export abstract class TableBase { static readonly tableName: string; static readonly tsAlias: string; + // Provenance handle set by `db.Table(name)`. Untagged (`undefined`) + // when the class was constructed via the static `Table(name)` factory + // — those emit unattributed Idents (escape hatch). db-scoped tables + // propagate their database to every ident they emit; compile-time + // provenance check enforces same-db at bind time. + static readonly database: DatabaseRef | undefined = undefined; // Mutation builders on this table run this at bind() time and on each // raw result row before deserialization. Default none. static readonly transformer: QueryTransformer | undefined = undefined; @@ -63,7 +69,15 @@ export abstract class TableBase { } static bind(this: typeof TableBase): BoundSql { - return sql.ident(this.tableName); + return new Ident(this.tableName, this.database); + } + + // Convenience: emit a database-tagged Ident from this table for use in + // column-name construction (used by reAlias, mutation builders' column + // lists, etc.). Falls back to an untagged Ident if the table wasn't + // constructed via db.Table. + static ident(this: typeof TableBase, name: string): Ident { + return new Ident(name, this.database); } // Entry point for query builders: e.g., `Users.from()` @@ -160,7 +174,11 @@ TableBase satisfies Fromable; // Apps that thread a context type via `typegres()` // + `db.Table(name)` get tables whose `scope()` argument and // `contextOf()` return type are pinned to `Principal`. -export const Table = (name: Name, opts: TableOptions = {}) => { +export const Table = ( + name: Name, + opts: TableOptions = {}, + database?: DatabaseRef, +) => { // Named class via computed-key shim — shows up as `name` in stack traces. const obj = { [name]: class extends TableBase { @@ -171,6 +189,8 @@ export const Table = (name: Name, opts: Tabl // Default value remains `undefined` until `scope()` overrides via // subclass; the type narrowing is purely compile-time. static override readonly context: C = undefined as C; + // Provenance handle from db.Table(); undefined for static Table(). + static override readonly database: DatabaseRef | undefined = database; }, }; type Obj = typeof obj; From 5d0355cc4f8ca41099dedc17af4caedcb6dc7f9e Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 15:41:00 -0700 Subject: [PATCH 12/33] feat(provenance): dialect tagging on Func/Op/UnaryOp/Cast/Srf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Constructors take an optional `dialect` slot; bind(ctx) throws if it disagrees with `ctx.database.dialect`. - `runtime.funcCall` / `runtime.opCall` pass `type.dialect.name`, so every codegen'd PG method emits a properly-tagged Func/Op node automatically (no codegen output changes needed — the helper does it). - `SqlValue.cast()` / `.from()` (via TypedParam) also pass dialect so CAST expressions carry provenance. - `Srf` tracks dialect from its first column's class; its bind() now takes ctx and emits `new Ident(name, ctx.database)` for the function-name identifier. - `Fromable.bind` widened to `(ctx?)`; `FinalizedQuery.bind` threads ctx to `t.source.bind(ctx)` so Srf sources see the compile ctx. Untagged nodes (Func/Op without dialect — hand-authored `sql` templates, raw fragments) still pass through unchecked. This is the escape hatch for server-authored SQL that doesn't route through a typed class. 550 tests green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/query.ts | 14 +++++---- src/builder/sql.ts | 68 +++++++++++++++++++++++++++++++++++++------- src/types/any.ts | 4 +-- src/types/runtime.ts | 27 +++++++++++++----- 4 files changed, 88 insertions(+), 25 deletions(-) diff --git a/src/builder/query.ts b/src/builder/query.ts index 9166402..f608c40 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -145,7 +145,11 @@ export const sortRowColumns = (row: R): R => { export type Fromable = { readonly tsAlias: A; rowType(): R; - bind(): BoundSql; + // Fromables may optionally consume the compile ctx (Srf uses it to + // check dialect + tag its function-name Ident); Table.bind() ignores + // it, and TS allows the wider-parameter signature to satisfy the + // narrower typedef. + bind(ctx?: import("./sql").CompileContext): BoundSql; emitColumnNamesWithAlias?: boolean; // default false; if true, emit column names in FROM clause (e.g. VALUES) }; @@ -522,8 +526,8 @@ export class QueryBuilder< }); } - bind(): BoundSql { - return this.finalize().bind(); + bind(ctx: import("./sql").CompileContext): BoundSql { + return this.finalize().bind(ctx); } children() { @@ -588,12 +592,12 @@ export class FinalizedQuery extends Sql { ].filter((x) => x instanceof Sql); } - bind(): BoundSql { + bind(ctx: import("./sql").CompileContext): BoundSql { const tableSql: Sql[] = []; for (const t of this.opts.tables) { const alias = t.alias; - const sourceSql = t.source.bind(); + const sourceSql = t.source.bind(ctx); const asClause = t.source.emitColumnNamesWithAlias ? sql`AS ${alias}(${sql.join(Object.keys(t.source.rowType()).map((col) => sql.ident(col)))})` : sql`AS ${alias}`; diff --git a/src/builder/sql.ts b/src/builder/sql.ts index 4d54d8f..ced5527 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -185,29 +185,71 @@ export class Column extends Sql { override children(): readonly Sql[] { return [this.tableAlias, this.name]; } } +// Dialect-tagged AST nodes throw at bind() when the compile ctx's +// dialect doesn't match. `dialect: undefined` means "unattributed" +// (server-authored raw templates, escape hatch) — the check skips. +const checkDialect = ( + node: string, + dialect: DialectName | undefined, + ctx: CompileContext, +): void => { + if (dialect && dialect !== ctx.database.dialect) { + throw new Error( + `${node} constructed for dialect '${dialect}' but compiled against '${ctx.database.dialect}'.`, + ); + } +}; + export class Func extends Sql { - constructor(readonly name: string, readonly args: readonly Sql[]) { super(); } - bind(): BoundSql { return sql`${sql.ident(this.name)}(${sql.join(this.args)})`; } + constructor( + readonly name: string, + readonly args: readonly Sql[], + readonly dialect?: DialectName, + ) { super(); } + bind(ctx: CompileContext): BoundSql { + checkDialect(`Func '${this.name}'`, this.dialect, ctx); + return sql`${new Ident(this.name, ctx.database)}(${sql.join(this.args)})`; + } override children(): readonly Sql[] { return this.args; } } export class Op extends Sql { - constructor(readonly op: Raw, readonly lhs: Sql, readonly rhs: Sql) { super(); } - bind(): BoundSql { return sql`(${this.lhs} ${this.op} ${this.rhs})`; } + constructor( + readonly op: Raw, + readonly lhs: Sql, + readonly rhs: Sql, + readonly dialect?: DialectName, + ) { super(); } + bind(ctx: CompileContext): BoundSql { + checkDialect(`Op '${this.op.value}'`, this.dialect, ctx); + return sql`(${this.lhs} ${this.op} ${this.rhs})`; + } override children(): readonly Sql[] { return [this.op, this.lhs, this.rhs]; } } export class UnaryOp extends Sql { - constructor(readonly op: Sql, readonly expr: Sql) { super(); } - bind(): BoundSql { return sql`(${this.op} ${this.expr})`; } + constructor( + readonly op: Sql, + readonly expr: Sql, + readonly dialect?: DialectName, + ) { super(); } + bind(ctx: CompileContext): BoundSql { + checkDialect(`UnaryOp`, this.dialect, ctx); + return sql`(${this.op} ${this.expr})`; + } override children(): readonly Sql[] { return [this.op, this.expr]; } } // `CAST(expr AS T)` — dialect-aware emission lives here so callers // (TypedParam, Any.cast(), etc.) don't templating CAST inline. export class Cast extends Sql { - constructor(readonly expr: Sql, readonly typname: Sql) { super(); } - bind(_ctx: CompileContext): BoundSql { + constructor( + readonly expr: Sql, + readonly typname: Sql, + readonly dialect?: DialectName, + ) { super(); } + bind(ctx: CompileContext): BoundSql { + checkDialect(`Cast`, this.dialect, ctx); // Both PG and SQLite accept CAST(expr AS typename); typename keyspace // differs per-dialect but that's the caller's concern (the typname // Sql node already carries the right dialect-specific identifier). @@ -218,9 +260,13 @@ export class Cast extends Sql { // `CAST($n AS T)` for a TS primitive flowing into a typed pg expression. export class TypedParam extends Sql { - constructor(readonly value: Param, readonly typname: Sql) { super(); } - bind(_ctx: CompileContext): BoundSql { - return new Cast(this.value, this.typname).bind(_ctx); + constructor( + readonly value: Param, + readonly typname: Sql, + readonly dialect?: DialectName, + ) { super(); } + bind(ctx: CompileContext): BoundSql { + return new Cast(this.value, this.typname, this.dialect).bind(ctx); } override children(): readonly Sql[] { return [this.value, this.typname]; } } diff --git a/src/types/any.ts b/src/types/any.ts index 329065c..cbf6936 100644 --- a/src/types/any.ts +++ b/src/types/any.ts @@ -83,7 +83,7 @@ export class SqlValue { : [N] extends [1] ? (InstanceType extends { [meta]: { __nonNullable: infer U } } ? U : InstanceType) : (InstanceType extends { [meta]: { __nullable: infer U } } ? U : InstanceType) { - return cls.from(new Cast(this.toSql(), cls.__typname)) as any; + return cls.from(new Cast(this.toSql(), cls.__typname, cls.dialect.name)) as any; } // COALESCE(this, rhs) — returns first non-null. Chainable. @@ -121,7 +121,7 @@ export class SqlValue { `otherwise extract the primitive value first.`, ); } - __raw = new TypedParam(new Param(v), this.__typname); + __raw = new TypedParam(new Param(v), this.__typname, this.dialect.name); } // Set [meta] at runtime — subclasses' `declare [meta]` narrows the type only Object.defineProperty(instance, meta, { diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 3b637e4..5ed7417 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -1,7 +1,7 @@ export type { Sql } from "../builder/sql"; export { sql } from "../builder/sql"; -import type { BoundSql, Raw } from "../builder/sql"; -import { Func, Op, Sql, sql } from "../builder/sql"; +import type { BoundSql, Raw, CompileContext } from "../builder/sql"; +import { Func, Ident, Op, Sql, sql } from "../builder/sql"; import * as types from "./index"; import type { Any } from "./index"; // Shared base for type-level utilities (NullOf, TsTypeOf, Aggregate). @@ -160,13 +160,17 @@ const argToSql = (arg: unknown): Sql => { return sql.param(arg); }; -// Expression node builders — construct real typed instances via constructor(Sql) +// Expression node builders — construct real typed instances via +// constructor(Sql). Dialect is drawn from the target type's class +// (Int4.dialect.name === "postgres", Integer.dialect.name === "sqlite", +// etc.) so the resulting Func/Op node carries the right dialect tag +// for the compile-time provenance check. export const funcCall = (name: string, args: unknown[], type: typeof Any) => { - return type.from(new Func(name, args.map(argToSql))); + return type.from(new Func(name, args.map(argToSql), type.dialect.name)); }; export const opCall = (op: Raw, args: [unknown, unknown], type: typeof Any) => { - return type.from(new Op(op, argToSql(args[0]), argToSql(args[1]))); + return type.from(new Op(op, argToSql(args[0]), argToSql(args[1]), type.dialect.name)); }; // Set-returning function result — a Fromable for use in FROM/JOIN. @@ -178,12 +182,16 @@ export class Srf }, A extends string> extend #columns: [string, typeof Any][]; #argsSql: Sql; + #dialect: string | undefined; constructor(name: A, args: unknown[], columns: [string, typeof Any][]) { super(); this.tsAlias = name; this.#name = name; this.#columns = columns; this.#argsSql = sql.join(args.map(argToSql)); + // Derive dialect from the first column's type (all columns share + // dialect for a Srf). + this.#dialect = columns[0]?.[1]?.dialect?.name; } // Shape-only: columns hold sql.unbound(). QB's reAlias replaces with @@ -195,8 +203,13 @@ export class Srf }, A extends string> extend } // FROM-clause source fragment (pre-AS). QB appends `AS `. - override bind(): BoundSql { - return sql`${sql.ident(this.#name)}(${this.#argsSql})`; + override bind(ctx: CompileContext): BoundSql { + if (this.#dialect && this.#dialect !== ctx.database.dialect) { + throw new Error( + `Srf '${this.#name}' constructed for dialect '${this.#dialect}' but compiled against '${ctx.database.dialect}'.`, + ); + } + return sql`${new Ident(this.#name, ctx.database)}(${this.#argsSql})`; } // Expose the args fragment so generic tree walkers (extractor, linting, From 87248a5c16781cd5936d21ffce4ff08a88eb298e Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 15:42:20 -0700 Subject: [PATCH 13/33] feat(sqlite): codegen emits funcCall helper (dialect-tagged Func nodes) - Widen `runtime.funcCall` / `runtime.opCall` `type` arg to `typeof SqlValue` so both PG's Any-typed classes and SQLite's SqliteValue-typed classes call sites typecheck. - SQLite codegen switches from raw `sql\`abs(\${this.toSql()})\`` templates to `funcCall("abs", [this], types.Integer)`. Every method now emits a Func node carrying `dialect: "sqlite"`, checked at compile. - `argToSql` widened to duck-typed check (`.toSql()` presence) so it handles both dialects uniformly. - Regenerated all four SQLite class files (integer, real, text, blob). 550 tests green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/types/runtime.ts | 14 +- src/types/sqlite/functions.json | 2 +- src/types/sqlite/generate.ts | 10 +- src/types/sqlite/generated/blob.ts | 153 ++++++++--------- src/types/sqlite/generated/integer.ts | 233 +++++++++++++------------- src/types/sqlite/generated/real.ts | 221 ++++++++++++------------ src/types/sqlite/generated/text.ts | 125 +++++++------- 7 files changed, 383 insertions(+), 375 deletions(-) diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 5ed7417..740797b 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -152,10 +152,11 @@ export const match = (args: unknown[], cases: MatchCase[]): [typeof Any, ...unkn throw new Error(`No matching overload for args: [${args.map((a) => typeof a).join(", ")}]`); }; -// Extract the Sql node from an arg. After match(), args are Any instances. +// Extract the Sql node from an arg. After match(), args are SqlValue instances. const argToSql = (arg: unknown): Sql => { - if (arg instanceof types.Any) { - return arg.toSql(); + // SqlValue is the shared base of PG Any + SQLite SqliteValue. + if (arg && typeof arg === "object" && typeof (arg as { toSql?: unknown }).toSql === "function") { + return (arg as { toSql: () => Sql }).toSql(); } return sql.param(arg); }; @@ -165,11 +166,14 @@ const argToSql = (arg: unknown): Sql => { // (Int4.dialect.name === "postgres", Integer.dialect.name === "sqlite", // etc.) so the resulting Func/Op node carries the right dialect tag // for the compile-time provenance check. -export const funcCall = (name: string, args: unknown[], type: typeof Any) => { +// +// `type` is widened to `typeof SqlValue` (below all dialects) so both +// PG-codegen and SQLite-codegen call sites typecheck. +export const funcCall = (name: string, args: unknown[], type: typeof SqlValue) => { return type.from(new Func(name, args.map(argToSql), type.dialect.name)); }; -export const opCall = (op: Raw, args: [unknown, unknown], type: typeof Any) => { +export const opCall = (op: Raw, args: [unknown, unknown], type: typeof SqlValue) => { return type.from(new Op(op, argToSql(args[0]), argToSql(args[1]), type.dialect.name)); }; diff --git a/src/types/sqlite/functions.json b/src/types/sqlite/functions.json index bfc2b11..68977e1 100644 --- a/src/types/sqlite/functions.json +++ b/src/types/sqlite/functions.json @@ -1,6 +1,6 @@ { "sqlite_version": "3.53.2", - "generated_at": "2026-07-01T19:36:51.469Z", + "generated_at": "2026-07-01T22:41:31.905Z", "function_count": 197, "functions": { "->": [ diff --git a/src/types/sqlite/generate.ts b/src/types/sqlite/generate.ts index 8d286d7..01a22d3 100644 --- a/src/types/sqlite/generate.ts +++ b/src/types/sqlite/generate.ts @@ -299,6 +299,7 @@ const emitClassFile = ( lines.push('import { SqliteValue } from "../base";'); lines.push('import { sql, type Sql } from "../../../builder/sql";'); lines.push('import { meta } from "../../runtime";'); + lines.push('import { funcCall } from "../../runtime";'); lines.push('import type { NullOf, StrictNull } from "../../runtime";'); lines.push('import * as types from "../index";'); lines.push(""); @@ -325,12 +326,11 @@ const emitClassFile = ( // Result nullability: null propagates from any arg (strict). const nullTerms = ["N", ...m.argTypes.map((_, i) => `NullOf`)]; const nullExpr = nullTerms.length === 1 ? nullTerms[0]! : `StrictNull<${nullTerms.join(" | ")}>`; - const argForwarding = m.argTypes.map((_, i) => `\${arg${i}.toSql()}`).join(", "); - const call = m.argTypes.length > 0 - ? `${m.sqlName}(\${this.toSql()}, ${argForwarding})` - : `${m.sqlName}(\${this.toSql()})`; + // Route through runtime.funcCall so the Func node carries the target + // type's dialect tag — enforced at compile via CompileContext. + const argList = ["this", ...m.argTypes.map((_, i) => `arg${i}`)].join(", "); lines.push(` ${m.tsName}(${params}): ${retClass}<${nullExpr}> {`); - lines.push(` return ${retClass}.from(sql\`${call}\`) as any;`); + lines.push(` return funcCall("${m.sqlName}", [${argList}], ${retClass}) as ${retClass}<${nullExpr}>;`); lines.push(" }"); } lines.push("}"); diff --git a/src/types/sqlite/generated/blob.ts b/src/types/sqlite/generated/blob.ts index a8de393..ee35c27 100644 --- a/src/types/sqlite/generated/blob.ts +++ b/src/types/sqlite/generated/blob.ts @@ -5,6 +5,7 @@ import { SqliteValue } from "../base"; import { sql, type Sql } from "../../../builder/sql"; import { meta } from "../../runtime"; +import { funcCall } from "../../runtime"; import type { NullOf, StrictNull } from "../../runtime"; import * as types from "../index"; @@ -22,231 +23,231 @@ export class Blob extends SqliteValue { static override __typnameText = "blob"; abs(): types.Real { - return types.Real.from(sql`abs(${this.toSql()})`) as any; + return funcCall("abs", [this], types.Real) as types.Real; } avg(): types.Real { - return types.Real.from(sql`avg(${this.toSql()})`) as any; + return funcCall("avg", [this], types.Real) as types.Real; } char(): types.Text { - return types.Text.from(sql`char(${this.toSql()})`) as any; + return funcCall("char", [this], types.Text) as types.Text; } concat(arg0: types.Blob): types.Text>> { - return types.Text.from(sql`concat(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("concat", [this, arg0], types.Text) as types.Text>>; } count(): types.Integer { - return types.Integer.from(sql`count(${this.toSql()})`) as any; + return funcCall("count", [this], types.Integer) as types.Integer; } firstValue(): types.Blob { - return types.Blob.from(sql`first_value(${this.toSql()})`) as any; + return funcCall("first_value", [this], types.Blob) as types.Blob; } format(): types.Text { - return types.Text.from(sql`format(${this.toSql()})`) as any; + return funcCall("format", [this], types.Text) as types.Text; } fts5Insttoken(): types.Blob { - return types.Blob.from(sql`fts5_insttoken(${this.toSql()})`) as any; + return funcCall("fts5_insttoken", [this], types.Blob) as types.Blob; } fts5Locale(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`fts5_locale(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("fts5_locale", [this, arg0], types.Blob) as types.Blob>>; } glob(arg0: types.Blob): types.Integer>> { - return types.Integer.from(sql`glob(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("glob", [this, arg0], types.Integer) as types.Integer>>; } groupConcat(): types.Text { - return types.Text.from(sql`group_concat(${this.toSql()})`) as any; + return funcCall("group_concat", [this], types.Text) as types.Text; } hex(): types.Text { - return types.Text.from(sql`hex(${this.toSql()})`) as any; + return funcCall("hex", [this], types.Text) as types.Text; } ifnull(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`ifnull(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("ifnull", [this, arg0], types.Blob) as types.Blob>>; } instr(arg0: types.Blob): types.Integer>> { - return types.Integer.from(sql`instr(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("instr", [this, arg0], types.Integer) as types.Integer>>; } json(): types.Text { - return types.Text.from(sql`json(${this.toSql()})`) as any; + return funcCall("json", [this], types.Text) as types.Text; } jsonArray(): types.Text { - return types.Text.from(sql`json_array(${this.toSql()})`) as any; + return funcCall("json_array", [this], types.Text) as types.Text; } jsonArrayInsert(): types.Text { - return types.Text.from(sql`json_array_insert(${this.toSql()})`) as any; + return funcCall("json_array_insert", [this], types.Text) as types.Text; } jsonArrayLength(): types.Integer { - return types.Integer.from(sql`json_array_length(${this.toSql()})`) as any; + return funcCall("json_array_length", [this], types.Integer) as types.Integer; } jsonb(): types.Blob { - return types.Blob.from(sql`jsonb(${this.toSql()})`) as any; + return funcCall("jsonb", [this], types.Blob) as types.Blob; } jsonbArray(): types.Blob { - return types.Blob.from(sql`jsonb_array(${this.toSql()})`) as any; + return funcCall("jsonb_array", [this], types.Blob) as types.Blob; } jsonbArrayInsert(): types.Blob { - return types.Blob.from(sql`jsonb_array_insert(${this.toSql()})`) as any; + return funcCall("jsonb_array_insert", [this], types.Blob) as types.Blob; } jsonbGroupArray(): types.Blob { - return types.Blob.from(sql`jsonb_group_array(${this.toSql()})`) as any; + return funcCall("jsonb_group_array", [this], types.Blob) as types.Blob; } jsonbGroupObject(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`jsonb_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("jsonb_group_object", [this, arg0], types.Blob) as types.Blob>>; } jsonbInsert(): types.Blob { - return types.Blob.from(sql`jsonb_insert(${this.toSql()})`) as any; + return funcCall("jsonb_insert", [this], types.Blob) as types.Blob; } jsonbPatch(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`jsonb_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("jsonb_patch", [this, arg0], types.Blob) as types.Blob>>; } jsonbRemove(): types.Blob { - return types.Blob.from(sql`jsonb_remove(${this.toSql()})`) as any; + return funcCall("jsonb_remove", [this], types.Blob) as types.Blob; } jsonbReplace(): types.Blob { - return types.Blob.from(sql`jsonb_replace(${this.toSql()})`) as any; + return funcCall("jsonb_replace", [this], types.Blob) as types.Blob; } jsonbSet(): types.Blob { - return types.Blob.from(sql`jsonb_set(${this.toSql()})`) as any; + return funcCall("jsonb_set", [this], types.Blob) as types.Blob; } jsonErrorPosition(): types.Integer { - return types.Integer.from(sql`json_error_position(${this.toSql()})`) as any; + return funcCall("json_error_position", [this], types.Integer) as types.Integer; } jsonGroupArray(): types.Text { - return types.Text.from(sql`json_group_array(${this.toSql()})`) as any; + return funcCall("json_group_array", [this], types.Text) as types.Text; } jsonGroupObject(arg0: types.Blob): types.Text>> { - return types.Text.from(sql`json_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("json_group_object", [this, arg0], types.Text) as types.Text>>; } jsonInsert(): types.Text { - return types.Text.from(sql`json_insert(${this.toSql()})`) as any; + return funcCall("json_insert", [this], types.Text) as types.Text; } jsonPatch(arg0: types.Blob): types.Text>> { - return types.Text.from(sql`json_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("json_patch", [this, arg0], types.Text) as types.Text>>; } jsonPretty(): types.Text { - return types.Text.from(sql`json_pretty(${this.toSql()})`) as any; + return funcCall("json_pretty", [this], types.Text) as types.Text; } jsonQuote(): types.Text { - return types.Text.from(sql`json_quote(${this.toSql()})`) as any; + return funcCall("json_quote", [this], types.Text) as types.Text; } jsonRemove(): types.Text { - return types.Text.from(sql`json_remove(${this.toSql()})`) as any; + return funcCall("json_remove", [this], types.Text) as types.Text; } jsonReplace(): types.Text { - return types.Text.from(sql`json_replace(${this.toSql()})`) as any; + return funcCall("json_replace", [this], types.Text) as types.Text; } jsonSet(): types.Text { - return types.Text.from(sql`json_set(${this.toSql()})`) as any; + return funcCall("json_set", [this], types.Text) as types.Text; } jsonType(): types.Text { - return types.Text.from(sql`json_type(${this.toSql()})`) as any; + return funcCall("json_type", [this], types.Text) as types.Text; } jsonValid(): types.Integer { - return types.Integer.from(sql`json_valid(${this.toSql()})`) as any; + return funcCall("json_valid", [this], types.Integer) as types.Integer; } lag(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`lag(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("lag", [this, arg0], types.Blob) as types.Blob>>; } lastValue(): types.Blob { - return types.Blob.from(sql`last_value(${this.toSql()})`) as any; + return funcCall("last_value", [this], types.Blob) as types.Blob; } lead(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`lead(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("lead", [this, arg0], types.Blob) as types.Blob>>; } length(): types.Integer { - return types.Integer.from(sql`length(${this.toSql()})`) as any; + return funcCall("length", [this], types.Integer) as types.Integer; } like(arg0: types.Blob): types.Integer>> { - return types.Integer.from(sql`like(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("like", [this, arg0], types.Integer) as types.Integer>>; } likely(): types.Blob { - return types.Blob.from(sql`likely(${this.toSql()})`) as any; + return funcCall("likely", [this], types.Blob) as types.Blob; } lower(): types.Text { - return types.Text.from(sql`lower(${this.toSql()})`) as any; + return funcCall("lower", [this], types.Text) as types.Text; } ltrim(): types.Text { - return types.Text.from(sql`ltrim(${this.toSql()})`) as any; + return funcCall("ltrim", [this], types.Text) as types.Text; } max(): types.Blob { - return types.Blob.from(sql`max(${this.toSql()})`) as any; + return funcCall("max", [this], types.Blob) as types.Blob; } min(): types.Blob { - return types.Blob.from(sql`min(${this.toSql()})`) as any; + return funcCall("min", [this], types.Blob) as types.Blob; } octetLength(): types.Integer { - return types.Integer.from(sql`octet_length(${this.toSql()})`) as any; + return funcCall("octet_length", [this], types.Integer) as types.Integer; } printf(): types.Text { - return types.Text.from(sql`printf(${this.toSql()})`) as any; + return funcCall("printf", [this], types.Text) as types.Text; } quote(): types.Text { - return types.Text.from(sql`quote(${this.toSql()})`) as any; + return funcCall("quote", [this], types.Text) as types.Text; } randomblob(): types.Blob { - return types.Blob.from(sql`randomblob(${this.toSql()})`) as any; + return funcCall("randomblob", [this], types.Blob) as types.Blob; } replace(arg0: types.Blob, arg1: types.Blob): types.Text | NullOf>> { - return types.Text.from(sql`replace(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + return funcCall("replace", [this, arg0, arg1], types.Text) as types.Text | NullOf>>; } round(): types.Real { - return types.Real.from(sql`round(${this.toSql()})`) as any; + return funcCall("round", [this], types.Real) as types.Real; } rtrim(): types.Text { - return types.Text.from(sql`rtrim(${this.toSql()})`) as any; + return funcCall("rtrim", [this], types.Text) as types.Text; } soundex(): types.Text { - return types.Text.from(sql`soundex(${this.toSql()})`) as any; + return funcCall("soundex", [this], types.Text) as types.Text; } sqliteCompileoptionGet(): types.Text { - return types.Text.from(sql`sqlite_compileoption_get(${this.toSql()})`) as any; + return funcCall("sqlite_compileoption_get", [this], types.Text) as types.Text; } sqliteCompileoptionUsed(): types.Integer { - return types.Integer.from(sql`sqlite_compileoption_used(${this.toSql()})`) as any; + return funcCall("sqlite_compileoption_used", [this], types.Integer) as types.Integer; } strftime(): types.Text { - return types.Text.from(sql`strftime(${this.toSql()})`) as any; + return funcCall("strftime", [this], types.Text) as types.Text; } stringAgg(arg0: types.Blob): types.Text>> { - return types.Text.from(sql`string_agg(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("string_agg", [this, arg0], types.Text) as types.Text>>; } substr(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`substr(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("substr", [this, arg0], types.Blob) as types.Blob>>; } substring(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`substring(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("substring", [this, arg0], types.Blob) as types.Blob>>; } subtype(): types.Integer { - return types.Integer.from(sql`subtype(${this.toSql()})`) as any; + return funcCall("subtype", [this], types.Integer) as types.Integer; } sum(): types.Real { - return types.Real.from(sql`sum(${this.toSql()})`) as any; + return funcCall("sum", [this], types.Real) as types.Real; } total(): types.Real { - return types.Real.from(sql`total(${this.toSql()})`) as any; + return funcCall("total", [this], types.Real) as types.Real; } trim(): types.Text { - return types.Text.from(sql`trim(${this.toSql()})`) as any; + return funcCall("trim", [this], types.Text) as types.Text; } typeof(): types.Text { - return types.Text.from(sql`typeof(${this.toSql()})`) as any; + return funcCall("typeof", [this], types.Text) as types.Text; } unhex(arg0: types.Blob): types.Blob>> { - return types.Blob.from(sql`unhex(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("unhex", [this, arg0], types.Blob) as types.Blob>>; } unicode(): types.Integer { - return types.Integer.from(sql`unicode(${this.toSql()})`) as any; + return funcCall("unicode", [this], types.Integer) as types.Integer; } unistr(): types.Text { - return types.Text.from(sql`unistr(${this.toSql()})`) as any; + return funcCall("unistr", [this], types.Text) as types.Text; } unistrQuote(): types.Text { - return types.Text.from(sql`unistr_quote(${this.toSql()})`) as any; + return funcCall("unistr_quote", [this], types.Text) as types.Text; } unlikely(): types.Blob { - return types.Blob.from(sql`unlikely(${this.toSql()})`) as any; + return funcCall("unlikely", [this], types.Blob) as types.Blob; } upper(): types.Text { - return types.Text.from(sql`upper(${this.toSql()})`) as any; + return funcCall("upper", [this], types.Text) as types.Text; } zeroblob(): types.Blob { - return types.Blob.from(sql`zeroblob(${this.toSql()})`) as any; + return funcCall("zeroblob", [this], types.Blob) as types.Blob; } } diff --git a/src/types/sqlite/generated/integer.ts b/src/types/sqlite/generated/integer.ts index 30360fe..4fac99b 100644 --- a/src/types/sqlite/generated/integer.ts +++ b/src/types/sqlite/generated/integer.ts @@ -5,6 +5,7 @@ import { SqliteValue } from "../base"; import { sql, type Sql } from "../../../builder/sql"; import { meta } from "../../runtime"; +import { funcCall } from "../../runtime"; import type { NullOf, StrictNull } from "../../runtime"; import * as types from "../index"; @@ -22,351 +23,351 @@ export class Integer extends SqliteValue { static override __typnameText = "integer"; abs(): types.Integer { - return types.Integer.from(sql`abs(${this.toSql()})`) as any; + return funcCall("abs", [this], types.Integer) as types.Integer; } acos(): types.Real { - return types.Real.from(sql`acos(${this.toSql()})`) as any; + return funcCall("acos", [this], types.Real) as types.Real; } acosh(): types.Real { - return types.Real.from(sql`acosh(${this.toSql()})`) as any; + return funcCall("acosh", [this], types.Real) as types.Real; } asin(): types.Real { - return types.Real.from(sql`asin(${this.toSql()})`) as any; + return funcCall("asin", [this], types.Real) as types.Real; } asinh(): types.Real { - return types.Real.from(sql`asinh(${this.toSql()})`) as any; + return funcCall("asinh", [this], types.Real) as types.Real; } atan(): types.Real { - return types.Real.from(sql`atan(${this.toSql()})`) as any; + return funcCall("atan", [this], types.Real) as types.Real; } atan2(arg0: types.Integer): types.Real>> { - return types.Real.from(sql`atan2(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("atan2", [this, arg0], types.Real) as types.Real>>; } atanh(): types.Real { - return types.Real.from(sql`atanh(${this.toSql()})`) as any; + return funcCall("atanh", [this], types.Real) as types.Real; } avg(): types.Real { - return types.Real.from(sql`avg(${this.toSql()})`) as any; + return funcCall("avg", [this], types.Real) as types.Real; } ceil(): types.Integer { - return types.Integer.from(sql`ceil(${this.toSql()})`) as any; + return funcCall("ceil", [this], types.Integer) as types.Integer; } ceiling(): types.Integer { - return types.Integer.from(sql`ceiling(${this.toSql()})`) as any; + return funcCall("ceiling", [this], types.Integer) as types.Integer; } char(): types.Text { - return types.Text.from(sql`char(${this.toSql()})`) as any; + return funcCall("char", [this], types.Text) as types.Text; } concat(arg0: types.Integer): types.Text>> { - return types.Text.from(sql`concat(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("concat", [this, arg0], types.Text) as types.Text>>; } cos(): types.Real { - return types.Real.from(sql`cos(${this.toSql()})`) as any; + return funcCall("cos", [this], types.Real) as types.Real; } cosh(): types.Real { - return types.Real.from(sql`cosh(${this.toSql()})`) as any; + return funcCall("cosh", [this], types.Real) as types.Real; } count(): types.Integer { - return types.Integer.from(sql`count(${this.toSql()})`) as any; + return funcCall("count", [this], types.Integer) as types.Integer; } date(): types.Text { - return types.Text.from(sql`date(${this.toSql()})`) as any; + return funcCall("date", [this], types.Text) as types.Text; } datetime(): types.Text { - return types.Text.from(sql`datetime(${this.toSql()})`) as any; + return funcCall("datetime", [this], types.Text) as types.Text; } degrees(): types.Real { - return types.Real.from(sql`degrees(${this.toSql()})`) as any; + return funcCall("degrees", [this], types.Real) as types.Real; } exp(): types.Real { - return types.Real.from(sql`exp(${this.toSql()})`) as any; + return funcCall("exp", [this], types.Real) as types.Real; } firstValue(): types.Integer { - return types.Integer.from(sql`first_value(${this.toSql()})`) as any; + return funcCall("first_value", [this], types.Integer) as types.Integer; } floor(): types.Integer { - return types.Integer.from(sql`floor(${this.toSql()})`) as any; + return funcCall("floor", [this], types.Integer) as types.Integer; } format(): types.Text { - return types.Text.from(sql`format(${this.toSql()})`) as any; + return funcCall("format", [this], types.Text) as types.Text; } fts5Insttoken(): types.Integer { - return types.Integer.from(sql`fts5_insttoken(${this.toSql()})`) as any; + return funcCall("fts5_insttoken", [this], types.Integer) as types.Integer; } fts5Locale(arg0: types.Integer): types.Blob>> { - return types.Blob.from(sql`fts5_locale(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("fts5_locale", [this, arg0], types.Blob) as types.Blob>>; } glob(arg0: types.Integer): types.Integer>> { - return types.Integer.from(sql`glob(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("glob", [this, arg0], types.Integer) as types.Integer>>; } groupConcat(): types.Text { - return types.Text.from(sql`group_concat(${this.toSql()})`) as any; + return funcCall("group_concat", [this], types.Text) as types.Text; } hex(): types.Text { - return types.Text.from(sql`hex(${this.toSql()})`) as any; + return funcCall("hex", [this], types.Text) as types.Text; } ifnull(arg0: types.Integer): types.Integer>> { - return types.Integer.from(sql`ifnull(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("ifnull", [this, arg0], types.Integer) as types.Integer>>; } instr(arg0: types.Integer): types.Integer>> { - return types.Integer.from(sql`instr(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("instr", [this, arg0], types.Integer) as types.Integer>>; } json(): types.Text { - return types.Text.from(sql`json(${this.toSql()})`) as any; + return funcCall("json", [this], types.Text) as types.Text; } jsonArray(): types.Text { - return types.Text.from(sql`json_array(${this.toSql()})`) as any; + return funcCall("json_array", [this], types.Text) as types.Text; } jsonArrayInsert(): types.Text { - return types.Text.from(sql`json_array_insert(${this.toSql()})`) as any; + return funcCall("json_array_insert", [this], types.Text) as types.Text; } jsonArrayLength(): types.Integer { - return types.Integer.from(sql`json_array_length(${this.toSql()})`) as any; + return funcCall("json_array_length", [this], types.Integer) as types.Integer; } jsonb(): types.Blob { - return types.Blob.from(sql`jsonb(${this.toSql()})`) as any; + return funcCall("jsonb", [this], types.Blob) as types.Blob; } jsonbArray(): types.Blob { - return types.Blob.from(sql`jsonb_array(${this.toSql()})`) as any; + return funcCall("jsonb_array", [this], types.Blob) as types.Blob; } jsonbArrayInsert(): types.Blob { - return types.Blob.from(sql`jsonb_array_insert(${this.toSql()})`) as any; + return funcCall("jsonb_array_insert", [this], types.Blob) as types.Blob; } jsonbGroupArray(): types.Blob { - return types.Blob.from(sql`jsonb_group_array(${this.toSql()})`) as any; + return funcCall("jsonb_group_array", [this], types.Blob) as types.Blob; } jsonbGroupObject(arg0: types.Integer): types.Blob>> { - return types.Blob.from(sql`jsonb_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("jsonb_group_object", [this, arg0], types.Blob) as types.Blob>>; } jsonbInsert(): types.Blob { - return types.Blob.from(sql`jsonb_insert(${this.toSql()})`) as any; + return funcCall("jsonb_insert", [this], types.Blob) as types.Blob; } jsonbPatch(arg0: types.Integer): types.Blob>> { - return types.Blob.from(sql`jsonb_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("jsonb_patch", [this, arg0], types.Blob) as types.Blob>>; } jsonbRemove(): types.Blob { - return types.Blob.from(sql`jsonb_remove(${this.toSql()})`) as any; + return funcCall("jsonb_remove", [this], types.Blob) as types.Blob; } jsonbReplace(): types.Blob { - return types.Blob.from(sql`jsonb_replace(${this.toSql()})`) as any; + return funcCall("jsonb_replace", [this], types.Blob) as types.Blob; } jsonbSet(): types.Blob { - return types.Blob.from(sql`jsonb_set(${this.toSql()})`) as any; + return funcCall("jsonb_set", [this], types.Blob) as types.Blob; } jsonErrorPosition(): types.Integer { - return types.Integer.from(sql`json_error_position(${this.toSql()})`) as any; + return funcCall("json_error_position", [this], types.Integer) as types.Integer; } jsonGroupArray(): types.Text { - return types.Text.from(sql`json_group_array(${this.toSql()})`) as any; + return funcCall("json_group_array", [this], types.Text) as types.Text; } jsonGroupObject(arg0: types.Integer): types.Text>> { - return types.Text.from(sql`json_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("json_group_object", [this, arg0], types.Text) as types.Text>>; } jsonInsert(): types.Text { - return types.Text.from(sql`json_insert(${this.toSql()})`) as any; + return funcCall("json_insert", [this], types.Text) as types.Text; } jsonPatch(arg0: types.Integer): types.Text>> { - return types.Text.from(sql`json_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("json_patch", [this, arg0], types.Text) as types.Text>>; } jsonPretty(): types.Text { - return types.Text.from(sql`json_pretty(${this.toSql()})`) as any; + return funcCall("json_pretty", [this], types.Text) as types.Text; } jsonQuote(): types.Text { - return types.Text.from(sql`json_quote(${this.toSql()})`) as any; + return funcCall("json_quote", [this], types.Text) as types.Text; } jsonRemove(): types.Text { - return types.Text.from(sql`json_remove(${this.toSql()})`) as any; + return funcCall("json_remove", [this], types.Text) as types.Text; } jsonReplace(): types.Text { - return types.Text.from(sql`json_replace(${this.toSql()})`) as any; + return funcCall("json_replace", [this], types.Text) as types.Text; } jsonSet(): types.Text { - return types.Text.from(sql`json_set(${this.toSql()})`) as any; + return funcCall("json_set", [this], types.Text) as types.Text; } jsonType(): types.Text { - return types.Text.from(sql`json_type(${this.toSql()})`) as any; + return funcCall("json_type", [this], types.Text) as types.Text; } jsonValid(): types.Integer { - return types.Integer.from(sql`json_valid(${this.toSql()})`) as any; + return funcCall("json_valid", [this], types.Integer) as types.Integer; } julianday(): types.Real { - return types.Real.from(sql`julianday(${this.toSql()})`) as any; + return funcCall("julianday", [this], types.Real) as types.Real; } lag(arg0: types.Integer, arg1: types.Integer): types.Integer | NullOf>> { - return types.Integer.from(sql`lag(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + return funcCall("lag", [this, arg0, arg1], types.Integer) as types.Integer | NullOf>>; } lastValue(): types.Integer { - return types.Integer.from(sql`last_value(${this.toSql()})`) as any; + return funcCall("last_value", [this], types.Integer) as types.Integer; } lead(arg0: types.Integer, arg1: types.Integer): types.Integer | NullOf>> { - return types.Integer.from(sql`lead(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + return funcCall("lead", [this, arg0, arg1], types.Integer) as types.Integer | NullOf>>; } length(): types.Integer { - return types.Integer.from(sql`length(${this.toSql()})`) as any; + return funcCall("length", [this], types.Integer) as types.Integer; } like(arg0: types.Integer): types.Integer>> { - return types.Integer.from(sql`like(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("like", [this, arg0], types.Integer) as types.Integer>>; } likely(): types.Integer { - return types.Integer.from(sql`likely(${this.toSql()})`) as any; + return funcCall("likely", [this], types.Integer) as types.Integer; } ln(): types.Real { - return types.Real.from(sql`ln(${this.toSql()})`) as any; + return funcCall("ln", [this], types.Real) as types.Real; } log(): types.Real { - return types.Real.from(sql`log(${this.toSql()})`) as any; + return funcCall("log", [this], types.Real) as types.Real; } log10(): types.Real { - return types.Real.from(sql`log10(${this.toSql()})`) as any; + return funcCall("log10", [this], types.Real) as types.Real; } log2(): types.Real { - return types.Real.from(sql`log2(${this.toSql()})`) as any; + return funcCall("log2", [this], types.Real) as types.Real; } lower(): types.Text { - return types.Text.from(sql`lower(${this.toSql()})`) as any; + return funcCall("lower", [this], types.Text) as types.Text; } ltrim(): types.Text { - return types.Text.from(sql`ltrim(${this.toSql()})`) as any; + return funcCall("ltrim", [this], types.Text) as types.Text; } max(): types.Integer { - return types.Integer.from(sql`max(${this.toSql()})`) as any; + return funcCall("max", [this], types.Integer) as types.Integer; } median(): types.Real { - return types.Real.from(sql`median(${this.toSql()})`) as any; + return funcCall("median", [this], types.Real) as types.Real; } min(): types.Integer { - return types.Integer.from(sql`min(${this.toSql()})`) as any; + return funcCall("min", [this], types.Integer) as types.Integer; } mod(arg0: types.Integer): types.Real>> { - return types.Real.from(sql`mod(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("mod", [this, arg0], types.Real) as types.Real>>; } nthValue(arg0: types.Integer): types.Integer>> { - return types.Integer.from(sql`nth_value(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("nth_value", [this, arg0], types.Integer) as types.Integer>>; } ntile(): types.Integer { - return types.Integer.from(sql`ntile(${this.toSql()})`) as any; + return funcCall("ntile", [this], types.Integer) as types.Integer; } octetLength(): types.Integer { - return types.Integer.from(sql`octet_length(${this.toSql()})`) as any; + return funcCall("octet_length", [this], types.Integer) as types.Integer; } percentile(arg0: types.Integer): types.Real>> { - return types.Real.from(sql`percentile(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("percentile", [this, arg0], types.Real) as types.Real>>; } percentileCont(arg0: types.Integer): types.Real>> { - return types.Real.from(sql`percentile_cont(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("percentile_cont", [this, arg0], types.Real) as types.Real>>; } percentileDisc(arg0: types.Integer): types.Real>> { - return types.Real.from(sql`percentile_disc(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("percentile_disc", [this, arg0], types.Real) as types.Real>>; } pow(arg0: types.Integer): types.Real>> { - return types.Real.from(sql`pow(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("pow", [this, arg0], types.Real) as types.Real>>; } power(arg0: types.Integer): types.Real>> { - return types.Real.from(sql`power(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("power", [this, arg0], types.Real) as types.Real>>; } printf(): types.Text { - return types.Text.from(sql`printf(${this.toSql()})`) as any; + return funcCall("printf", [this], types.Text) as types.Text; } quote(): types.Text { - return types.Text.from(sql`quote(${this.toSql()})`) as any; + return funcCall("quote", [this], types.Text) as types.Text; } radians(): types.Real { - return types.Real.from(sql`radians(${this.toSql()})`) as any; + return funcCall("radians", [this], types.Real) as types.Real; } randomblob(): types.Blob { - return types.Blob.from(sql`randomblob(${this.toSql()})`) as any; + return funcCall("randomblob", [this], types.Blob) as types.Blob; } replace(arg0: types.Integer, arg1: types.Integer): types.Text | NullOf>> { - return types.Text.from(sql`replace(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + return funcCall("replace", [this, arg0, arg1], types.Text) as types.Text | NullOf>>; } round(): types.Real { - return types.Real.from(sql`round(${this.toSql()})`) as any; + return funcCall("round", [this], types.Real) as types.Real; } rtrim(): types.Text { - return types.Text.from(sql`rtrim(${this.toSql()})`) as any; + return funcCall("rtrim", [this], types.Text) as types.Text; } sign(): types.Integer { - return types.Integer.from(sql`sign(${this.toSql()})`) as any; + return funcCall("sign", [this], types.Integer) as types.Integer; } sin(): types.Real { - return types.Real.from(sql`sin(${this.toSql()})`) as any; + return funcCall("sin", [this], types.Real) as types.Real; } sinh(): types.Real { - return types.Real.from(sql`sinh(${this.toSql()})`) as any; + return funcCall("sinh", [this], types.Real) as types.Real; } soundex(): types.Text { - return types.Text.from(sql`soundex(${this.toSql()})`) as any; + return funcCall("soundex", [this], types.Text) as types.Text; } sqliteCompileoptionGet(): types.Text { - return types.Text.from(sql`sqlite_compileoption_get(${this.toSql()})`) as any; + return funcCall("sqlite_compileoption_get", [this], types.Text) as types.Text; } sqliteCompileoptionUsed(): types.Integer { - return types.Integer.from(sql`sqlite_compileoption_used(${this.toSql()})`) as any; + return funcCall("sqlite_compileoption_used", [this], types.Integer) as types.Integer; } sqrt(): types.Real { - return types.Real.from(sql`sqrt(${this.toSql()})`) as any; + return funcCall("sqrt", [this], types.Real) as types.Real; } strftime(): types.Text { - return types.Text.from(sql`strftime(${this.toSql()})`) as any; + return funcCall("strftime", [this], types.Text) as types.Text; } stringAgg(arg0: types.Integer): types.Text>> { - return types.Text.from(sql`string_agg(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("string_agg", [this, arg0], types.Text) as types.Text>>; } substr(arg0: types.Integer): types.Text>> { - return types.Text.from(sql`substr(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("substr", [this, arg0], types.Text) as types.Text>>; } substring(arg0: types.Integer): types.Text>> { - return types.Text.from(sql`substring(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("substring", [this, arg0], types.Text) as types.Text>>; } subtype(): types.Integer { - return types.Integer.from(sql`subtype(${this.toSql()})`) as any; + return funcCall("subtype", [this], types.Integer) as types.Integer; } sum(): types.Integer { - return types.Integer.from(sql`sum(${this.toSql()})`) as any; + return funcCall("sum", [this], types.Integer) as types.Integer; } tan(): types.Real { - return types.Real.from(sql`tan(${this.toSql()})`) as any; + return funcCall("tan", [this], types.Real) as types.Real; } tanh(): types.Real { - return types.Real.from(sql`tanh(${this.toSql()})`) as any; + return funcCall("tanh", [this], types.Real) as types.Real; } time(): types.Text { - return types.Text.from(sql`time(${this.toSql()})`) as any; + return funcCall("time", [this], types.Text) as types.Text; } timediff(arg0: types.Integer): types.Text>> { - return types.Text.from(sql`timediff(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("timediff", [this, arg0], types.Text) as types.Text>>; } total(): types.Real { - return types.Real.from(sql`total(${this.toSql()})`) as any; + return funcCall("total", [this], types.Real) as types.Real; } trim(): types.Text { - return types.Text.from(sql`trim(${this.toSql()})`) as any; + return funcCall("trim", [this], types.Text) as types.Text; } trunc(): types.Integer { - return types.Integer.from(sql`trunc(${this.toSql()})`) as any; + return funcCall("trunc", [this], types.Integer) as types.Integer; } typeof(): types.Text { - return types.Text.from(sql`typeof(${this.toSql()})`) as any; + return funcCall("typeof", [this], types.Text) as types.Text; } unicode(): types.Integer { - return types.Integer.from(sql`unicode(${this.toSql()})`) as any; + return funcCall("unicode", [this], types.Integer) as types.Integer; } unistr(): types.Text { - return types.Text.from(sql`unistr(${this.toSql()})`) as any; + return funcCall("unistr", [this], types.Text) as types.Text; } unistrQuote(): types.Text { - return types.Text.from(sql`unistr_quote(${this.toSql()})`) as any; + return funcCall("unistr_quote", [this], types.Text) as types.Text; } unixepoch(): types.Integer { - return types.Integer.from(sql`unixepoch(${this.toSql()})`) as any; + return funcCall("unixepoch", [this], types.Integer) as types.Integer; } unlikely(): types.Integer { - return types.Integer.from(sql`unlikely(${this.toSql()})`) as any; + return funcCall("unlikely", [this], types.Integer) as types.Integer; } upper(): types.Text { - return types.Text.from(sql`upper(${this.toSql()})`) as any; + return funcCall("upper", [this], types.Text) as types.Text; } zeroblob(): types.Blob { - return types.Blob.from(sql`zeroblob(${this.toSql()})`) as any; + return funcCall("zeroblob", [this], types.Blob) as types.Blob; } } diff --git a/src/types/sqlite/generated/real.ts b/src/types/sqlite/generated/real.ts index f7d0b9f..fd24c76 100644 --- a/src/types/sqlite/generated/real.ts +++ b/src/types/sqlite/generated/real.ts @@ -5,6 +5,7 @@ import { SqliteValue } from "../base"; import { sql, type Sql } from "../../../builder/sql"; import { meta } from "../../runtime"; +import { funcCall } from "../../runtime"; import type { NullOf, StrictNull } from "../../runtime"; import * as types from "../index"; @@ -22,333 +23,333 @@ export class Real extends SqliteValue { static override __typnameText = "real"; abs(): types.Real { - return types.Real.from(sql`abs(${this.toSql()})`) as any; + return funcCall("abs", [this], types.Real) as types.Real; } acosh(): types.Real { - return types.Real.from(sql`acosh(${this.toSql()})`) as any; + return funcCall("acosh", [this], types.Real) as types.Real; } asinh(): types.Real { - return types.Real.from(sql`asinh(${this.toSql()})`) as any; + return funcCall("asinh", [this], types.Real) as types.Real; } atan(): types.Real { - return types.Real.from(sql`atan(${this.toSql()})`) as any; + return funcCall("atan", [this], types.Real) as types.Real; } atan2(arg0: types.Real): types.Real>> { - return types.Real.from(sql`atan2(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("atan2", [this, arg0], types.Real) as types.Real>>; } avg(): types.Real { - return types.Real.from(sql`avg(${this.toSql()})`) as any; + return funcCall("avg", [this], types.Real) as types.Real; } ceil(): types.Real { - return types.Real.from(sql`ceil(${this.toSql()})`) as any; + return funcCall("ceil", [this], types.Real) as types.Real; } ceiling(): types.Real { - return types.Real.from(sql`ceiling(${this.toSql()})`) as any; + return funcCall("ceiling", [this], types.Real) as types.Real; } char(): types.Text { - return types.Text.from(sql`char(${this.toSql()})`) as any; + return funcCall("char", [this], types.Text) as types.Text; } concat(arg0: types.Real): types.Text>> { - return types.Text.from(sql`concat(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("concat", [this, arg0], types.Text) as types.Text>>; } cos(): types.Real { - return types.Real.from(sql`cos(${this.toSql()})`) as any; + return funcCall("cos", [this], types.Real) as types.Real; } cosh(): types.Real { - return types.Real.from(sql`cosh(${this.toSql()})`) as any; + return funcCall("cosh", [this], types.Real) as types.Real; } count(): types.Integer { - return types.Integer.from(sql`count(${this.toSql()})`) as any; + return funcCall("count", [this], types.Integer) as types.Integer; } date(): types.Text { - return types.Text.from(sql`date(${this.toSql()})`) as any; + return funcCall("date", [this], types.Text) as types.Text; } datetime(): types.Text { - return types.Text.from(sql`datetime(${this.toSql()})`) as any; + return funcCall("datetime", [this], types.Text) as types.Text; } degrees(): types.Real { - return types.Real.from(sql`degrees(${this.toSql()})`) as any; + return funcCall("degrees", [this], types.Real) as types.Real; } exp(): types.Real { - return types.Real.from(sql`exp(${this.toSql()})`) as any; + return funcCall("exp", [this], types.Real) as types.Real; } firstValue(): types.Real { - return types.Real.from(sql`first_value(${this.toSql()})`) as any; + return funcCall("first_value", [this], types.Real) as types.Real; } floor(): types.Real { - return types.Real.from(sql`floor(${this.toSql()})`) as any; + return funcCall("floor", [this], types.Real) as types.Real; } format(): types.Text { - return types.Text.from(sql`format(${this.toSql()})`) as any; + return funcCall("format", [this], types.Text) as types.Text; } fts5Insttoken(): types.Real { - return types.Real.from(sql`fts5_insttoken(${this.toSql()})`) as any; + return funcCall("fts5_insttoken", [this], types.Real) as types.Real; } fts5Locale(arg0: types.Real): types.Blob>> { - return types.Blob.from(sql`fts5_locale(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("fts5_locale", [this, arg0], types.Blob) as types.Blob>>; } glob(arg0: types.Real): types.Integer>> { - return types.Integer.from(sql`glob(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("glob", [this, arg0], types.Integer) as types.Integer>>; } groupConcat(): types.Text { - return types.Text.from(sql`group_concat(${this.toSql()})`) as any; + return funcCall("group_concat", [this], types.Text) as types.Text; } hex(): types.Text { - return types.Text.from(sql`hex(${this.toSql()})`) as any; + return funcCall("hex", [this], types.Text) as types.Text; } ifnull(arg0: types.Real): types.Real>> { - return types.Real.from(sql`ifnull(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("ifnull", [this, arg0], types.Real) as types.Real>>; } instr(arg0: types.Real): types.Integer>> { - return types.Integer.from(sql`instr(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("instr", [this, arg0], types.Integer) as types.Integer>>; } json(): types.Text { - return types.Text.from(sql`json(${this.toSql()})`) as any; + return funcCall("json", [this], types.Text) as types.Text; } jsonArray(): types.Text { - return types.Text.from(sql`json_array(${this.toSql()})`) as any; + return funcCall("json_array", [this], types.Text) as types.Text; } jsonArrayInsert(): types.Text { - return types.Text.from(sql`json_array_insert(${this.toSql()})`) as any; + return funcCall("json_array_insert", [this], types.Text) as types.Text; } jsonArrayLength(): types.Integer { - return types.Integer.from(sql`json_array_length(${this.toSql()})`) as any; + return funcCall("json_array_length", [this], types.Integer) as types.Integer; } jsonb(): types.Blob { - return types.Blob.from(sql`jsonb(${this.toSql()})`) as any; + return funcCall("jsonb", [this], types.Blob) as types.Blob; } jsonbArray(): types.Blob { - return types.Blob.from(sql`jsonb_array(${this.toSql()})`) as any; + return funcCall("jsonb_array", [this], types.Blob) as types.Blob; } jsonbArrayInsert(): types.Blob { - return types.Blob.from(sql`jsonb_array_insert(${this.toSql()})`) as any; + return funcCall("jsonb_array_insert", [this], types.Blob) as types.Blob; } jsonbGroupArray(): types.Blob { - return types.Blob.from(sql`jsonb_group_array(${this.toSql()})`) as any; + return funcCall("jsonb_group_array", [this], types.Blob) as types.Blob; } jsonbGroupObject(arg0: types.Real): types.Blob>> { - return types.Blob.from(sql`jsonb_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("jsonb_group_object", [this, arg0], types.Blob) as types.Blob>>; } jsonbInsert(): types.Blob { - return types.Blob.from(sql`jsonb_insert(${this.toSql()})`) as any; + return funcCall("jsonb_insert", [this], types.Blob) as types.Blob; } jsonbPatch(arg0: types.Real): types.Blob>> { - return types.Blob.from(sql`jsonb_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("jsonb_patch", [this, arg0], types.Blob) as types.Blob>>; } jsonbRemove(): types.Blob { - return types.Blob.from(sql`jsonb_remove(${this.toSql()})`) as any; + return funcCall("jsonb_remove", [this], types.Blob) as types.Blob; } jsonbReplace(): types.Blob { - return types.Blob.from(sql`jsonb_replace(${this.toSql()})`) as any; + return funcCall("jsonb_replace", [this], types.Blob) as types.Blob; } jsonbSet(): types.Blob { - return types.Blob.from(sql`jsonb_set(${this.toSql()})`) as any; + return funcCall("jsonb_set", [this], types.Blob) as types.Blob; } jsonErrorPosition(): types.Integer { - return types.Integer.from(sql`json_error_position(${this.toSql()})`) as any; + return funcCall("json_error_position", [this], types.Integer) as types.Integer; } jsonGroupArray(): types.Text { - return types.Text.from(sql`json_group_array(${this.toSql()})`) as any; + return funcCall("json_group_array", [this], types.Text) as types.Text; } jsonGroupObject(arg0: types.Real): types.Text>> { - return types.Text.from(sql`json_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("json_group_object", [this, arg0], types.Text) as types.Text>>; } jsonInsert(): types.Text { - return types.Text.from(sql`json_insert(${this.toSql()})`) as any; + return funcCall("json_insert", [this], types.Text) as types.Text; } jsonPatch(arg0: types.Real): types.Text>> { - return types.Text.from(sql`json_patch(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("json_patch", [this, arg0], types.Text) as types.Text>>; } jsonPretty(): types.Text { - return types.Text.from(sql`json_pretty(${this.toSql()})`) as any; + return funcCall("json_pretty", [this], types.Text) as types.Text; } jsonQuote(): types.Text { - return types.Text.from(sql`json_quote(${this.toSql()})`) as any; + return funcCall("json_quote", [this], types.Text) as types.Text; } jsonRemove(): types.Text { - return types.Text.from(sql`json_remove(${this.toSql()})`) as any; + return funcCall("json_remove", [this], types.Text) as types.Text; } jsonReplace(): types.Text { - return types.Text.from(sql`json_replace(${this.toSql()})`) as any; + return funcCall("json_replace", [this], types.Text) as types.Text; } jsonSet(): types.Text { - return types.Text.from(sql`json_set(${this.toSql()})`) as any; + return funcCall("json_set", [this], types.Text) as types.Text; } jsonType(): types.Text { - return types.Text.from(sql`json_type(${this.toSql()})`) as any; + return funcCall("json_type", [this], types.Text) as types.Text; } jsonValid(): types.Integer { - return types.Integer.from(sql`json_valid(${this.toSql()})`) as any; + return funcCall("json_valid", [this], types.Integer) as types.Integer; } julianday(): types.Real { - return types.Real.from(sql`julianday(${this.toSql()})`) as any; + return funcCall("julianday", [this], types.Real) as types.Real; } lag(arg0: types.Real, arg1: types.Real): types.Real | NullOf>> { - return types.Real.from(sql`lag(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + return funcCall("lag", [this, arg0, arg1], types.Real) as types.Real | NullOf>>; } lastValue(): types.Real { - return types.Real.from(sql`last_value(${this.toSql()})`) as any; + return funcCall("last_value", [this], types.Real) as types.Real; } lead(arg0: types.Real, arg1: types.Real): types.Real | NullOf>> { - return types.Real.from(sql`lead(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + return funcCall("lead", [this, arg0, arg1], types.Real) as types.Real | NullOf>>; } length(): types.Integer { - return types.Integer.from(sql`length(${this.toSql()})`) as any; + return funcCall("length", [this], types.Integer) as types.Integer; } like(arg0: types.Real): types.Integer>> { - return types.Integer.from(sql`like(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("like", [this, arg0], types.Integer) as types.Integer>>; } likely(): types.Real { - return types.Real.from(sql`likely(${this.toSql()})`) as any; + return funcCall("likely", [this], types.Real) as types.Real; } ln(): types.Real { - return types.Real.from(sql`ln(${this.toSql()})`) as any; + return funcCall("ln", [this], types.Real) as types.Real; } log(): types.Real { - return types.Real.from(sql`log(${this.toSql()})`) as any; + return funcCall("log", [this], types.Real) as types.Real; } log10(): types.Real { - return types.Real.from(sql`log10(${this.toSql()})`) as any; + return funcCall("log10", [this], types.Real) as types.Real; } log2(): types.Real { - return types.Real.from(sql`log2(${this.toSql()})`) as any; + return funcCall("log2", [this], types.Real) as types.Real; } lower(): types.Text { - return types.Text.from(sql`lower(${this.toSql()})`) as any; + return funcCall("lower", [this], types.Text) as types.Text; } ltrim(): types.Text { - return types.Text.from(sql`ltrim(${this.toSql()})`) as any; + return funcCall("ltrim", [this], types.Text) as types.Text; } max(): types.Real { - return types.Real.from(sql`max(${this.toSql()})`) as any; + return funcCall("max", [this], types.Real) as types.Real; } median(): types.Real { - return types.Real.from(sql`median(${this.toSql()})`) as any; + return funcCall("median", [this], types.Real) as types.Real; } min(): types.Real { - return types.Real.from(sql`min(${this.toSql()})`) as any; + return funcCall("min", [this], types.Real) as types.Real; } mod(arg0: types.Real): types.Real>> { - return types.Real.from(sql`mod(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("mod", [this, arg0], types.Real) as types.Real>>; } ntile(): types.Integer { - return types.Integer.from(sql`ntile(${this.toSql()})`) as any; + return funcCall("ntile", [this], types.Integer) as types.Integer; } octetLength(): types.Integer { - return types.Integer.from(sql`octet_length(${this.toSql()})`) as any; + return funcCall("octet_length", [this], types.Integer) as types.Integer; } percentile(arg0: types.Real): types.Real>> { - return types.Real.from(sql`percentile(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("percentile", [this, arg0], types.Real) as types.Real>>; } pow(arg0: types.Real): types.Real>> { - return types.Real.from(sql`pow(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("pow", [this, arg0], types.Real) as types.Real>>; } power(arg0: types.Real): types.Real>> { - return types.Real.from(sql`power(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("power", [this, arg0], types.Real) as types.Real>>; } printf(): types.Text { - return types.Text.from(sql`printf(${this.toSql()})`) as any; + return funcCall("printf", [this], types.Text) as types.Text; } quote(): types.Text { - return types.Text.from(sql`quote(${this.toSql()})`) as any; + return funcCall("quote", [this], types.Text) as types.Text; } radians(): types.Real { - return types.Real.from(sql`radians(${this.toSql()})`) as any; + return funcCall("radians", [this], types.Real) as types.Real; } randomblob(): types.Blob { - return types.Blob.from(sql`randomblob(${this.toSql()})`) as any; + return funcCall("randomblob", [this], types.Blob) as types.Blob; } replace(arg0: types.Real, arg1: types.Real): types.Text | NullOf>> { - return types.Text.from(sql`replace(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + return funcCall("replace", [this, arg0, arg1], types.Text) as types.Text | NullOf>>; } round(): types.Real { - return types.Real.from(sql`round(${this.toSql()})`) as any; + return funcCall("round", [this], types.Real) as types.Real; } rtrim(): types.Text { - return types.Text.from(sql`rtrim(${this.toSql()})`) as any; + return funcCall("rtrim", [this], types.Text) as types.Text; } sign(): types.Integer { - return types.Integer.from(sql`sign(${this.toSql()})`) as any; + return funcCall("sign", [this], types.Integer) as types.Integer; } sin(): types.Real { - return types.Real.from(sql`sin(${this.toSql()})`) as any; + return funcCall("sin", [this], types.Real) as types.Real; } sinh(): types.Real { - return types.Real.from(sql`sinh(${this.toSql()})`) as any; + return funcCall("sinh", [this], types.Real) as types.Real; } soundex(): types.Text { - return types.Text.from(sql`soundex(${this.toSql()})`) as any; + return funcCall("soundex", [this], types.Text) as types.Text; } sqliteCompileoptionGet(): types.Text { - return types.Text.from(sql`sqlite_compileoption_get(${this.toSql()})`) as any; + return funcCall("sqlite_compileoption_get", [this], types.Text) as types.Text; } sqliteCompileoptionUsed(): types.Integer { - return types.Integer.from(sql`sqlite_compileoption_used(${this.toSql()})`) as any; + return funcCall("sqlite_compileoption_used", [this], types.Integer) as types.Integer; } sqrt(): types.Real { - return types.Real.from(sql`sqrt(${this.toSql()})`) as any; + return funcCall("sqrt", [this], types.Real) as types.Real; } strftime(): types.Text { - return types.Text.from(sql`strftime(${this.toSql()})`) as any; + return funcCall("strftime", [this], types.Text) as types.Text; } stringAgg(arg0: types.Real): types.Text>> { - return types.Text.from(sql`string_agg(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("string_agg", [this, arg0], types.Text) as types.Text>>; } substr(arg0: types.Real): types.Text>> { - return types.Text.from(sql`substr(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("substr", [this, arg0], types.Text) as types.Text>>; } substring(arg0: types.Real): types.Text>> { - return types.Text.from(sql`substring(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("substring", [this, arg0], types.Text) as types.Text>>; } subtype(): types.Integer { - return types.Integer.from(sql`subtype(${this.toSql()})`) as any; + return funcCall("subtype", [this], types.Integer) as types.Integer; } sum(): types.Real { - return types.Real.from(sql`sum(${this.toSql()})`) as any; + return funcCall("sum", [this], types.Real) as types.Real; } tan(): types.Real { - return types.Real.from(sql`tan(${this.toSql()})`) as any; + return funcCall("tan", [this], types.Real) as types.Real; } tanh(): types.Real { - return types.Real.from(sql`tanh(${this.toSql()})`) as any; + return funcCall("tanh", [this], types.Real) as types.Real; } time(): types.Text { - return types.Text.from(sql`time(${this.toSql()})`) as any; + return funcCall("time", [this], types.Text) as types.Text; } timediff(arg0: types.Real): types.Text>> { - return types.Text.from(sql`timediff(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("timediff", [this, arg0], types.Text) as types.Text>>; } total(): types.Real { - return types.Real.from(sql`total(${this.toSql()})`) as any; + return funcCall("total", [this], types.Real) as types.Real; } trim(): types.Text { - return types.Text.from(sql`trim(${this.toSql()})`) as any; + return funcCall("trim", [this], types.Text) as types.Text; } trunc(): types.Real { - return types.Real.from(sql`trunc(${this.toSql()})`) as any; + return funcCall("trunc", [this], types.Real) as types.Real; } typeof(): types.Text { - return types.Text.from(sql`typeof(${this.toSql()})`) as any; + return funcCall("typeof", [this], types.Text) as types.Text; } unicode(): types.Integer { - return types.Integer.from(sql`unicode(${this.toSql()})`) as any; + return funcCall("unicode", [this], types.Integer) as types.Integer; } unistr(): types.Text { - return types.Text.from(sql`unistr(${this.toSql()})`) as any; + return funcCall("unistr", [this], types.Text) as types.Text; } unistrQuote(): types.Text { - return types.Text.from(sql`unistr_quote(${this.toSql()})`) as any; + return funcCall("unistr_quote", [this], types.Text) as types.Text; } unixepoch(): types.Integer { - return types.Integer.from(sql`unixepoch(${this.toSql()})`) as any; + return funcCall("unixepoch", [this], types.Integer) as types.Integer; } unlikely(): types.Real { - return types.Real.from(sql`unlikely(${this.toSql()})`) as any; + return funcCall("unlikely", [this], types.Real) as types.Real; } upper(): types.Text { - return types.Text.from(sql`upper(${this.toSql()})`) as any; + return funcCall("upper", [this], types.Text) as types.Text; } zeroblob(): types.Blob { - return types.Blob.from(sql`zeroblob(${this.toSql()})`) as any; + return funcCall("zeroblob", [this], types.Blob) as types.Blob; } } diff --git a/src/types/sqlite/generated/text.ts b/src/types/sqlite/generated/text.ts index f52813c..9ca1628 100644 --- a/src/types/sqlite/generated/text.ts +++ b/src/types/sqlite/generated/text.ts @@ -5,6 +5,7 @@ import { SqliteValue } from "../base"; import { sql, type Sql } from "../../../builder/sql"; import { meta } from "../../runtime"; +import { funcCall } from "../../runtime"; import type { NullOf, StrictNull } from "../../runtime"; import * as types from "../index"; @@ -22,189 +23,189 @@ export class Text extends SqliteValue { static override __typnameText = "text"; abs(): types.Real { - return types.Real.from(sql`abs(${this.toSql()})`) as any; + return funcCall("abs", [this], types.Real) as types.Real; } avg(): types.Real { - return types.Real.from(sql`avg(${this.toSql()})`) as any; + return funcCall("avg", [this], types.Real) as types.Real; } char(): types.Text { - return types.Text.from(sql`char(${this.toSql()})`) as any; + return funcCall("char", [this], types.Text) as types.Text; } concat(arg0: types.Text): types.Text>> { - return types.Text.from(sql`concat(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("concat", [this, arg0], types.Text) as types.Text>>; } count(): types.Integer { - return types.Integer.from(sql`count(${this.toSql()})`) as any; + return funcCall("count", [this], types.Integer) as types.Integer; } firstValue(): types.Text { - return types.Text.from(sql`first_value(${this.toSql()})`) as any; + return funcCall("first_value", [this], types.Text) as types.Text; } format(): types.Text { - return types.Text.from(sql`format(${this.toSql()})`) as any; + return funcCall("format", [this], types.Text) as types.Text; } fts5Insttoken(): types.Text { - return types.Text.from(sql`fts5_insttoken(${this.toSql()})`) as any; + return funcCall("fts5_insttoken", [this], types.Text) as types.Text; } fts5Locale(arg0: types.Text): types.Blob>> { - return types.Blob.from(sql`fts5_locale(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("fts5_locale", [this, arg0], types.Blob) as types.Blob>>; } geopolyGroupBbox(): types.Blob { - return types.Blob.from(sql`geopoly_group_bbox(${this.toSql()})`) as any; + return funcCall("geopoly_group_bbox", [this], types.Blob) as types.Blob; } glob(arg0: types.Text): types.Integer>> { - return types.Integer.from(sql`glob(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("glob", [this, arg0], types.Integer) as types.Integer>>; } groupConcat(): types.Text { - return types.Text.from(sql`group_concat(${this.toSql()})`) as any; + return funcCall("group_concat", [this], types.Text) as types.Text; } hex(): types.Text { - return types.Text.from(sql`hex(${this.toSql()})`) as any; + return funcCall("hex", [this], types.Text) as types.Text; } ifnull(arg0: types.Text): types.Text>> { - return types.Text.from(sql`ifnull(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("ifnull", [this, arg0], types.Text) as types.Text>>; } instr(arg0: types.Text): types.Integer>> { - return types.Integer.from(sql`instr(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("instr", [this, arg0], types.Integer) as types.Integer>>; } jsonArray(): types.Text { - return types.Text.from(sql`json_array(${this.toSql()})`) as any; + return funcCall("json_array", [this], types.Text) as types.Text; } jsonbArray(): types.Blob { - return types.Blob.from(sql`jsonb_array(${this.toSql()})`) as any; + return funcCall("jsonb_array", [this], types.Blob) as types.Blob; } jsonbGroupArray(): types.Blob { - return types.Blob.from(sql`jsonb_group_array(${this.toSql()})`) as any; + return funcCall("jsonb_group_array", [this], types.Blob) as types.Blob; } jsonbGroupObject(arg0: types.Text): types.Blob>> { - return types.Blob.from(sql`jsonb_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("jsonb_group_object", [this, arg0], types.Blob) as types.Blob>>; } jsonbObject(arg0: types.Text): types.Blob>> { - return types.Blob.from(sql`jsonb_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("jsonb_object", [this, arg0], types.Blob) as types.Blob>>; } jsonErrorPosition(): types.Integer { - return types.Integer.from(sql`json_error_position(${this.toSql()})`) as any; + return funcCall("json_error_position", [this], types.Integer) as types.Integer; } jsonGroupArray(): types.Text { - return types.Text.from(sql`json_group_array(${this.toSql()})`) as any; + return funcCall("json_group_array", [this], types.Text) as types.Text; } jsonGroupObject(arg0: types.Text): types.Text>> { - return types.Text.from(sql`json_group_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("json_group_object", [this, arg0], types.Text) as types.Text>>; } jsonObject(arg0: types.Text): types.Text>> { - return types.Text.from(sql`json_object(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("json_object", [this, arg0], types.Text) as types.Text>>; } jsonQuote(): types.Text { - return types.Text.from(sql`json_quote(${this.toSql()})`) as any; + return funcCall("json_quote", [this], types.Text) as types.Text; } jsonValid(): types.Integer { - return types.Integer.from(sql`json_valid(${this.toSql()})`) as any; + return funcCall("json_valid", [this], types.Integer) as types.Integer; } lag(arg0: types.Text): types.Text>> { - return types.Text.from(sql`lag(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("lag", [this, arg0], types.Text) as types.Text>>; } lastValue(): types.Text { - return types.Text.from(sql`last_value(${this.toSql()})`) as any; + return funcCall("last_value", [this], types.Text) as types.Text; } lead(arg0: types.Text): types.Text>> { - return types.Text.from(sql`lead(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("lead", [this, arg0], types.Text) as types.Text>>; } length(): types.Integer { - return types.Integer.from(sql`length(${this.toSql()})`) as any; + return funcCall("length", [this], types.Integer) as types.Integer; } like(arg0: types.Text): types.Integer>> { - return types.Integer.from(sql`like(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("like", [this, arg0], types.Integer) as types.Integer>>; } likely(): types.Text { - return types.Text.from(sql`likely(${this.toSql()})`) as any; + return funcCall("likely", [this], types.Text) as types.Text; } lower(): types.Text { - return types.Text.from(sql`lower(${this.toSql()})`) as any; + return funcCall("lower", [this], types.Text) as types.Text; } ltrim(): types.Text { - return types.Text.from(sql`ltrim(${this.toSql()})`) as any; + return funcCall("ltrim", [this], types.Text) as types.Text; } max(): types.Text { - return types.Text.from(sql`max(${this.toSql()})`) as any; + return funcCall("max", [this], types.Text) as types.Text; } min(): types.Text { - return types.Text.from(sql`min(${this.toSql()})`) as any; + return funcCall("min", [this], types.Text) as types.Text; } octetLength(): types.Integer { - return types.Integer.from(sql`octet_length(${this.toSql()})`) as any; + return funcCall("octet_length", [this], types.Integer) as types.Integer; } printf(): types.Text { - return types.Text.from(sql`printf(${this.toSql()})`) as any; + return funcCall("printf", [this], types.Text) as types.Text; } quote(): types.Text { - return types.Text.from(sql`quote(${this.toSql()})`) as any; + return funcCall("quote", [this], types.Text) as types.Text; } randomblob(): types.Blob { - return types.Blob.from(sql`randomblob(${this.toSql()})`) as any; + return funcCall("randomblob", [this], types.Blob) as types.Blob; } replace(arg0: types.Text, arg1: types.Text): types.Text | NullOf>> { - return types.Text.from(sql`replace(${this.toSql()}, ${arg0.toSql()}, ${arg1.toSql()})`) as any; + return funcCall("replace", [this, arg0, arg1], types.Text) as types.Text | NullOf>>; } round(): types.Real { - return types.Real.from(sql`round(${this.toSql()})`) as any; + return funcCall("round", [this], types.Real) as types.Real; } rtrim(): types.Text { - return types.Text.from(sql`rtrim(${this.toSql()})`) as any; + return funcCall("rtrim", [this], types.Text) as types.Text; } soundex(): types.Text { - return types.Text.from(sql`soundex(${this.toSql()})`) as any; + return funcCall("soundex", [this], types.Text) as types.Text; } sqliteCompileoptionGet(): types.Text { - return types.Text.from(sql`sqlite_compileoption_get(${this.toSql()})`) as any; + return funcCall("sqlite_compileoption_get", [this], types.Text) as types.Text; } sqliteCompileoptionUsed(): types.Integer { - return types.Integer.from(sql`sqlite_compileoption_used(${this.toSql()})`) as any; + return funcCall("sqlite_compileoption_used", [this], types.Integer) as types.Integer; } strftime(): types.Text { - return types.Text.from(sql`strftime(${this.toSql()})`) as any; + return funcCall("strftime", [this], types.Text) as types.Text; } stringAgg(arg0: types.Text): types.Text>> { - return types.Text.from(sql`string_agg(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("string_agg", [this, arg0], types.Text) as types.Text>>; } substr(arg0: types.Text): types.Text>> { - return types.Text.from(sql`substr(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("substr", [this, arg0], types.Text) as types.Text>>; } substring(arg0: types.Text): types.Text>> { - return types.Text.from(sql`substring(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("substring", [this, arg0], types.Text) as types.Text>>; } subtype(): types.Integer { - return types.Integer.from(sql`subtype(${this.toSql()})`) as any; + return funcCall("subtype", [this], types.Integer) as types.Integer; } sum(): types.Real { - return types.Real.from(sql`sum(${this.toSql()})`) as any; + return funcCall("sum", [this], types.Real) as types.Real; } total(): types.Real { - return types.Real.from(sql`total(${this.toSql()})`) as any; + return funcCall("total", [this], types.Real) as types.Real; } trim(): types.Text { - return types.Text.from(sql`trim(${this.toSql()})`) as any; + return funcCall("trim", [this], types.Text) as types.Text; } typeof(): types.Text { - return types.Text.from(sql`typeof(${this.toSql()})`) as any; + return funcCall("typeof", [this], types.Text) as types.Text; } unhex(arg0: types.Text): types.Blob>> { - return types.Blob.from(sql`unhex(${this.toSql()}, ${arg0.toSql()})`) as any; + return funcCall("unhex", [this, arg0], types.Blob) as types.Blob>>; } unicode(): types.Integer { - return types.Integer.from(sql`unicode(${this.toSql()})`) as any; + return funcCall("unicode", [this], types.Integer) as types.Integer; } unistr(): types.Text { - return types.Text.from(sql`unistr(${this.toSql()})`) as any; + return funcCall("unistr", [this], types.Text) as types.Text; } unistrQuote(): types.Text { - return types.Text.from(sql`unistr_quote(${this.toSql()})`) as any; + return funcCall("unistr_quote", [this], types.Text) as types.Text; } unlikely(): types.Text { - return types.Text.from(sql`unlikely(${this.toSql()})`) as any; + return funcCall("unlikely", [this], types.Text) as types.Text; } upper(): types.Text { - return types.Text.from(sql`upper(${this.toSql()})`) as any; + return funcCall("upper", [this], types.Text) as types.Text; } zeroblob(): types.Blob { - return types.Blob.from(sql`zeroblob(${this.toSql()})`) as any; + return funcCall("zeroblob", [this], types.Blob) as types.Blob; } } From 51bfd3887a59c31d5746d60468255e4f1c75eec0 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 15:46:09 -0700 Subject: [PATCH 14/33] refactor(builders): .where(true) is a matchAll flag, no dialect-specific Bool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update/DeleteBuilder track `matchAll: boolean` alongside `where`. The two are independent — a real predicate wins at compile if both are set. Bind emits `WHERE ` when a predicate exists, no WHERE clause when only matchAll is set, and finalize throws when neither. - Drops the `Bool.from(sql\`TRUE\`)` construction in the shorthand. Removes the last PG-nominal `Bool` residue from delete/update. - Live-events update transformer emits `WHERE TRUE` explicitly for the before-CTE snapshot when the outer update used matchAll (its `FOR UPDATE` snapshot always needs a WHERE clause). Semantics for `.where(pred).where(true)` and `.where(true).where(pred)` are identical — the pred is honored. matchAll is only the "user acknowledged unrestricted mutation" flag. 550 tests green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/delete.ts | 24 +++++++++++++++--------- src/builder/update.ts | 32 +++++++++++++++++++++++--------- src/live/events.ts | 7 ++++++- 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/builder/delete.ts b/src/builder/delete.ts index 88bd508..d7fdcb7 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -1,6 +1,5 @@ import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; -import { Bool } from "../types"; import { isBool, type Bool as SharedBool } from "../types/bool"; import type { RowType, RowTypeToTsType } from "./query"; import { combinePredicates, compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; @@ -14,6 +13,7 @@ type Namespace = { [K in Name]: T }; type DeleteOpts = { instance: T; where?: (ns: Namespace) => SharedBool; + matchAll?: boolean; returning?: (ns: Namespace) => R; }; @@ -24,7 +24,8 @@ type FinalizedDeleteOpts; + where: SharedBool | undefined; + matchAll: boolean; returning?: R; }; @@ -39,9 +40,11 @@ export class FinalizedDelete>(isBool))])) where(fn: ((ns: Namespace) => SharedBool) | true): DeleteBuilder { - const wrapped: (ns: Namespace) => SharedBool = - fn === true ? () => Bool.from(sql`TRUE`) as SharedBool : fn; + if (fn === true) { + return new DeleteBuilder({ ...this.#opts, matchAll: true }); + } return new DeleteBuilder({ ...this.#opts, - where: combinePredicates(this.#opts.where, wrapped), + where: combinePredicates(this.#opts.where, fn), }); } @@ -91,20 +96,21 @@ export class DeleteBuilder { - if (!this.#opts.where) { + if (!this.#opts.where && !this.#opts.matchAll) { throw new Error("delete() requires .where() — use .where(true) to delete all rows"); } const tableName = this.tableName; const alias = new Alias(tableName); const instance = reAlias(this.#opts.instance as RowType, alias) as T; const ns = { [tableName]: instance } as Namespace; - const where = this.#opts.where(ns); + const where = this.#opts.where?.(ns); const returning = this.#opts.returning?.(ns); return new FinalizedDelete({ tableName, alias, instance, where, + matchAll: !!this.#opts.matchAll, ...(returning !== undefined ? { returning } : {}), }); } diff --git a/src/builder/update.ts b/src/builder/update.ts index 3105339..65613fc 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -1,6 +1,5 @@ import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; -import { Bool } from "../types"; import { isBool, type Bool as SharedBool } from "../types/bool"; import type { SetRow } from "../types/runtime"; import { isSetRow } from "../types/runtime"; @@ -18,6 +17,10 @@ type Namespace = { [K in Name]: T }; type UpdateOpts = { instance: T; where?: (ns: Namespace) => SharedBool; + // Explicit opt-in for "match every row" — set by `.where(true)`. + // Separate from `where` so bind() can emit no WHERE clause (rather than + // constructing a dialect-specific `TRUE` Bool). + matchAll?: boolean; set?: (ns: Namespace) => SetRow; returning?: (ns: Namespace) => R; }; @@ -28,7 +31,9 @@ type FinalizedUpdateOpts; + // undefined + matchAll=true → no WHERE emitted (delete/update all). + where: SharedBool | undefined; + matchAll: boolean; setRow: SetRow; returning?: R; }; @@ -44,9 +49,14 @@ export class FinalizedUpdate>(isBool))])) where(fn: ((ns: Namespace) => SharedBool) | true): UpdateBuilder { - const wrapped: (ns: Namespace) => SharedBool = - fn === true ? () => Bool.from(sql`TRUE`) as SharedBool : fn; + if (fn === true) { + return new UpdateBuilder({ ...this.#opts, matchAll: true }); + } return new UpdateBuilder({ ...this.#opts, - where: combinePredicates(this.#opts.where, wrapped), + where: combinePredicates(this.#opts.where, fn), }); } @@ -118,7 +131,7 @@ export class UpdateBuilder { - if (!this.#opts.where) { + if (!this.#opts.where && !this.#opts.matchAll) { throw new Error("update() requires .where() — use .where(true) to update all rows"); } if (!this.#opts.set) { @@ -129,13 +142,14 @@ export class UpdateBuilder; const setRow = this.#opts.set(ns); - const where = this.#opts.where(ns); + const where = this.#opts.where?.(ns); const returning = this.#opts.returning?.(ns); return new FinalizedUpdate({ tableName, alias, instance, where, + matchAll: !!this.#opts.matchAll, setRow, ...(returning !== undefined ? { returning } : {}), }); diff --git a/src/live/events.ts b/src/live/events.ts index cb3db70..550e785 100644 --- a/src/live/events.ts +++ b/src/live/events.ts @@ -159,7 +159,12 @@ const wrapUpdate = (builder: UpdateBuilder): Sql => { // FinalizedUpdate.bind() can't be reused: the live wrap needs // `FROM __typegres_before WHERE .ctid = __typegres_before.ctid` // instead of the user's WHERE inline. - const beforeCte = sql`SELECT *, ctid FROM ${sql.ident(tableName)} AS ${alias} WHERE ${where.toSql()} FOR UPDATE`; + // `.where(true)` on a live-tracked update leaves `where` undefined + // (matchAll semantics). Live-events still needs a WHERE for the + // before-CTE `FOR UPDATE` snapshot, so emit `WHERE TRUE` explicitly + // — always PG here since live is PG-only. + const whereClause = where ? where.toSql() : sql`TRUE`; + const beforeCte = sql`SELECT *, ctid FROM ${sql.ident(tableName)} AS ${alias} WHERE ${whereClause} FOR UPDATE`; const ctidJoin = sql`${sql.column(alias, sql.ident("ctid"))} = ${sql.ident(T_BEFORE)}.${sql.ident("ctid")}`; const updateCte = sql`UPDATE ${sql.ident(tableName)} AS ${alias} SET ${sql.join(compileSetClauses(instance, setRow))} FROM ${sql.ident(T_BEFORE)} WHERE ${ctidJoin} RETURNING ${compileSelectList(returning)}`; From ba3b2034e4aa6d88485e793299fae7621f2518e3 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 15:47:48 -0700 Subject: [PATCH 15/33] feat(sqlite): SqliteValue.in() (non-generic signature) Adds `.in()` back to SqliteValue with a non-generic signature that sidesteps the TS2589 that killed the PG-style `(this: T, ...)` version at SQLite's shallow class hierarchy. Trade-off: users don't get "same-typed args required" narrowing at TS compile time; runtime enforcement via `serialize()` still applies. Two smoke tests validate the runtime path (member/non-member cases). 552 tests green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/types/sqlite/base.ts | 40 ++++++++++++++++++++++++---------- src/types/sqlite/smoke.test.ts | 12 ++++++++++ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/types/sqlite/base.ts b/src/types/sqlite/base.ts index 161ab9d..129c6e0 100644 --- a/src/types/sqlite/base.ts +++ b/src/types/sqlite/base.ts @@ -15,6 +15,8 @@ import { SqlValue, type Dialect } from "../any"; import { meta } from "../runtime"; import * as types from "./index"; import { sql, type Sql } from "../../builder/sql"; +import { expose } from "../../exoeval/tool"; +import { isPlainData } from "../../util"; // Side-effect import: registers the SQLite dialect's deserialize table. import "./deserialize"; @@ -41,16 +43,30 @@ export class SqliteValue extends SqlValue { return types.Bool.from(sql`(${this.toSql()} IS NOT NULL)`) as types.Bool<1>; } + // Non-generic `.in()` — SQLite's shallow class hierarchy (SqlValue → + // SqliteValue → concrete) triggers TS2589 with the PG-style + // `, Vs>(this: T, ...)` signature, because + // each concrete class's `[meta].__any: Concrete` self-reference + // never bottoms out at that depth. PG dodges the recursion via a + // deeper 7-level chain. + // + // Trade-off: users don't get "same-typed args required" narrowing at + // compile time. Runtime enforcement via serialize() still applies. + // eslint-disable-next-line no-restricted-syntax + @expose.unchecked() + in(...vals: [SqliteValue | boolean | number | string, ...(SqliteValue | boolean | number | string)[]]): types.Bool { + const wrapped = vals.map((v) => { + if (v instanceof SqliteValue) return v; + if (!isPlainData(v)) { + const name = (Object.getPrototypeOf(v) as { constructor?: { name?: string } } | null)?.constructor?.name ?? "anonymous"; + throw new TypeError( + `SqliteValue.in: cannot accept ${name} instance as a list value. ` + + `Pass a typegres expression or a primitive matching ${(this[meta].__class as typeof SqliteValue).__typnameText}.`, + ); + } + return this[meta].__class.serialize(v); + }); + const list = sql.join(wrapped.map((v) => v.toSql())); + return types.Bool.from(sql`(${this.toSql()} IN (${list}))`) as types.Bool; + } } - -// `.in()` deferred: putting the PG-style generic `.in(this: T, ...)` -// on SqliteValue triggers TS2589 (excessively deep type instantiation) -// during variance inference at concrete leaves like Bool. PG dodges this -// because its type hierarchy is deep enough (7 levels) that TS bottoms -// out on structural variance before recursing into `.in`. SQLite's -// flat hierarchy hits the recursion at shallower depth. -// -// Options for later: (1) codegen `.in()` per concrete type (like pg does -// for '='); (2) add a non-generic `.in()` on SqliteValue; (3) find a way -// to force TS to stop the recursion. Deferring — isNull/isNotNull are -// enough for the phase-1 foundation. diff --git a/src/types/sqlite/smoke.test.ts b/src/types/sqlite/smoke.test.ts index 262fc73..2c55e1a 100644 --- a/src/types/sqlite/smoke.test.ts +++ b/src/types/sqlite/smoke.test.ts @@ -73,6 +73,18 @@ test("isNotNull is inverse of isNull", async () => { expect(r.rows[0]!["v"]).toBe("1"); }); +test(".in() matches a literal in a small list", async () => { + const expr = Integer.from(3).in(1, 2, 3); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("1"); +}); + +test(".in() rejects when no literal matches", async () => { + const expr = Integer.from(99).in(1, 2, 3); + const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + expect(r.rows[0]!["v"]).toBe("0"); +}); + test("placeholder emission uses ? not $N", async () => { // Integer.from(5) wraps in a TypedParam; compile should emit `?`. const expr = Integer.from(5); From 0fe00e1d86e1ea82595be81197cee8e6ff7e454a Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 15:49:16 -0700 Subject: [PATCH 16/33] chore(provenance): resolve ISSUES.md #16; clean up lint - Replace open-design entry #16 with a description of the shipped solution: DatabaseRef in CompileContext, Ident carries database via Table, dialect tags on Func/Op/Cast/Srf, matchAll flag on .where(true). Follow-ups (db.Int4-style factories, Database/Connection split) noted. - Consolidate inline-import type refs (CompileContext) in query.ts. - Drop unused sql import from table.ts. - Curly braces around `if (v instanceof SqliteValue) return v;` per eslint rule. `npm run check` green: 28 files / 552 tests + examples/basic 6/6. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/ISSUES.md | 89 +++++++++++++++++++--------------------- src/builder/query.ts | 8 ++-- src/table.ts | 2 +- src/types/sqlite/base.ts | 2 +- 4 files changed, 48 insertions(+), 53 deletions(-) diff --git a/docs/ISSUES.md b/docs/ISSUES.md index dc95203..769e7ae 100644 --- a/docs/ISSUES.md +++ b/docs/ISSUES.md @@ -96,50 +96,45 @@ 14. ~~**`.live()` subscriptions**~~ — done (PR #72). Predicate extraction, reverse-index bus, MVCC-snapshot-aware re-iteration. -16. **Cross-database provenance for typed values (RPC security).** Runtime - validators today check `v instanceof SqlValue` — "is this a typegres - value?" but not "*whose* typegres value?" Over RPC (exoeval), a client - can construct a `Bool` (or any typed expression) and hand it to - `db.execute(qb.where(theirBool))`. The check passes if the object is - a proper SqlValue instance; nothing verifies it was built *for the - Database the RPC handler is bound to*. - - Threats: - - - **Cross-dialect smuggling:** attacker on a SQLite-backed session - injects a Bool constructed against a Postgres schema. SQL emission - collides (`?` vs `$N` placeholders, wrong typenames). Coarsely - addressed by the dialect check that comes with the `Any` → `SqlValue` - sweep (Table+QB dialect-agnostic work), because `v.constructor.dialect.name` - is authoritative per class. - - **Cross-tenant smuggling** (same dialect, different DB instances): - values from tenant B's schema get spliced into tenant A's query. - Column names / OIDs matching by coincidence → info leak. Dialect - check does *not* catch this. - - **Cross-session smuggling** within one Database: some values carry - session-scoped state via `db.scope(principal)`. Bypassing the tag = - privilege escalation. - - Design options: - - - **Instance-scoped tagging.** Each `Database` mints a `Symbol()`; - values built through a db-scoped factory (`db.Int4.from(5)` instead - of `Int4.from(5)`) carry that tag. Runtime checks `v[dbIdKey] === this.dbId`. - Catches all three. Cost: breaking API change for existing PG callers; - RPC serialization needs to preserve the tag across the wire. - - **Scope-only.** Don't tag values; validate the compiled Sql tree at - `db.execute()` time — walk it and reject any SqlValue whose dialect - doesn't match ctx. Cheap, addresses cross-dialect only. - - **Opt-in session tagging.** Untagged values keep working (interop). - `db.scope(session).typedValue(x)` explicitly binds. Session-sensitive - methods (mutation, sensitive-table `.where`) refuse untagged values. - Backwards-compatible; enforcement lives where the security matters. - - Operator/method checks have the same story — `int.plus(other)` today - accepts any Int4-ish arg; under instance-tagging, `runtime.match()` - would enforce the tag matches `this`. Single code path to protect. - - Not blocking Phase 1 (SQLite dialect work), but *is* blocking any RPC - production deployment with multi-tenant or cross-dialect setups. Fold - into the exoeval hardening pass (relates to #13 gas accounting — both - are RPC-boundary threats). +16. ~~**Cross-database provenance for typed values (RPC security).**~~ + Shipped. The provenance refactor lands the check at the naming layer: + + - `CompileContext = { database: DatabaseRef }`. `Database` implements + `DatabaseRef` (id: symbol, dialect). Drivers no longer see the Sql + tree — `Database.#exec()` compiles first with its own ctx. + - `Ident` carries an optional `database`. Emitted by `Table.bind()` + / `TableBase.ident()` (both propagate the database from `db.Table`), + by `reAlias()` (inherits from the source Table), and by every + internal mutation-builder call site. At compile time, `Ident.bind(ctx)` + throws if `this.database.id !== ctx.database.id`. + - `Func` / `Op` / `UnaryOp` / `Cast` / `Srf` all carry an optional + `dialect`. `runtime.funcCall` / `runtime.opCall` pass + `type.dialect.name` automatically, so every codegen'd method (both + PG and SQLite) emits a properly-tagged node. `bind(ctx)` throws on + dialect mismatch. + - Static `Table("users")` still exists as the escape hatch (untagged + Idents). Only `db.Table(name)` produces provenance-checked Idents. + Server-authored raw templates and DDL run untagged. + - `.where(true)` no longer constructs a dialect-specific `Bool` — + it's a `matchAll` flag; a real predicate always takes precedence. + + Catches: + - Cross-dialect: PG-tagged Idents/Funcs used in SQLite context throw + at compile with a clear provenance message. + - Cross-tenant: two Database instances have distinct Symbol ids; a + value built for tenant A used in tenant B's context throws. + - Not caught: same-Database cross-session (per-principal `db.scope()` + still owns that boundary). + + Not caught by design (escape hatches): + - Raw `sql\`SELECT * FROM users\`` interpolation of identifiers via + `sql.raw(...)` — server-authored, trusted. Documented as unsafe + for @expose'd code paths. + + Related follow-ups still open: + - Instance-scoped `db.Int4.from(5)` typed-value factories (currently + typed values from `Int4.from(5)` are untagged; only their embedded + Idents get provenance via Table). + - Database/Connection split (currently `Database` doubles as both + the metadata handle and the runtime; the naming refactor lands in + a follow-up). diff --git a/src/builder/query.ts b/src/builder/query.ts index f608c40..ab02dd5 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -1,4 +1,4 @@ -import type { BoundSql } from "./sql"; +import type { BoundSql, CompileContext } from "./sql"; import { sql, Sql, Alias, Ident, compile, pgCtx } from "./sql"; import { Database } from "../database"; // Anyarray / Record stay pinned to PG — scalar() below emits ROW() / @@ -149,7 +149,7 @@ export type Fromable = { // check dialect + tag its function-name Ident); Table.bind() ignores // it, and TS allows the wider-parameter signature to satisfy the // narrower typedef. - bind(ctx?: import("./sql").CompileContext): BoundSql; + bind(ctx?: CompileContext): BoundSql; emitColumnNamesWithAlias?: boolean; // default false; if true, emit column names in FROM clause (e.g. VALUES) }; @@ -526,7 +526,7 @@ export class QueryBuilder< }); } - bind(ctx: import("./sql").CompileContext): BoundSql { + bind(ctx: CompileContext): BoundSql { return this.finalize().bind(ctx); } @@ -592,7 +592,7 @@ export class FinalizedQuery extends Sql { ].filter((x) => x instanceof Sql); } - bind(ctx: import("./sql").CompileContext): BoundSql { + bind(ctx: CompileContext): BoundSql { const tableSql: Sql[] = []; for (const t of this.opts.tables) { diff --git a/src/table.ts b/src/table.ts index d6b2348..d4c9ae8 100644 --- a/src/table.ts +++ b/src/table.ts @@ -1,4 +1,4 @@ -import { sql, Ident } from "./builder/sql"; +import { Ident } from "./builder/sql"; import type { BoundSql, DatabaseRef, Sql } from "./builder/sql"; import type { Fromable} from "./builder/query"; import { QueryBuilder } from "./builder/query"; diff --git a/src/types/sqlite/base.ts b/src/types/sqlite/base.ts index 129c6e0..f6e59bc 100644 --- a/src/types/sqlite/base.ts +++ b/src/types/sqlite/base.ts @@ -56,7 +56,7 @@ export class SqliteValue extends SqlValue { @expose.unchecked() in(...vals: [SqliteValue | boolean | number | string, ...(SqliteValue | boolean | number | string)[]]): types.Bool { const wrapped = vals.map((v) => { - if (v instanceof SqliteValue) return v; + if (v instanceof SqliteValue) {return v;} if (!isPlainData(v)) { const name = (Object.getPrototypeOf(v) as { constructor?: { name?: string } } | null)?.constructor?.name ?? "anonymous"; throw new TypeError( From 96a36daa2953733ce5a6fe7e7939777643edefd7 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:02:42 -0700 Subject: [PATCH 17/33] refactor(api): split Database (metadata) + Connection (runtime) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per the spec: Database owns dialect + provenance identity + Table factory + scopedIdent; Connection has the driver + execute/hydrate/transaction/close/ live. Database.attach(driver) returns a fresh Connection (multiple allowed). - `new Database({ dialect })` constructs a metadata handle (module-load safe; no driver required). - `const conn = db.attach(driver)` wires up a runtime Connection. - Sql.execute(conn), builder .execute(conn) — explicit connection passing throughout; supports txn nesting via the tx passed to the callback. - Driver.execute now takes `(text, values)` — Database compiles first with its own ctx (`{ database: this }`) then hands to driver. Drivers never see Sql nodes anymore. - Connection ergonomically forwards `Table` / `from` / `values` / `scopedIdent` to its database (no need to thread `db` through code that already holds a `conn`). - `typegres({ ... })` returns `{ db, conn }` for scripts / playground. - Bus + runLiveIteration take Connection (they need `.execute`). Test migration sweep: `db.execute(qb)` → `conn.execute(qb)`, `.execute(db)` → `.execute(conn)`, `db.transaction` → `conn.transaction`, etc. Across bus.test, db-live.test, database.test, hydrate.test, events.test, postgres/index.test, rpc.test, query.test, sqlite tests, examples/basic tests, demo.ts, and the README snippet. `npm run check` green: 28 files / 552 tests + examples/basic 6/6. Provenance still active — Idents carry Database id, dialects tagged on Func/Op/Cast/Srf. Co-Authored-By: Claude Opus 4.7 (1M context) --- README.md | 6 +- examples/basic/src/db.ts | 2 +- examples/basic/src/dogs.test.ts | 38 +++--- src/builder/delete.ts | 14 +- src/builder/insert.ts | 14 +- src/builder/query.test.ts | 74 +++++------ src/builder/query.ts | 32 ++--- src/builder/sql.ts | 12 +- src/builder/update.ts | 14 +- src/database.test.ts | 39 +++--- src/database.ts | 214 +++++++++++++++---------------- src/demo/demo.ts | 12 +- src/hydrate.test.ts | 38 +++--- src/index.ts | 16 ++- src/live/bus.test.ts | 16 +-- src/live/bus.ts | 4 +- src/live/db-live.test.ts | 52 ++++---- src/live/events.test.ts | 28 ++-- src/live/extractor.ts | 4 +- src/live/test-helpers.ts | 6 +- src/readme.test.ts | 8 +- src/rpc.test.ts | 48 +++---- src/test-helpers.ts | 27 ++-- src/types/postgres/index.test.ts | 6 +- src/types/sqlite/smoke.test.ts | 27 ++-- src/types/sqlite/table.test.ts | 34 ++--- 26 files changed, 396 insertions(+), 389 deletions(-) diff --git a/README.md b/README.md index 598649d..9ccf924 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ npm install typegres pg ```typescript import { typegres, Int8, Text, expose } from "typegres"; -const db = await typegres({ +const { db, conn } = await typegres({ type: "pg", connectionString: process.env.DATABASE_URL!, }); @@ -43,10 +43,10 @@ const rows = await Users.from() id: users.id, name: users.fullName(), })) - .execute(db); + .execute(conn); console.log(rows); -await db.close(); +await conn.close(); ``` For a complete scaffold with migrations + codegen, see diff --git a/examples/basic/src/db.ts b/examples/basic/src/db.ts index 0bbda4d..ae939e8 100644 --- a/examples/basic/src/db.ts +++ b/examples/basic/src/db.ts @@ -1,3 +1,3 @@ import { typegres } from "typegres"; -export const db = await typegres({ type: "pglite" }); +export const { db, conn } = await typegres({ type: "pglite" }); diff --git a/examples/basic/src/dogs.test.ts b/examples/basic/src/dogs.test.ts index b11f204..8a30d12 100644 --- a/examples/basic/src/dogs.test.ts +++ b/examples/basic/src/dogs.test.ts @@ -1,6 +1,6 @@ import { test, expect, expectTypeOf, beforeAll } from "vitest"; import { sql } from "typegres"; -import { db } from "./db"; +import { db, conn } from "./db"; import { Dogs } from "./tables/dogs"; import { Teams } from "./tables/teams"; import { Collars } from "./tables/collars"; @@ -9,11 +9,11 @@ import { Microchips } from "./tables/microchips"; beforeAll(async () => { // Create all tables - await db.execute(sql`CREATE TABLE teams ( + await conn.execute(sql`CREATE TABLE teams ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL )`); - await db.execute(sql`CREATE TABLE dogs ( + await conn.execute(sql`CREATE TABLE dogs ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL, breed text, @@ -21,36 +21,36 @@ beforeAll(async () => { team_id int8 NOT NULL REFERENCES teams(id), rival_id int8 REFERENCES dogs(id) )`); - await db.execute(sql`CREATE TABLE collars ( + await conn.execute(sql`CREATE TABLE collars ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, color text NOT NULL, dog_id int8 UNIQUE NOT NULL REFERENCES dogs(id) )`); - await db.execute(sql`CREATE TABLE toys ( + await conn.execute(sql`CREATE TABLE toys ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL, dog_id int8 NOT NULL REFERENCES dogs(id) )`); - await db.execute(sql`CREATE TABLE microchips ( + await conn.execute(sql`CREATE TABLE microchips ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial text NOT NULL, dog_id int8 UNIQUE REFERENCES dogs(id) )`); // Seed data - await db.execute(sql`INSERT INTO teams (name) VALUES ('Alpha'), ('Beta')`); - await db.execute(sql`INSERT INTO dogs (name, breed, team_id) VALUES ('Rex', 'Labrador', 1), ('Fido', NULL, 1), ('Buddy', 'Poodle', 2)`); - await db.execute(sql`UPDATE dogs SET rival_id = 2 WHERE name = 'Rex'`); - await db.execute(sql`INSERT INTO collars (color, dog_id) VALUES ('red', 1), ('blue', 2)`); - await db.execute(sql`INSERT INTO toys (name, dog_id) VALUES ('ball', 1), ('bone', 1), ('rope', 2)`); - await db.execute(sql`INSERT INTO microchips (serial, dog_id) VALUES ('MC-001', 1)`); - await db.execute(sql`INSERT INTO microchips (serial) VALUES ('MC-SPARE')`); + await conn.execute(sql`INSERT INTO teams (name) VALUES ('Alpha'), ('Beta')`); + await conn.execute(sql`INSERT INTO dogs (name, breed, team_id) VALUES ('Rex', 'Labrador', 1), ('Fido', NULL, 1), ('Buddy', 'Poodle', 2)`); + await conn.execute(sql`UPDATE dogs SET rival_id = 2 WHERE name = 'Rex'`); + await conn.execute(sql`INSERT INTO collars (color, dog_id) VALUES ('red', 1), ('blue', 2)`); + await conn.execute(sql`INSERT INTO toys (name, dog_id) VALUES ('ball', 1), ('bone', 1), ('rope', 2)`); + await conn.execute(sql`INSERT INTO microchips (serial, dog_id) VALUES ('MC-001', 1)`); + await conn.execute(sql`INSERT INTO microchips (serial) VALUES ('MC-SPARE')`); }); test("select dogs", async () => { const rows = await Dogs.from() .select(({ dogs }) => ({ id: dogs.id, name: dogs.name, breed: dogs.breed })) - .execute(db); + .execute(conn); expectTypeOf(rows).toEqualTypeOf<{ id: string; name: string; breed: string | null }[]>(); expect(rows).toHaveLength(3); @@ -67,7 +67,7 @@ test("relation: outbound FK NOT NULL → cardinality 'one'", async () => { team: dogs.team().select(({ teams }) => ({ name: teams.name })).scalar(), })) .where(({ dogs }) => dogs.name["="]("Rex")) - .execute(db); + .execute(conn); expectTypeOf(rows).toEqualTypeOf<{ name: string; team: { name: string } }[]>(); expect(rows).toEqual([{ name: "Rex", team: { name: "Alpha" } }]); @@ -81,7 +81,7 @@ test("relation: outbound FK nullable → cardinality 'maybe'", async () => { rival: dogs.rival().select(({ dogs: d }) => ({ name: d.name })).scalar(), })) .orderBy(({ dogs }) => dogs.name) - .execute(db); + .execute(conn); expectTypeOf(rows).toEqualTypeOf<{ name: string; rival: { name: string } | null }[]>(); expect(rows).toEqual([ @@ -99,7 +99,7 @@ test("relation: inbound FK non-unique → cardinality 'many'", async () => { toys: dogs.toys().select(({ toys }) => ({ name: toys.name })).scalar(), })) .orderBy(({ dogs }) => dogs.name) - .execute(db); + .execute(conn); expectTypeOf(rows).toEqualTypeOf<{ name: string; toys: { name: string }[] }[]>(); expect(rows).toEqual([ @@ -117,7 +117,7 @@ test("relation: inbound FK unique NOT NULL → cardinality 'one'", async () => { collar: dogs.collars().select(({ collars }) => ({ color: collars.color })).scalar(), })) .where(({ dogs }) => dogs.name["="]("Rex")) - .execute(db); + .execute(conn); expectTypeOf(rows).toEqualTypeOf<{ name: string; collar: { color: string } }[]>(); expect(rows).toEqual([{ name: "Rex", collar: { color: "red" } }]); @@ -131,7 +131,7 @@ test("relation: inbound FK unique nullable → cardinality 'maybe'", async () => chip: dogs.microchips().select(({ microchips }) => ({ serial: microchips.serial })).scalar(), })) .orderBy(({ dogs }) => dogs.name) - .execute(db); + .execute(conn); expectTypeOf(rows).toEqualTypeOf<{ name: string; chip: { serial: string } | null }[]>(); expect(rows).toEqual([ diff --git a/src/builder/delete.ts b/src/builder/delete.ts index d7fdcb7..418a4fa 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -4,7 +4,7 @@ import { isBool, type Bool as SharedBool } from "../types/bool"; import type { RowType, RowTypeToTsType } from "./query"; import { combinePredicates, compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; -import { Database } from "../database"; +import { Connection } from "../database"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; @@ -124,14 +124,14 @@ export class DeleteBuilder z.instanceof(Database))) - override async execute(db: Database): Promise[]> { - return db.execute(this); + @expose(z.lazy(() => z.instanceof(Connection))) + override async execute(conn: Connection): Promise[]> { + return conn.execute(this); } - @expose(z.lazy(() => z.instanceof(Database))) - async hydrate(db: Database): Promise { - return db.hydrate(this); + @expose(z.lazy(() => z.instanceof(Connection))) + async hydrate(conn: Connection): Promise { + return conn.hydrate(this); } @expose() diff --git a/src/builder/insert.ts b/src/builder/insert.ts index 4ada169..efb4957 100644 --- a/src/builder/insert.ts +++ b/src/builder/insert.ts @@ -3,7 +3,7 @@ import type { BoundSql } from "./sql"; import type { RowType, RowTypeToTsType } from "./query"; import { compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; -import { Database } from "../database"; +import { Connection } from "../database"; import { getColumn } from "../types/any"; import { meta } from "../types/runtime"; import { fn, expose } from "../exoeval/tool"; @@ -116,14 +116,14 @@ export class InsertBuilder z.instanceof(Database))) - override async execute(db: Database): Promise[]> { - return db.execute(this); + @expose(z.lazy(() => z.instanceof(Connection))) + override async execute(conn: Connection): Promise[]> { + return conn.execute(this); } - @expose(z.lazy(() => z.instanceof(Database))) - async hydrate(db: Database): Promise { - return db.hydrate(this); + @expose(z.lazy(() => z.instanceof(Connection))) + async hydrate(conn: Connection): Promise { + return conn.hydrate(this); } @expose() diff --git a/src/builder/query.test.ts b/src/builder/query.test.ts index 8fedab2..caf1929 100644 --- a/src/builder/query.test.ts +++ b/src/builder/query.test.ts @@ -1,7 +1,7 @@ import { test, expect, expectTypeOf } from "vitest"; import { Int4, Int8, Text, Bool, Jsonb } from "../types"; import { sql, compile, pgCtx } from "./sql"; -import { setupDb, db } from "../test-helpers"; +import { setupDb, db, conn } from "../test-helpers"; import { expose } from "typegres"; setupDb(); @@ -41,13 +41,13 @@ test("values with select computed column", async () => { // --- e2e --- test("e2e: values single row", async () => { - const result = await db.execute(db.values({ a: Int4.from(1), b: Text.from("hello") })); + const result = await conn.execute(db.values({ a: Int4.from(1), b: Text.from("hello") })); expectTypeOf(result).toEqualTypeOf<{ a: number; b: string }[]>(); expect(result).toEqual([{ a: 1, b: "hello" }]); }); test("e2e: values multiple rows", async () => { - const result = await db.execute(db.values({ x: Int4.from(1), y: Text.from("a") }, { x: 2, y: "b" })); + const result = await conn.execute(db.values({ x: Int4.from(1), y: Text.from("a") }, { x: 2, y: "b" })); expectTypeOf(result).toEqualTypeOf<{ x: number; y: string }[]>(); expect(result).toEqual([ { x: 1, y: "a" }, @@ -56,7 +56,7 @@ test("e2e: values multiple rows", async () => { }); test("e2e: values with select expression", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ a: Int4.from(10), b: Int4.from(20) }) .select((n) => ({ sum: n.values.a["+"](n.values.b), @@ -67,7 +67,7 @@ test("e2e: values with select expression", async () => { }); test("e2e: values with string upper", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ name: Text.from("hello") }) .select((n) => ({ upper: n.values.name.upper(), @@ -78,7 +78,7 @@ test("e2e: values with string upper", async () => { }); test("e2e: values with mixed types", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ num: Int4.from(42), str: Text.from("test"), flag: Bool.from(true) }) ); expectTypeOf(result).toEqualTypeOf<{ num: number; str: string; flag: boolean }[]>(); @@ -86,7 +86,7 @@ test("e2e: values with mixed types", async () => { }); test("e2e: values with primitive second row", async () => { - const result = await db.execute(db.values({ a: Int4.from(1) }, { a: 2 }, { a: 3 })); + const result = await conn.execute(db.values({ a: Int4.from(1) }, { a: 2 }, { a: 3 })); expectTypeOf(result).toEqualTypeOf<{ a: number }[]>(); expect(result).toEqual([{ a: 1 }, { a: 2 }, { a: 3 }]); }); @@ -94,7 +94,7 @@ test("e2e: values with primitive second row", async () => { // --- where --- test("e2e: where filters rows", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ a: Int4.from(1), b: Text.from("yes") }, { a: 2, b: "no" }, { a: 3, b: "yes" }) .where((n) => n.values.a[">"](2)) ); @@ -103,7 +103,7 @@ test("e2e: where filters rows", async () => { }); test("e2e: where with equality", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(10) }, { x: 20 }, { x: 10 }) .where((n) => n.values.x["="](10)) ); @@ -133,7 +133,7 @@ test("groupBy compiles to SQL", () => { test("e2e: groupBy select using numeric index", async () => { // n.values.category is the same expression used in groupBy — should work directly - const result = await db.execute(db + const result = await conn.execute(db .values( { category: Text.from("x"), val: Int4.from(1) }, { category: "x", val: 2 }, @@ -149,7 +149,7 @@ test("e2e: groupBy select using numeric index", async () => { }); test("e2e: groupBy with select", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values( { category: Text.from("a"), amount: Int4.from(10) }, { category: "a", amount: 20 }, @@ -185,7 +185,7 @@ test("having compiles to SQL", () => { test("e2e: having filters groups", async () => { // Group by category, only keep groups where category > 'a' - const result = await db.execute(db + const result = await conn.execute(db .values( { category: Text.from("a"), val: Int4.from(1) }, { category: "b", val: 2 }, @@ -205,7 +205,7 @@ test("e2e: having filters groups", async () => { }); test("e2e: where + groupBy + having", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values( { category: Text.from("a"), amount: Int4.from(10) }, { category: "a", amount: 20 }, @@ -239,7 +239,7 @@ test("orderBy compiles to SQL", () => { }); test("e2e: orderBy single expr (default asc)", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(3) }, { x: 1 }, { x: 2 }) .orderBy((n) => n.values.x) ); @@ -248,7 +248,7 @@ test("e2e: orderBy single expr (default asc)", async () => { }); test("e2e: orderBy single tuple", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(3) }, { x: 1 }, { x: 2 }) .orderBy((n) => [n.values.x, "desc"]) ); @@ -257,7 +257,7 @@ test("e2e: orderBy single tuple", async () => { }); test("e2e: orderBy stacking", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values( { a: Text.from("x"), b: Int4.from(2) }, { a: "x", b: 1 }, @@ -275,7 +275,7 @@ test("e2e: orderBy stacking", async () => { }); test("e2e: orderBy multiple columns", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values( { a: Text.from("x"), b: Int4.from(2) }, { a: "x", b: 1 }, @@ -297,7 +297,7 @@ test("e2e: orderBy multiple columns", async () => { // --- limit / offset --- test("e2e: limit", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(1) }, { x: 2 }, { x: 3 }) .orderBy((n) => [[n.values.x, "asc"]]) .limit(2) @@ -307,7 +307,7 @@ test("e2e: limit", async () => { }); test("e2e: offset", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(1) }, { x: 2 }, { x: 3 }) .orderBy((n) => [[n.values.x, "asc"]]) .offset(1) @@ -317,7 +317,7 @@ test("e2e: offset", async () => { }); test("e2e: limit + offset (pagination)", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(1) }, { x: 2 }, { x: 3 }, { x: 4 }, { x: 5 }) .orderBy((n) => [[n.values.x, "asc"]]) .limit(2) @@ -328,7 +328,7 @@ test("e2e: limit + offset (pagination)", async () => { }); test("e2e: where + orderBy + limit", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(10) }, { x: 5 }, { x: 20 }, { x: 1 }, { x: 15 }) .where((n) => n.values.x[">"](5)) .orderBy((n) => [[n.values.x, "asc"]]) @@ -340,8 +340,8 @@ test("e2e: where + orderBy + limit", async () => { // --- joins --- -const withinTransaction = async (fn: (tx: typeof db) => Promise) => { - await db.transaction(async (tx) => { +const withinTransaction = async (fn: (tx: typeof conn) => Promise) => { + await conn.transaction(async (tx) => { await fn(tx); throw new Error("__test_rollback__"); }).catch((e) => { @@ -586,7 +586,7 @@ test("scalar with cardinality 'many' — array result", async () => { // --- aggregates --- test("count on values", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(1) }, { x: 2 }, { x: 3 }) .groupBy() .select((n) => ({ total: n.values.x.count() })) @@ -597,7 +597,7 @@ test("count on values", async () => { }); test("sum and avg", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(10) }, { x: 20 }, { x: 30 }) .groupBy() .select((n) => ({ total: n.values.x.sum(), average: n.values.x.avg() })) @@ -608,7 +608,7 @@ test("sum and avg", async () => { }); test("groupBy with count", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values( { cat: Text.from("a"), val: Int4.from(1) }, { cat: "a", val: 2 }, @@ -631,7 +631,7 @@ test("groupBy with count", async () => { }); test("max and min", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(5) }, { x: 1 }, { x: 9 }) .groupBy() .select((n) => ({ hi: n.values.x.max(), lo: n.values.x.min() })) @@ -645,7 +645,7 @@ test("max and min", async () => { test("generate_series as Fromable via db.from()", async () => { const series = Int4.from(1).generateSeries(3, 1); - const result = await db.execute(db.from(series)); + const result = await conn.execute(db.from(series)); expectTypeOf(result).toEqualTypeOf<{ generate_series: number }[]>(); expect(result).toEqual([ @@ -658,7 +658,7 @@ test("generate_series as Fromable via db.from()", async () => { test("jsonb_each_text as multi-column SRF", async () => { const jsonVal = Jsonb.from('{"a": 1, "b": 2}'); const each = jsonVal.jsonbEachText(); - const result = await db.execute(db.from(each) + const result = await conn.execute(db.from(each) .orderBy(({ jsonb_each_text }) => jsonb_each_text.key) ); @@ -672,7 +672,7 @@ test("jsonb_each_text as multi-column SRF", async () => { // --- method idempotency --- test("select: last call wins", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ a: Int4.from(1), b: Text.from("x") }) .select((n) => ({ first: n.values.a })) .select((n) => ({ second: n.values.b })) @@ -683,7 +683,7 @@ test("select: last call wins", async () => { }); test("where: multiple calls AND-combine", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(1) }, { x: 2 }, { x: 3 }, { x: 4 }) .where((n) => n.values.x[">"](1)) .where((n) => n.values.x["<"](4)) @@ -693,7 +693,7 @@ test("where: multiple calls AND-combine", async () => { }); test("orderBy: multiple calls stack", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values( { a: Text.from("b"), b: Int4.from(2) }, { a: "a", b: 1 }, @@ -713,7 +713,7 @@ test("orderBy: multiple calls stack", async () => { }); test("limit: multiple calls take MIN", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(1) }, { x: 2 }, { x: 3 }, { x: 4 }, { x: 5 }) .orderBy((n) => n.values.x) .limit(3) @@ -724,7 +724,7 @@ test("limit: multiple calls take MIN", async () => { }); test("offset: multiple calls sum", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values({ x: Int4.from(1) }, { x: 2 }, { x: 3 }, { x: 4 }, { x: 5 }) .orderBy((n) => n.values.x) .offset(1) @@ -735,7 +735,7 @@ test("offset: multiple calls sum", async () => { }); test("groupBy: multiple calls stack", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values( { a: Text.from("x"), b: Text.from("1"), c: Int4.from(10) }, { a: "x", b: "1", c: 20 }, @@ -757,7 +757,7 @@ test("groupBy: multiple calls stack", async () => { }); test("having: multiple calls AND-combine", async () => { - const result = await db.execute(db + const result = await conn.execute(db .values( { cat: Text.from("a"), val: Int4.from(1) }, { cat: "a", val: 2 }, @@ -851,7 +851,7 @@ test("groupBy() with no args is allowed (optional callback)", () => { expect(() => compile(q, pgCtx)).not.toThrow(); }); -test("type test: db.execute(Table.from()) row methods are never-typed (uncallable)", async () => { +test("type test: conn.execute(Table.from()) row methods are never-typed (uncallable)", async () => { await withinTransaction(async (tx) => { await tx.execute(sql`CREATE TABLE widgets ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, diff --git a/src/builder/query.ts b/src/builder/query.ts index ab02dd5..47abdc8 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -1,6 +1,6 @@ import type { BoundSql, CompileContext } from "./sql"; import { sql, Sql, Alias, Ident, compile, pgCtx } from "./sql"; -import { Database } from "../database"; +import { Connection } from "../database"; // Anyarray / Record stay pinned to PG — scalar() below emits ROW() / // array_agg / COALESCE which are PG-specific. When the Scalar AST node // dispatches per-dialect (Phase 2.1) these will be gated by ctx.dialect. @@ -393,36 +393,36 @@ export class QueryBuilder< // Fluent terminators. Narrow the Sql.execute() return type from // QueryResult to a row array, and expose the hydrated / single-row // variants as chainable terminators too. - @expose(z.lazy(() => z.instanceof(Database))) - override async execute(db: Database): Promise[]> { - return db.execute(this); + @expose(z.lazy(() => z.instanceof(Connection))) + override async execute(conn: Connection): Promise[]> { + return conn.execute(this); } // Streaming terminator. Mirrors `execute` but yields the rowset on // every committed mutation that touches one of the live-tagged // tables this query reads from. Caller iterates with `for await`. - @expose(z.lazy(() => z.instanceof(Database))) - live(db: Database): AsyncIterable[]> { - return db.live(this) as AsyncIterable[]>; + @expose(z.lazy(() => z.instanceof(Connection))) + live(conn: Connection): AsyncIterable[]> { + return conn.live(this) as AsyncIterable[]>; } - @expose(z.lazy(() => z.instanceof(Database))) - async hydrate(db: Database): Promise { - return db.hydrate(this); + @expose(z.lazy(() => z.instanceof(Connection))) + async hydrate(conn: Connection): Promise { + return conn.hydrate(this); } - @expose(z.lazy(() => z.instanceof(Database))) - async one(db: Database): Promise { - const [row] = await db.hydrate(this.limit(1)); + @expose(z.lazy(() => z.instanceof(Connection))) + async one(conn: Connection): Promise { + const [row] = await conn.hydrate(this.limit(1)); if (!row) { throw new Error("QueryBuilder.one(): query returned no rows"); } return row; } - @expose(z.lazy(() => z.instanceof(Database))) - async maybeOne(db: Database): Promise { - const [row] = await db.hydrate(this.limit(1)); + @expose(z.lazy(() => z.instanceof(Connection))) + async maybeOne(conn: Connection): Promise { + const [row] = await conn.hydrate(this.limit(1)); return row ?? null; } diff --git a/src/builder/sql.ts b/src/builder/sql.ts index ced5527..90ed6ed 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -1,4 +1,4 @@ -import type { Database } from "../database"; +import type { Connection } from "../database"; import type { DialectName } from "../types/deserialize"; export type CompiledSql = { text: string; values: unknown[] }; @@ -47,13 +47,9 @@ export abstract class Sql { // overrides to take fewer params than the parent signature. abstract bind(ctx: CompileContext): BoundSql; children(): readonly Sql[] { return []; } - // Fluent terminator: `someSql.execute(db)` === `db.execute(someSql)`. - // Base returns Promise so builder subclasses can narrow to - // their specific row-array types without the covariance rules - // complaining (QueryResult and a row array are disjoint shapes, so - // neither is a subtype of the other). - execute(db: Database): Promise { - return db.execute(this); + // Fluent terminator: `someSql.execute(conn)` === `conn.execute(someSql)`. + execute(conn: Connection): Promise { + return conn.execute(this); } } diff --git a/src/builder/update.ts b/src/builder/update.ts index 65613fc..e5d431b 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -7,7 +7,7 @@ import { meta } from "../types/runtime"; import type { RowType, RowTypeToTsType } from "./query"; import { combinePredicates, compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; -import { Database } from "../database"; +import { Connection } from "../database"; import { SqlValue, getColumn } from "../types/any"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; @@ -164,14 +164,14 @@ export class UpdateBuilder z.instanceof(Database))) - override async execute(db: Database): Promise[]> { - return db.execute(this); + @expose(z.lazy(() => z.instanceof(Connection))) + override async execute(conn: Connection): Promise[]> { + return conn.execute(this); } - @expose(z.lazy(() => z.instanceof(Database))) - async hydrate(db: Database): Promise { - return db.hydrate(this); + @expose(z.lazy(() => z.instanceof(Connection))) + async hydrate(conn: Connection): Promise { + return conn.hydrate(this); } @expose() diff --git a/src/database.test.ts b/src/database.test.ts index 9476883..a12a012 100644 --- a/src/database.test.ts +++ b/src/database.test.ts @@ -1,20 +1,23 @@ import { test, expect, beforeAll, afterAll } from "vitest"; import { Int8, Text } from "./types"; import { sql } from "./builder/sql"; -import { setupDb, db } from "./test-helpers"; +import { setupDb, db, conn } from "./test-helpers"; import { PgDriver } from "./driver"; import type { Driver } from "./driver"; import { requireDatabaseUrl } from "./pg"; +import type { Connection } from "./database"; import { Database } from "./database"; setupDb(); let poolDriver: Driver; let poolDb: Database; +let poolConn: Connection; beforeAll(async () => { poolDriver = await PgDriver.create(requireDatabaseUrl(), { max: 10 }); - poolDb = new Database(poolDriver); + poolDb = new Database({ dialect: "postgres" }); + poolConn = poolDb.attach(poolDriver); }); afterAll(async () => { @@ -22,47 +25,47 @@ afterAll(async () => { }); test("transaction commits on success", async () => { - await db.execute(sql`CREATE TABLE txtest (id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL)`); + await conn.execute(sql`CREATE TABLE txtest (id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL)`); class TxTest extends db.Table("txtest") { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); } - await db.transaction(async (tx) => { + await conn.transaction(async (tx) => { await tx.execute(TxTest.insert({ name: "Alice" })); await tx.execute(TxTest.insert({ name: "Bob" })); }); - const rows = await db.execute( + const rows = await conn.execute( TxTest.from().select(({ txtest }) => ({ name: txtest.name })), ); expect(rows).toEqual([{ name: "Alice" }, { name: "Bob" }]); - await db.execute(sql`DROP TABLE txtest`); + await conn.execute(sql`DROP TABLE txtest`); }); test("transaction rollbacks on error", async () => { - await db.execute(sql`CREATE TABLE txtest2 (id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL)`); + await conn.execute(sql`CREATE TABLE txtest2 (id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL)`); class TxTest2 extends db.Table("txtest2") { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); } await expect( - db.transaction(async (tx) => { + conn.transaction(async (tx) => { await tx.execute(TxTest2.insert({ name: "Alice" })); throw new Error("rollback!"); }), ).rejects.toThrow("rollback!"); - const rows = await db.execute( + const rows = await conn.execute( TxTest2.from().select(({ txtest2 }) => ({ name: txtest2.name })), ); expect(rows).toEqual([]); - await db.execute(sql`DROP TABLE txtest2`); + await conn.execute(sql`DROP TABLE txtest2`); }); test("transaction pins one backend connection", async () => { - await poolDb.transaction(async (tx) => { + await poolConn.transaction(async (tx) => { const pid1 = await tx.execute(sql`SELECT pg_backend_pid() AS pid`); const pid2 = await tx.execute(sql`SELECT pg_backend_pid() AS pid`); expect(pid1.rows[0]?.["pid"]).toBe(pid2.rows[0]?.["pid"]); @@ -70,7 +73,7 @@ test("transaction pins one backend connection", async () => { }); test("transaction preserves session-local temp tables", async () => { - await poolDb.transaction(async (tx) => { + await poolConn.transaction(async (tx) => { await tx.execute(sql`CREATE TEMP TABLE tx_session_test (id int4)`); await tx.execute(sql`INSERT INTO tx_session_test (id) VALUES (1)`); const result = await tx.execute(sql`SELECT id FROM tx_session_test`); @@ -79,7 +82,7 @@ test("transaction preserves session-local temp tables", async () => { }); test("nested transactions flatten", async () => { - await poolDb.transaction(async (tx) => { + await poolConn.transaction(async (tx) => { const pid1 = await tx.execute(sql`SELECT pg_backend_pid() AS pid`); await tx.transaction(async (tx2) => { const pid2 = await tx2.execute(sql`SELECT pg_backend_pid() AS pid`); @@ -90,13 +93,13 @@ test("nested transactions flatten", async () => { test("nested transaction rejects stronger isolation than active", async () => { await expect( - poolDb.transaction({ isolation: "read committed" }, async (tx) => { + poolConn.transaction({ isolation: "read committed" }, async (tx) => { await tx.transaction({ isolation: "serializable" }, async () => {}); }), ).rejects.toThrow(/Cannot nest a 'serializable' transaction inside a 'read committed'/); await expect( - poolDb.transaction({ isolation: "repeatable read" }, async (tx) => { + poolConn.transaction({ isolation: "repeatable read" }, async (tx) => { await tx.transaction({ isolation: "serializable" }, async () => {}); }), ).rejects.toThrow(/Cannot nest a 'serializable' transaction inside a 'repeatable read'/); @@ -104,7 +107,7 @@ test("nested transaction rejects stronger isolation than active", async () => { test("nested transaction accepts weaker-or-equal isolation", async () => { // Outer 'serializable' satisfies any inner request. - await poolDb.transaction({ isolation: "serializable" }, async (tx) => { + await poolConn.transaction({ isolation: "serializable" }, async (tx) => { await tx.transaction({ isolation: "read committed" }, async () => {}); await tx.transaction({ isolation: "repeatable read" }, async () => {}); await tx.transaction({ isolation: "serializable" }, async () => {}); @@ -118,13 +121,13 @@ test("nested transaction rejects any explicit level inside an ambient outer", as // request would silently bind to whatever session config produced. for (const level of ["read committed", "repeatable read", "serializable"] as const) { await expect( - poolDb.transaction(async (tx) => { + poolConn.transaction(async (tx) => { await tx.transaction({ isolation: level }, async () => {}); }), ).rejects.toThrow(/inside an ambient/); } // Ambient inside ambient: fine — caller deferred to session both times. - await poolDb.transaction(async (tx) => { + await poolConn.transaction(async (tx) => { await tx.transaction(async () => {}); }); }); diff --git a/src/database.ts b/src/database.ts index 862297f..b82de8a 100644 --- a/src/database.ts +++ b/src/database.ts @@ -13,6 +13,7 @@ import { Bus, type Subscription, type BusOptions } from "./live/bus"; import { eventsTableSqlStatements } from "./live/events-ddl"; import { runLiveIteration } from "./live/extractor"; import { parseSnapshot } from "./live/snapshot"; +import type { DialectName } from "./types/deserialize"; export type TransactionIsolation = "read committed" | "repeatable read" | "serializable"; export type TransactionOptions = { @@ -35,51 +36,118 @@ const ISOLATION: { [K in TransactionIsolation]: { rank: number; begin: Sql } } = "serializable": { rank: 2, begin: sql`BEGIN ISOLATION LEVEL SERIALIZABLE` }, }; +// Immutable metadata handle. Owns the schema-provenance identity +// (`id: symbol`), the dialect, and the type registry (via `Table()`). +// Not connected to a driver — construction is synchronous, module-load +// safe. Attach a driver later via `db.attach(driver)` to get a +// Connection. +// // `C` is the per-app context (principal) type. Forwarded to every // `db.Table(name)` so every codegen-emitted class picks up the same C // without changing the generator. Default `undefined` matches the // pre-context behavior. export class Database implements DatabaseRef { - // Per-Database provenance identity. Ident nodes constructed via this - // Database (through `db.scopedIdent`, `db.Table`, etc.) carry this id; - // compile checks match against ctx.database.id. readonly id: symbol = Symbol("Database"); readonly name?: string; + readonly dialect: DialectName; + + constructor(opts: { dialect: DialectName; name?: string }) { + this.dialect = opts.dialect; + if (opts.name) { this.name = opts.name; } + } + + // Provenance-tagged identifier factory. The only way to construct a + // schema-referencing Ident that survives the compile-time provenance + // check. Prefer over raw `sql.ident(name)` (which leaves the Ident + // unattributed) for anything the RPC boundary might touch. + scopedIdent(name: string): Ident { + return new Ident(name, this); + } + + // Forwarded to codegen'd `Table(name, opts, database)` — attaches + // `this` as the class's `.database` static, so every Ident it emits + // carries this Database's id. + public Table = (name: Name, opts: TableOptions = {}) => + Table(name, opts, this); + + // Attach a driver → get a runtime Connection. Multiple `attach` calls + // are allowed (test + prod, worker pools, replicas) — Connections + // share the schema provenance but talk to independent drivers. + attach(driver: Driver): Connection { + if (driver.dialect !== this.dialect) { + throw new Error( + `Driver dialect '${driver.dialect}' does not match Database dialect '${this.dialect}'.`, + ); + } + return new Connection(this, driver); + } + + // Entry point for non-Table Fromables (SRFs, Values, subqueries). + // Table classes have their own static `.from()`. + from( + from: Fromable, + ): QueryBuilder<{ [K in A]: R }, R, []> { + return new QueryBuilder({ + tsAlias: from.tsAlias, + tables: [{ type: "from", source: from }], + }); + } + + values( + vals0: R, + ...valsRest: (NoInfer | RowTypeToTsType>)[] + ): QueryBuilder<{ values: R }, R, []> { + const vals = new Values(vals0, ...valsRest); + return new QueryBuilder<{ values: R }, R, []>({ + tsAlias: "values", + tables: [{ type: "from", source: vals }], + }); + } +} + +// Runtime handle: has a driver, executes queries. Constructed via +// `db.attach(driver)`. `.transaction()` mints a txn-bound Connection +// sharing the same driver + Database. `.close()` closes the driver. +export class Connection { #boundExecute?: ExecuteFn; - // Active isolation on a txn-bound Database. `undefined` means either + // Active isolation on a txn-bound Connection. `undefined` means either // pool-backed (no active txn) or ambient (txn opened without an // explicit level — we deferred to pg's session default, which we // can't introspect cheaply, so we don't claim a specific level). #isolation?: TransactionIsolation; - // A pool-backed Database (`new Database(driver)`) routes each query - // through the driver's pool. A transaction-bound Database (constructed - // internally via .transaction()) carries a single-connection ExecuteFn - // so every query inside the txn callback lands on the same connection. - // - // txn-bound databases share their parent's `id` — the Idents attached - // to a Table stay valid across the parent → txn boundary, so tests - // that build queries outside the txn and execute inside it still - // compile. - constructor(private driver: Driver, boundExecute?: ExecuteFn, isolation?: TransactionIsolation, parentId?: symbol) { + constructor( + readonly database: Database, + private driver: Driver, + boundExecute?: ExecuteFn, + isolation?: TransactionIsolation, + ) { if (boundExecute) { this.#boundExecute = boundExecute; } if (isolation) { this.#isolation = isolation; } - if (parentId) { this.id = parentId; } } - // Dialect forwarded from driver so provenance/compile checks can - // read it directly off the Database (DatabaseRef contract). get dialect() { return this.driver.dialect; } - // Provenance-tagged identifier factory. Prefer this over free-standing - // `sql.ident(name)` for anything that references schema (column, - // table, alias). Compile then enforces "same db" at bind time. - scopedIdent(name: string): Ident { - return new Ident(name, this); + // Ergonomic passthroughs to the underlying Database. Lets callers + // that already have a `conn` build tables/queries without threading a + // separate `db` variable through the code — the resulting Table + // classes still carry `this.database` as their provenance handle. + Table(name: Name, opts?: TableOptions) { + return this.database.Table(name, opts); + } + scopedIdent(name: string): Ident { return this.database.scopedIdent(name); } + from(from: Fromable) { + return this.database.from(from); + } + values( + vals0: R, + ...valsRest: (NoInfer | RowTypeToTsType>)[] + ) { + return this.database.values(vals0, ...valsRest); } #exec(query: Sql): Promise { - const { text, values } = compile(query, { database: this }); + const { text, values } = compile(query, { database: this.database }); return (this.#boundExecute ?? this.driver.execute.bind(this.driver))(text, values); } @@ -114,15 +182,8 @@ export class Database implements DatabaseRef { return result; } - // Materialize rows as class instances. Each column field is an Any - // wrapping a CAST(param) of the row's value, so methods on the class - // (relations, mutations, derived columns) compose into follow-up - // queries naturally: `const [user] = await db.hydrate(User.from()...); - // await db.execute(user.todos());`. - // - // For queries whose output shape is a plain object (e.g. `.select(ns => - // ({a: ns.x.foo}))`), hydrate returns plain objects with each field an - // Any-wrapped value — the prototype-preservation is a no-op. + // Materialize rows as class instances. See original doc on the + // hydrate method for the design rationale. async hydrate( query: QueryBuilder, ): Promise; @@ -145,20 +206,16 @@ export class Database implements DatabaseRef { if (!r) { return []; } shape = r as { [k: string]: unknown }; } else { - throw new Error("db.hydrate requires a QueryBuilder or mutation with RETURNING"); + throw new Error("conn.hydrate requires a QueryBuilder or mutation with RETURNING"); } return hydrateRows(result.rows as { [key: string]: string }[], shape); } - // Run `fn` inside a transaction. The `tx` Database passed to fn is bound - // to a single connection; every execute/hydrate on it goes through that - // connection. Nested calls flatten: `tx.transaction(...)` just invokes the - // callback without opening a new BEGIN/COMMIT. - async transaction(fn: (tx: Database) => Promise): Promise; - async transaction(opts: TransactionOptions, fn: (tx: Database) => Promise): Promise; + async transaction(fn: (tx: Connection) => Promise): Promise; + async transaction(opts: TransactionOptions, fn: (tx: Connection) => Promise): Promise; async transaction( - optsOrFn: TransactionOptions | ((tx: Database) => Promise), - maybeFn?: (tx: Database) => Promise, + optsOrFn: TransactionOptions | ((tx: Connection) => Promise), + maybeFn?: (tx: Connection) => Promise, ): Promise { const opts = typeof optsOrFn === "function" ? undefined : optsOrFn; const fn = typeof optsOrFn === "function" ? optsOrFn : maybeFn; @@ -167,14 +224,9 @@ export class Database implements DatabaseRef { } if (this.#boundExecute) { // Already in a txn — flatten, but reject silent isolation downgrades. - // Pg can't promote isolation after the first query, so an inner call - // requesting more than the active txn provides is a bug. if (opts?.isolation) { const active = this.#isolation; if (active === undefined) { - // Outer is ambient (deferred to session default) — we don't - // know its actual level, so we can't safely promise the inner - // is satisfied. Bail rather than silently flatten. throw new Error( `Cannot nest a '${opts.isolation}' transaction inside an ambient (no-isolation-specified) transaction — ` + `the outer's level depends on session config and can't be verified. Open the outer transaction at '${opts.isolation}' or stronger.`, @@ -190,9 +242,9 @@ export class Database implements DatabaseRef { return fn(this); } return this.driver.runInSingleConnection(async (execute) => { - const tx = new Database(this.driver, execute, opts?.isolation, this.id); + const tx = new Connection(this.database, this.driver, execute, opts?.isolation); const runSql = async (s: Sql) => { - const { text, values } = compile(s, { database: tx }); + const { text, values } = compile(s, { database: this.database }); return execute(text, values); }; await runSql(opts?.isolation ? ISOLATION[opts.isolation].begin : sql`BEGIN`); @@ -201,9 +253,6 @@ export class Database implements DatabaseRef { await runSql(sql`COMMIT`); return result; } catch (e) { - // Preserve the original error even if ROLLBACK itself fails - // (connection lost, etc.). Log the rollback failure but rethrow - // the user's exception — it's the one they care about. try { await runSql(sql`ROLLBACK`); } catch (rollbackErr) { @@ -214,67 +263,26 @@ export class Database implements DatabaseRef { }); } - // Shut the underlying connection pool. Without this, scripts hang - // after their last query because pg's idle-timeout has to expire - // before node can exit. Idempotent on the driver side. async close(): Promise { if (this.#boundExecute) { - throw new Error("close() must be called on a pool-backed Database, not inside a transaction"); + throw new Error("close() must be called on a pool-backed Connection, not inside a transaction"); } await this.driver.close(); } - // Entry point for non-Table Fromables (SRFs, Values, subqueries) — - // Table classes have their own static `.from()`. - public from( - from: Fromable, - ): QueryBuilder<{ [K in A]: R }, R, []> { - return new QueryBuilder({ - tsAlias: from.tsAlias, - tables: [{ type: "from", source: from }], - }); - } - - public values( - vals0: R, - ...valsRest: (NoInfer | RowTypeToTsType>)[] - ): QueryBuilder<{ values: R }, R, []> { - const vals = new Values(vals0, ...valsRest); - return new QueryBuilder<{ values: R }, R, []>({ - tsAlias: "values", - tables: [{ type: "from", source: vals }], - }); - } - - // Forward the app-wide context type to every `db.Table(name)` so - // codegen-emitted classes inherit it without changes to the - // generator. `Table` constrains `scope()` to accept only - // values assignable to C, and pins `contextOf()`'s return type. - public Table = (name: Name, opts: TableOptions = {}) => - Table(name, opts, this); - // --- Live queries --- - // Bus is per-Driver (per-pool); a tx-bound Database delegates to its - // parent's bus. Lifecycle is explicit — startLive() must be called - // before any live(). Live queries by definition cross commit boundaries - // so calling .live() inside a transaction is rejected. #bus: Bus | undefined; - // One-time DDL: creates `_typegres_live_events` (idempotent via IF NOT - // EXISTS). Run as part of your migrations alongside table creation — - // production callers do this once at deploy time. The demo runs it on - // PGlite boot (in-browser; the table is gone when the page reloads). - // `startLive` does not run DDL — it assumes this table already exists. async installLiveEvents(): Promise { for (const stmt of eventsTableSqlStatements()) { - const { text, values } = compile(stmt, { database: this }); + const { text, values } = compile(stmt, { database: this.database }); await this.driver.execute(text, values); } } async startLive(opts: BusOptions = {}): Promise { if (this.#boundExecute) { - throw new Error("startLive() must be called on a pool-backed Database, not inside a transaction"); + throw new Error("startLive() must be called on a pool-backed Connection, not inside a transaction"); } if (this.#bus) { throw new Error("Live bus already started"); } this.#bus = new Bus(this, opts); @@ -287,11 +295,6 @@ export class Database implements DatabaseRef { await bus?.stop(); } - // Async iterable: yields the current row set, then re-yields whenever a - // committed mutation might have changed that result. Each iteration - // opens a REPEATABLE READ txn (via runLiveIteration), captures its - // cursor, materializes a closed PredicateSet, and registers a - // subscription with the bus. Wakes when the bus signals a match. async *live>( query: Q, ): AsyncIterable< @@ -303,25 +306,18 @@ export class Database implements DatabaseRef { throw new Error("live() can't be called inside a transaction"); } const bus = this.#bus; - if (!bus) { throw new Error("Live bus not started — call db.startLive() first"); } + if (!bus) { throw new Error("Live bus not started — call conn.startLive() first"); } let currentSub: Subscription | undefined; try { while (true) { const { rows, cursor, predicateSet } = await runLiveIteration(this, query); - // undefined → backfill already shows a mutation the cursor - // missed; rerun immediately. Otherwise sub.wait resolves on the - // next matching poll (signal auto-unsubscribes). currentSub = bus.subscribe(parseSnapshot(cursor), predicateSet); yield rows as any; if (currentSub) { try { await currentSub.wait; } catch (e) { - // `await sub.wait` is a non-yield point; .return() on the - // iterator can't interrupt it directly. The bus rejects - // wait via sub.cancel() (e.g. on shutdown) so we wake up - // here and exit cleanly through finally. if (e instanceof DOMException && e.name === "AbortError") {return;} throw e; } @@ -329,8 +325,6 @@ export class Database implements DatabaseRef { } } } finally { - // Consumer broke mid-wait — sub still indexed; clean up explicitly. - // Idempotent if signal/cancel already unsubscribed. currentSub?.unsubscribe(); } } diff --git a/src/demo/demo.ts b/src/demo/demo.ts index f3ef18e..dba3f7d 100644 --- a/src/demo/demo.ts +++ b/src/demo/demo.ts @@ -1,12 +1,12 @@ import { typegres, sql, Int8, Text } from "typegres"; -const db = await typegres({ type: "pglite" }); +const { db, conn } = await typegres({ type: "pglite" }); // ------------------------------------ // Set up a tiny schema + seed data. // ------------------------------------ -await db.execute(sql` +await conn.execute(sql` CREATE TABLE posts ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, author text NOT NULL, @@ -38,7 +38,7 @@ await Posts.insert( { author: "alice", body: "first post", likes: "5" }, { author: "bob", body: "hello from pglite", likes: "12" }, { author: "alice", body: "another from alice", likes: "3" }, -).execute(db); +).execute(conn); // ------------------------------------ // Example 1: simple select with a derived column. @@ -49,7 +49,7 @@ const alicePosts = await Posts.from() .select(({ posts }) => ({ id: posts.id, preview: posts.preview() })) .orderBy(({ posts }) => posts.id) .debug() - .execute(db); + .execute(conn); console.log("Alice's posts:", alicePosts); // ------------------------------------ @@ -64,7 +64,7 @@ const likesByAuthor = await Posts.from() })) .orderBy(({ posts }) => [posts.likes.sum(), "desc"]) .debug() - .execute(db); + .execute(conn); console.log("Likes by author:", likesByAuthor); // ------------------------------------ @@ -76,5 +76,5 @@ const promoted = await Posts.update() .set(() => ({ likes: "999" })) .returning(({ posts }) => ({ id: posts.id, likes: posts.likes })) .debug() - .execute(db); + .execute(conn); console.log("Promoted:", promoted); diff --git a/src/hydrate.test.ts b/src/hydrate.test.ts index 12d84d7..f80497d 100644 --- a/src/hydrate.test.ts +++ b/src/hydrate.test.ts @@ -1,11 +1,11 @@ import { describe, test, expect, expectTypeOf, beforeAll } from "vitest"; import { typegres, sql, Table, Int8, Text, Bool, expose } from "typegres"; -import type { Database, QueryBuilder } from "typegres"; +import type { Connection, QueryBuilder } from "typegres"; -// End-to-end tests for db.hydrate(): materialize query rows as class +// End-to-end tests for conn.hydrate(): materialize query rows as class // instances with methods, then use those methods in follow-up queries. -let db: Database; +let conn: Connection; class User extends Table("users") { id = (Int8<1>).column({ nonNull: true, generated: true }); @@ -37,14 +37,14 @@ class Todo extends Table("todos") { } beforeAll(async () => { - db = await typegres({ type: "pglite" }); - await db.execute(sql` + ({ conn } = await typegres({ type: "pglite" })); + await conn.execute(sql` CREATE TABLE users ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL ) `); - await db.execute(sql` + await conn.execute(sql` CREATE TABLE todos ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, user_id int8 NOT NULL, @@ -52,14 +52,14 @@ beforeAll(async () => { completed bool NOT NULL DEFAULT false ) `); - await db.execute(sql`INSERT INTO users (name) VALUES ('alice'), ('bob')`); - await db.execute(sql`INSERT INTO todos (user_id, title, completed) VALUES + await conn.execute(sql`INSERT INTO users (name) VALUES ('alice'), ('bob')`); + await conn.execute(sql`INSERT INTO todos (user_id, title, completed) VALUES (1, 'a-one', false), (1, 'a-two', false), (2, 'b-one', false)`); }); describe("db.hydrate", () => { test("returns class instances with the same prototype chain", async () => { - const users = await db.hydrate(User.from().orderBy((ns) => ns.users.id)); + const users = await conn.hydrate(User.from().orderBy((ns) => ns.users.id)); expectTypeOf(users).toEqualTypeOf(); expect(users).toHaveLength(2); expect(users[0]).toBeInstanceOf(User); @@ -67,7 +67,7 @@ describe("db.hydrate", () => { }); test("hydrated column is an Any wrapping the deserialized value", async () => { - const [user] = await db.hydrate( + const [user] = await conn.hydrate( User.from().where((ns) => ns.users.id["="]("1")).limit(1), ); // id stays a typed Any after hydrate — that's what lets relation methods @@ -78,14 +78,14 @@ describe("db.hydrate", () => { }); test("relation method on a hydrated instance runs as a real query", async () => { - const [alice] = await db.hydrate( + const [alice] = await conn.hydrate( User.from().where((ns) => ns.users.id["="]("1")).limit(1), ); // Call the relation method on the materialized instance. The method // composes `this.id` (an Any wrapping the param) into a fresh // QueryBuilder which we then run. expectTypeOf(alice!.todos()).toEqualTypeOf>(); - const aliceTodos = await db.execute(alice!.todos()); + const aliceTodos = await conn.execute(alice!.todos()); // db.execute returns deserialized JS values, not Any wrappers — so // .title is `string`, not `Text<1>`. (RowTypeToTsType also threads // class methods through, so the row type is wider than just columns; @@ -98,15 +98,15 @@ describe("db.hydrate", () => { }); test("instance mutation method runs as a real query", async () => { - const [todo] = await db.hydrate( + const [todo] = await conn.hydrate( Todo.from().where((ns) => ns.todos.title["="](Text.from("a-one"))).limit(1), ); expectTypeOf(todo!.completed).toMatchTypeOf>(); expect(todo!.completed).toBeDefined(); - await db.execute(todo!.update({ completed: true })); + await conn.execute(todo!.update({ completed: true })); - const [after] = await db.execute( + const [after] = await conn.execute( Todo.from().where((ns) => ns.todos.title["="](Text.from("a-one"))), ); expectTypeOf(after!.completed).toEqualTypeOf(); @@ -114,10 +114,10 @@ describe("db.hydrate", () => { }); test("chained hydrate -> method -> hydrate -> method", async () => { - const [alice] = await db.hydrate( + const [alice] = await conn.hydrate( User.from().where((ns) => ns.users.id["="]("1")).limit(1), ); - const [firstTodo] = await db.hydrate( + const [firstTodo] = await conn.hydrate( alice!.todos().orderBy((ns) => ns.todos.id).limit(1), ); // Hydrate yields a Todo instance, not a plain row — methods on Todo @@ -125,9 +125,9 @@ describe("db.hydrate", () => { expectTypeOf(firstTodo!).toMatchTypeOf(); expect(firstTodo).toBeInstanceOf(Todo); - await db.execute(firstTodo!.update({ title: "renamed" })); + await conn.execute(firstTodo!.update({ title: "renamed" })); - const [reloaded] = await db.execute( + const [reloaded] = await conn.execute( Todo.from().where((ns) => ns.todos.id["="](firstTodo!.id)), ); expectTypeOf(reloaded!.title).toEqualTypeOf(); diff --git a/src/index.ts b/src/index.ts index b3c0d05..e128374 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -export { Database } from "./database"; +export { Database, Connection } from "./database"; export type { TransactionIsolation, TransactionOptions } from "./database"; export { Table } from "./table"; export { sql, Sql } from "./builder/sql"; @@ -12,19 +12,23 @@ export type { RawChannel } from "./exoeval/rpc"; export type { Config } from "./config"; export type { Driver } from "./driver"; +import type { Connection } from "./database"; import { Database } from "./database"; import { PgDriver, PgliteDriver } from "./driver"; -// Convenience factory for quick scripts and the playground. Real apps -// should compose PgDriver.create(...) + new Database(driver) themselves -// so they can hold onto the driver for lifecycle management. +// Convenience factory for quick scripts and the playground. Returns +// `{ db, conn }` — the immutable metadata handle and its attached +// runtime Connection. Real apps typically build these separately at +// module load / bootstrap. export const typegres = async ( opts: { type: "pglite" } | { type: "pg"; connectionString: string }, -): Promise> => { +): Promise<{ db: Database; conn: Connection }> => { const driver = opts.type === "pglite" ? await PgliteDriver.create() : await PgDriver.create(opts.connectionString); - return new Database(driver); + const db = new Database({ dialect: "postgres" }); + const conn = db.attach(driver); + return { db, conn }; }; export * from "./types"; diff --git a/src/live/bus.test.ts b/src/live/bus.test.ts index 4f29e97..41caa24 100644 --- a/src/live/bus.test.ts +++ b/src/live/bus.test.ts @@ -1,6 +1,6 @@ import { test, expect } from "vitest"; import { sql } from "../builder/sql"; -import { db, setupDb } from "../test-helpers"; +import { conn, setupDb } from "../test-helpers"; import { Bus, CursorTooOldError, type Subscription } from "./bus"; import { type Cursor, parseSnapshot } from "./snapshot"; import { setupLiveEvents } from "./test-helpers"; @@ -9,12 +9,12 @@ setupDb(); setupLiveEvents(); const grabSnapshot = async (): Promise => { - const r = await db.execute(sql`SELECT pg_current_snapshot()::text AS s`); + const r = await conn.execute(sql`SELECT pg_current_snapshot()::text AS s`); return parseSnapshot((r.rows as { s: string }[])[0]!.s); }; const insertEvent = async (table: string, before: object | null, after: object | null) => { - await db.execute(sql` + await conn.execute(sql` INSERT INTO _typegres_live_events (xid, "table", before, after) VALUES ( pg_current_xact_id(), @@ -34,7 +34,7 @@ const waitedWithin = async (sub: Subscription, ms = 50): Promise => ]); test("Bus signals a subscription whose cursor doesn't see a matching event", async () => { - const bus = new Bus(db); + const bus = new Bus(conn); await bus.start(); const sub = bus.subscribe( @@ -52,7 +52,7 @@ test("Bus signals a subscription whose cursor doesn't see a matching event", asy }); test("Bus does not signal when the cursor already sees the event", async () => { - const bus = new Bus(db); + const bus = new Bus(conn); await bus.start(); // Insert event FIRST, then capture cursor — sub's snapshot sees it. @@ -70,7 +70,7 @@ test("Bus does not signal when the cursor already sees the event", async () => { }); test("subscribe returns undefined when in-memory backfill already shows a matching event", async () => { - const bus = new Bus(db); + const bus = new Bus(conn); await bus.start(); // Capture cursor BEFORE the event commits (sub won't see it). @@ -97,7 +97,7 @@ test("subscribe returns undefined when in-memory backfill already shows a matchi test("subscribe throws CursorTooOldError when cursor is older than the buffer floor", async () => { // Tiny window of 2 — easy to roll the floor past an old cursor. - const bus = new Bus(db, { windowSize: 2 }); + const bus = new Bus(conn, { windowSize: 2 }); await bus.start(); // Snapshot held by an "ancient" cursor predating any committed events. @@ -117,7 +117,7 @@ test("subscribe throws CursorTooOldError when cursor is older than the buffer fl }); test("subscribe throws if bus is not started", () => { - const bus = new Bus(db); + const bus = new Bus(conn); expect(() => bus.subscribe({ xmin: 0n, xmax: 0n, xip: new Set() }, new Map()), ).toThrow(/not started/); diff --git a/src/live/bus.ts b/src/live/bus.ts index 73286e8..3f72884 100644 --- a/src/live/bus.ts +++ b/src/live/bus.ts @@ -1,4 +1,4 @@ -import type { Database } from "../database"; +import type { Connection } from "../database"; import { sql } from "../builder/sql"; import { type Cursor, parseSnapshot, visible } from "./snapshot"; import type { PredicateSet } from "./extractor"; @@ -108,7 +108,7 @@ export class Bus { readonly #windowSize: number; constructor( - private db: Database, + private db: Connection, opts: BusOptions = {}, ) { this.#intervalMs = opts.intervalMs ?? 100; diff --git a/src/live/db-live.test.ts b/src/live/db-live.test.ts index 1527167..e2a7da6 100644 --- a/src/live/db-live.test.ts +++ b/src/live/db-live.test.ts @@ -2,7 +2,7 @@ import { test, expect, afterEach } from "vitest"; import { Int8, Text } from "../types"; import { sql } from "../builder/sql"; import { Table } from "../table"; -import { db, setupDb } from "../test-helpers"; +import { conn, setupDb } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; import { setupLiveEvents } from "./test-helpers"; setupDb(); @@ -14,14 +14,14 @@ setupLiveEvents(); afterEach(async () => { // db.stopLive may have already been called by the test — guarded by // its idempotent semantics. - await db.stopLive(); - await db.execute(sql`DROP TABLE IF EXISTS notes`); - await db.execute(sql`DROP TABLE IF EXISTS users`); - await db.execute(sql`DROP TABLE IF EXISTS dogs`); + await conn.stopLive(); + await conn.execute(sql`DROP TABLE IF EXISTS notes`); + await conn.execute(sql`DROP TABLE IF EXISTS users`); + await conn.execute(sql`DROP TABLE IF EXISTS dogs`); }); const makeNotesTable = async () => { - await db.execute(sql`CREATE TABLE notes ( + await conn.execute(sql`CREATE TABLE notes ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, user_id int8 NOT NULL, body text NOT NULL @@ -41,9 +41,9 @@ const takeNext = async (iter: AsyncIterator): Promise => { test("yields current rows then re-yields on a matching commit (insert path)", async () => { const Notes = await makeNotesTable(); - await db.startLive({ intervalMs: 25 }); + await conn.startLive({ intervalMs: 25 }); - const iter = db.live( + const iter = conn.live( Notes.from() .where(({ notes }) => notes.user_id.eq("1")) .select(({ notes }) => ({ id: notes.id, body: notes.body })), @@ -51,7 +51,7 @@ test("yields current rows then re-yields on a matching commit (insert path)", as expect(await takeNext(iter)).toEqual([]); - await Notes.insert({ user_id: "1", body: "hello" }).execute(db); + await Notes.insert({ user_id: "1", body: "hello" }).execute(conn); const second = await takeNext(iter); expect(second).toHaveLength(1); @@ -59,9 +59,9 @@ test("yields current rows then re-yields on a matching commit (insert path)", as // Non-matching insert (user 99) shouldn't trigger a re-yield. const racing = iter.next(); - await Notes.insert({ user_id: "99", body: "irrelevant" }).execute(db); + await Notes.insert({ user_id: "99", body: "irrelevant" }).execute(conn); // …but the second matching insert should win the race. - await Notes.insert({ user_id: "1", body: "world" }).execute(db); + await Notes.insert({ user_id: "1", body: "world" }).execute(conn); const third = await racing; expect(third.done).toBe(false); @@ -73,10 +73,10 @@ test("yields current rows then re-yields on a matching commit (insert path)", as test("UPDATE on a matching row re-yields with new values", async () => { const Notes = await makeNotesTable(); - await Notes.insert({ user_id: "1", body: "first" }).execute(db); - await db.startLive({ intervalMs: 25 }); + await Notes.insert({ user_id: "1", body: "first" }).execute(conn); + await conn.startLive({ intervalMs: 25 }); - const iter = db.live( + const iter = conn.live( Notes.from() .where(({ notes }) => notes.user_id.eq("1")) .select(({ notes }) => ({ id: notes.id, body: notes.body })), @@ -88,7 +88,7 @@ test("UPDATE on a matching row re-yields with new values", async () => { await Notes.update() .where(({ notes }) => notes.user_id.eq("1")) .set(() => ({ body: "edited" })) - .execute(db); + .execute(conn); const second = await takeNext(iter); expect(second[0]!.body).toBe("edited"); @@ -101,10 +101,10 @@ test("DELETE on a matching row re-yields with the row removed", async () => { await Notes.insert( { user_id: "1", body: "keep-1" }, { user_id: "1", body: "delete-me" }, - ).execute(db); - await db.startLive({ intervalMs: 25 }); + ).execute(conn); + await conn.startLive({ intervalMs: 25 }); - const iter = db.live( + const iter = conn.live( Notes.from() .where(({ notes }) => notes.user_id.eq("1")) .select(({ notes }) => ({ id: notes.id, body: notes.body })), @@ -115,7 +115,7 @@ test("DELETE on a matching row re-yields with the row removed", async () => { await Notes.delete() .where(({ notes }) => notes.body.eq("delete-me")) - .execute(db); + .execute(conn); const second = await takeNext(iter); expect(second).toHaveLength(1); @@ -125,11 +125,11 @@ test("DELETE on a matching row re-yields with the row removed", async () => { }, 10_000); test("join: mutation on either side triggers re-yield (literal propagates across edge)", async () => { - await db.execute(sql`CREATE TABLE users ( + await conn.execute(sql`CREATE TABLE users ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL )`); - await db.execute(sql`INSERT INTO users (id, name) OVERRIDING SYSTEM VALUE VALUES (5, 'alice')`); + await conn.execute(sql`INSERT INTO users (id, name) OVERRIDING SYSTEM VALUE VALUES (5, 'alice')`); const Notes = await makeNotesTable(); class Users extends Table("users", { transformer: TypegresLiveEvents.makeTransformer() }) { @@ -137,9 +137,9 @@ test("join: mutation on either side triggers re-yield (literal propagates across name = (Text<1>).column({ nonNull: true }); } - await db.startLive({ intervalMs: 25 }); + await conn.startLive({ intervalMs: 25 }); - const iter = db.live( + const iter = conn.live( Users.from() .join(Notes, ({ users, notes }) => notes.user_id.eq(users.id)) .where(({ users }) => users.id.eq("5")) @@ -151,7 +151,7 @@ test("join: mutation on either side triggers re-yield (literal propagates across // Insert a note matching user 5 — should fire even though the predicate // graph never had a literal anchor on notes.user_id directly. - await Notes.insert({ user_id: "5", body: "hello" }).execute(db); + await Notes.insert({ user_id: "5", body: "hello" }).execute(conn); const second = await takeNext(iter); expect(second).toHaveLength(1); @@ -164,7 +164,7 @@ test("join: mutation on either side triggers re-yield (literal propagates across await Users.update() .where(({ users }) => users.id.eq("5")) .set(() => ({ name: "ALICE" })) - .execute(db); + .execute(conn); const third = await takeNext(iter); expect(third[0]!.user_name).toBe("ALICE"); @@ -174,6 +174,6 @@ test("join: mutation on either side triggers re-yield (literal propagates across test("throws if startLive wasn't called", async () => { const Notes = await makeNotesTable(); - const iter = db.live(Notes.from())[Symbol.asyncIterator](); + const iter = conn.live(Notes.from())[Symbol.asyncIterator](); await expect(iter.next()).rejects.toThrow(/startLive/); }); diff --git a/src/live/events.test.ts b/src/live/events.test.ts index e91fa0f..b5a11a9 100644 --- a/src/live/events.test.ts +++ b/src/live/events.test.ts @@ -2,7 +2,7 @@ import { test, expect, beforeAll, afterEach } from "vitest"; import { Int8, Text } from "../types"; import { sql } from "../builder/sql"; import { Table } from "../table"; -import { db, setupDb } from "../test-helpers"; +import { conn, setupDb } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; import { setupLiveEvents } from "./test-helpers"; @@ -16,7 +16,7 @@ class Foos extends Table("foos", { transformer: TypegresLiveEvents.makeTransform } beforeAll(async () => { - await db.execute(sql`CREATE TABLE foos ( + await conn.execute(sql`CREATE TABLE foos ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL, qty int8 @@ -26,14 +26,14 @@ beforeAll(async () => { afterEach(async () => { // RESTART IDENTITY keeps generated ids stable across tests so each // test can assert id="1", id="2" without depending on order. - await db.execute(sql`TRUNCATE foos RESTART IDENTITY`); + await conn.execute(sql`TRUNCATE foos RESTART IDENTITY`); }); type EventRow = { xid: string; table: string; before: string | null; after: string | null }; const fetchEvents = async (): Promise => { // Raw pg jsonb comes back as a JSON-encoded string. Parsing here keeps // the assertions readable. - const r = await db.execute( + const r = await conn.execute( sql`SELECT xid::text, "table", before, after FROM _typegres_live_events ORDER BY id`, ); return r.rows as unknown as EventRow[]; @@ -41,7 +41,7 @@ const fetchEvents = async (): Promise => { const parse = (j: string | null) => (j === null ? null : JSON.parse(j)); test("insert emits one event per inserted row with after-image", async () => { - await Foos.insert({ name: "Rex" }, { name: "Fido" }).execute(db); + await Foos.insert({ name: "Rex" }, { name: "Fido" }).execute(conn); const events = await fetchEvents(); expect(events).toHaveLength(2); @@ -55,15 +55,15 @@ test("insert emits one event per inserted row with after-image", async () => { test("insert RETURNING surfaces user columns through the wrap", async () => { const rows = await Foos.insert({ name: "hello" }) .returning(({ foos }) => ({ id: foos.id, name: foos.name })) - .execute(db); + .execute(conn); expect(rows).toEqual([{ id: "1", name: "hello" }]); }); test("delete emits one event per deleted row with before-image", async () => { // Seed via raw SQL so the transformer doesn't fire for the setup rows. - await db.execute(sql`INSERT INTO foos (id, name) OVERRIDING SYSTEM VALUE VALUES (10, 'a'), (11, 'b'), (12, 'c')`); + await conn.execute(sql`INSERT INTO foos (id, name) OVERRIDING SYSTEM VALUE VALUES (10, 'a'), (11, 'b'), (12, 'c')`); - await Foos.delete().where(({ foos }) => foos.id.lt("12")).execute(db); + await Foos.delete().where(({ foos }) => foos.id.lt("12")).execute(conn); const events = await fetchEvents(); expect(events).toHaveLength(2); @@ -75,22 +75,22 @@ test("delete emits one event per deleted row with before-image", async () => { }); test("delete RETURNING surfaces user columns through the wrap", async () => { - await db.execute(sql`INSERT INTO foos (name) VALUES ('keep'), ('drop')`); + await conn.execute(sql`INSERT INTO foos (name) VALUES ('keep'), ('drop')`); const rows = await Foos.delete() .where(({ foos }) => foos.name.eq("drop")) .returning(({ foos }) => ({ id: foos.id, name: foos.name })) - .execute(db); + .execute(conn); expect(rows).toEqual([{ id: "2", name: "drop" }]); }); test("update pairs before and after via ctid", async () => { - await db.execute(sql`INSERT INTO foos (id, name, qty) OVERRIDING SYSTEM VALUE VALUES (1, 'a', 10), (2, 'b', 20), (3, 'c', 30)`); + await conn.execute(sql`INSERT INTO foos (id, name, qty) OVERRIDING SYSTEM VALUE VALUES (1, 'a', 10), (2, 'b', 20), (3, 'c', 30)`); await Foos.update() .set(() => ({ qty: "999" })) .where(({ foos }) => foos.qty.lt("30")) - .execute(db); + .execute(conn); const events = await fetchEvents(); expect(events).toHaveLength(2); @@ -103,12 +103,12 @@ test("update pairs before and after via ctid", async () => { }); test("update RETURNING surfaces user columns through the wrap", async () => { - await db.execute(sql`INSERT INTO foos (name) VALUES ('old')`); + await conn.execute(sql`INSERT INTO foos (name) VALUES ('old')`); const rows = await Foos.update() .set(() => ({ name: "new" })) .where(true) .returning(({ foos }) => ({ id: foos.id, name: foos.name })) - .execute(db); + .execute(conn); expect(rows).toEqual([{ id: "1", name: "new" }]); }); diff --git a/src/live/extractor.ts b/src/live/extractor.ts index 2626ebf..9a27cfb 100644 --- a/src/live/extractor.ts +++ b/src/live/extractor.ts @@ -1,4 +1,4 @@ -import type { Database } from "../database"; +import type { Connection } from "../database"; import { FinalizedQuery, type QueryBuilder, type RowType, type RowTypeToTsType } from "../builder/query"; import { type Alias, Column, Op, type Raw, type Sql, sql, TypedParam } from "../builder/sql"; import { type TableBase, isTableClass } from "../table"; @@ -322,7 +322,7 @@ export type LiveIterationResult = { // cursor, run the extractor, run the user query, commit. Caller handles the // outer "yield + wait for matching event + repeat" loop. export const runLiveIteration = async >( - db: Database, + db: Connection, query: Q, ): Promise< Q extends QueryBuilder diff --git a/src/live/test-helpers.ts b/src/live/test-helpers.ts index a4da5eb..3f2d6de 100644 --- a/src/live/test-helpers.ts +++ b/src/live/test-helpers.ts @@ -1,6 +1,6 @@ import { afterEach, beforeAll } from "vitest"; import { sql } from "../builder/sql"; -import { db } from "../test-helpers"; +import { conn } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; // Opt-in for live tests: creates `_typegres_live_events` once at the start @@ -8,9 +8,9 @@ import { TypegresLiveEvents } from "./events"; // starts clean — no per-test boilerplate. export const setupLiveEvents = (): void => { beforeAll(async () => { - await db.execute(TypegresLiveEvents.createTableSql()); + await conn.execute(TypegresLiveEvents.createTableSql()); }); afterEach(async () => { - await db.execute(sql`TRUNCATE _typegres_live_events`); + await conn.execute(sql`TRUNCATE _typegres_live_events`); }); }; diff --git a/src/readme.test.ts b/src/readme.test.ts index 4bf3b93..bdd3aef 100644 --- a/src/readme.test.ts +++ b/src/readme.test.ts @@ -27,7 +27,7 @@ import { execFile } from "node:child_process"; import { promisify } from "node:util"; import * as swc from "@swc/core"; import { sql } from "./builder/sql"; -import { setupDb, db } from "./test-helpers"; +import { setupDb, conn } from "./test-helpers"; import { requireDatabaseUrl } from "./pg"; const execFileP = promisify(execFile); @@ -94,12 +94,12 @@ const runReadmeUsage = async (mode: InstallMode): Promise => { fs.writeFileSync(path.join(tmpDir, "main.mjs"), compiled.code); // Seed the per-worker schema with what the snippet expects. - await db.execute(sql`CREATE TABLE users ( + await conn.execute(sql`CREATE TABLE users ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, first_name text NOT NULL, last_name text NOT NULL )`); - await db.execute(sql`INSERT INTO users (first_name, last_name) VALUES + await conn.execute(sql`INSERT INTO users (first_name, last_name) VALUES ('Alice', 'Smith'), ('Bob', 'Jones')`); @@ -118,7 +118,7 @@ const runReadmeUsage = async (mode: InstallMode): Promise => { expect(stdout).toContain("Alice Smith"); expect(stdout).toContain("Bob Jones"); } finally { - await db.execute(sql`DROP TABLE IF EXISTS users`).catch(() => {}); + await conn.execute(sql`DROP TABLE IF EXISTS users`).catch(() => {}); fs.rmSync(tmpDir, { recursive: true, force: true }); } }; diff --git a/src/rpc.test.ts b/src/rpc.test.ts index 2246852..12be8fe 100644 --- a/src/rpc.test.ts +++ b/src/rpc.test.ts @@ -1,6 +1,6 @@ import { describe, test, expect, expectTypeOf } from "vitest"; import { sql, Table, Int8, Text, Record, Anyarray } from "typegres"; -import type { Database } from "typegres"; +import type { Connection } from "typegres"; import { expose } from "./exoeval/tool"; import { RpcClient, inMemoryChannel } from "./exoeval/rpc"; import { setupDb, withinTransaction } from "./test-helpers"; @@ -17,7 +17,7 @@ setupDb(); // api.users() // .where(({ users }) => users.id["="]("1")) // .select(({ users }) => ({ id: users.id, name: users.name.upper() })) -// .execute(api.db), +// .execute(api.conn), // ); // // The closures inside .where / .select aren't exported as stubs — they're @@ -36,10 +36,10 @@ class Users extends Table("users") { class Api { @expose() - db: Database; + conn: Connection; - constructor(db: Database) { - this.db = db; + constructor(conn: Connection) { + this.conn = conn; } @expose() @@ -72,7 +72,7 @@ class Api { // Each test creates its own users table inside a withinTransaction block // so the tests stay isolated and self-contained — same pattern as the // rest of the suite (see src/builder/*.test.ts). -const setupUsers = async (tx: Database) => { +const setupUsers = async (tx: Connection) => { await tx.execute(sql` CREATE TABLE users ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, @@ -95,7 +95,7 @@ describe("typegres over exoeval rpc — in-memory", () => { id: users.id, name: users.name.upper(), })) - .execute(api.db), + .execute(api.conn), ); expect(rows).toEqual([{ id: "1", name: "ALICE" }]); @@ -113,7 +113,7 @@ describe("typegres over exoeval rpc — in-memory", () => { api.users() .where(({ users }) => users.id[">="](minId)) .select(({ users }) => ({ name: users.name })) - .execute(api.db), + .execute(api.conn), { minId }, ); @@ -130,7 +130,7 @@ describe("typegres over exoeval rpc — in-memory", () => { api.users() .where(({ users }) => users.id[">"]("0")) .select(({ users }) => ({ name: users.name })) - .execute(api.db), + .execute(api.conn), ); expect(rows.map((r: { name: string }) => r.name).sort()).toEqual([ @@ -149,7 +149,7 @@ describe("typegres over exoeval rpc — in-memory", () => { const inserted = await rpc.run((api) => api.insertUsers({ name: "dave" }) .returning(({ users }) => ({ id: users.id, name: users.name })) - .execute(api.db), + .execute(api.conn), ); expect(inserted).toEqual([{ id: "4", name: "dave" }]); @@ -166,7 +166,7 @@ describe("typegres over exoeval rpc — in-memory", () => { .set(({ users: _ }) => ({ name: "ALICE!" })) .where(({ users }) => users.id["="]("1")) .returning(({ users }) => ({ id: users.id, name: users.name })) - .execute(api.db), + .execute(api.conn), ); expect(updated).toEqual([{ id: "1", name: "ALICE!" }]); @@ -185,7 +185,7 @@ describe("typegres over exoeval rpc — in-memory", () => { // property access on non-@expose returns undefined; JSON // serialization drops it. describe("@expose gating across select shapes", () => { - const setupSecrets = async (tx: Database) => { + const setupSecrets = async (tx: Connection) => { await tx.execute(sql` CREATE TABLE secrets ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, @@ -203,8 +203,8 @@ describe("typegres over exoeval rpc — in-memory", () => { password = (Text<1>).column({ nonNull: true }); } class SecretsApi { - @expose() db: Database; - constructor(db: Database) { this.db = db; } + @expose() conn: Connection; + constructor(conn: Connection) { this.conn = conn; } @expose() all() { return Secrets.from(); } // eslint-disable-next-line no-restricted-syntax -- test fixture @expose.unchecked() @@ -212,7 +212,7 @@ describe("typegres over exoeval rpc — in-memory", () => { @expose() updateSecrets() { return Secrets.update(); } @expose() deleteSecrets() { return Secrets.delete(); } // Deliberately returns class instances; used to verify the wire rejects them. - @expose() async hydrateAll() { return this.db.hydrate(Secrets.from()); } + @expose() async hydrateAll() { return this.conn.hydrate(Secrets.from()); } } // Closure helper: every test in this block does the same tx + rpc + setup @@ -232,7 +232,7 @@ describe("typegres over exoeval rpc — in-memory", () => { await withinTransaction(async (tx) => { await setupSecrets(tx); const rpc = new RpcClient(inMemoryChannel(new SecretsApi(tx))); - const rows = await rpc.run((api) => api.all().execute(api.db)); + const rows = await rpc.run((api) => api.all().execute(api.conn)); expect(rows).toEqual([{ id: "1", public_name: "alice" }]); expect(rows[0]).not.toHaveProperty("password"); }); @@ -243,7 +243,7 @@ describe("typegres over exoeval rpc — in-memory", () => { await setupSecrets(tx); const rpc = new RpcClient(inMemoryChannel(new SecretsApi(tx))); const rows = await rpc.run((api) => - api.all().select(({ secrets }) => ({ ...secrets })).execute(api.db), + api.all().select(({ secrets }) => ({ ...secrets })).execute(api.conn), ); expect(rows).toEqual([{ id: "1", public_name: "alice" }]); expect(rows[0]).not.toHaveProperty("password"); @@ -262,7 +262,7 @@ describe("typegres over exoeval rpc — in-memory", () => { rpc.run((api) => api.all() .select(({ secrets }) => ({ pass: secrets.password })) - .execute(api.db), + .execute(api.conn), ), ).rejects.toThrow(); }); @@ -278,7 +278,7 @@ describe("typegres over exoeval rpc — in-memory", () => { single: api.all().limit(1).cardinality("one").scalar(), })) .limit(1) - .execute(api.db), + .execute(api.conn), ); expect(rows).toEqual([{ single: { id: "1", public_name: "alice" } }]); expect(rows[0]!.single).not.toHaveProperty("password"); @@ -299,7 +299,7 @@ describe("typegres over exoeval rpc — in-memory", () => { }; }) .limit(1) - .execute(api.db), + .execute(api.conn), ); expect(rows[0]!.all).toEqual([{ id: "1", public_name: "alice" }]); expect(rows[0]!.all[0]).toEqual({ id: "1", public_name: "alice" }); @@ -357,7 +357,7 @@ describe("typegres over exoeval rpc — in-memory", () => { const rows = await runRpc((api) => api.insertSecrets({ public_name: "dave", password: "hunter3" }) .returning(({ secrets }) => secrets) - .execute(api.db), + .execute(api.conn), ); expect(rows).toEqual([{ id: "2", public_name: "dave" }]); expect(rows[0]).not.toHaveProperty("password"); @@ -369,7 +369,7 @@ describe("typegres over exoeval rpc — in-memory", () => { .set(() => ({ public_name: "ALICE!" })) .where(({ secrets }) => secrets.id["="]("1")) .returning(({ secrets }) => secrets) - .execute(api.db), + .execute(api.conn), ); expect(rows).toEqual([{ id: "1", public_name: "ALICE!" }]); expect(rows[0]).not.toHaveProperty("password"); @@ -380,7 +380,7 @@ describe("typegres over exoeval rpc — in-memory", () => { api.deleteSecrets() .where(({ secrets }) => secrets.id["="]("1")) .returning(({ secrets }) => secrets) - .execute(api.db), + .execute(api.conn), ); expect(rows).toEqual([{ id: "1", public_name: "alice" }]); expect(rows[0]).not.toHaveProperty("password"); @@ -402,7 +402,7 @@ describe("typegres over exoeval rpc — in-memory", () => { api.deleteUsers() .where(({ users }) => users.id[">="]("2")) .returning(({ users }) => ({ name: users.name })) - .execute(api.db), + .execute(api.conn), ); expect(deleted.map((r: { name: string }) => r.name).sort()).toEqual(["bob", "carol"]); diff --git a/src/test-helpers.ts b/src/test-helpers.ts index a7484ca..4dc8c32 100644 --- a/src/test-helpers.ts +++ b/src/test-helpers.ts @@ -4,10 +4,11 @@ import type { Driver } from "./driver"; import { requireDatabaseUrl } from "./pg"; import { Database } from "./database"; import { compile, type Sql, sql } from "./builder/sql"; -import type { TransactionIsolation } from "./database"; +import type { TransactionIsolation , Connection } from "./database"; export let driver: Driver; export let db: Database; +export let conn: Connection; // Per-worker schema isolates tables so test files can run in parallel against // one Postgres. search_path is set at connection startup (via libpq options), @@ -15,36 +16,38 @@ export let db: Database; // worker's schema without changes to test bodies. const schema = `test_w${process.env["VITEST_WORKER_ID"] ?? "1"}`; -// Opt-in DB lifecycle. Call once at the top of any test file that uses `db` -// or `withinTransaction` — registers beforeAll/afterAll for that file's -// suite. Unit-only test files don't call it and avoid booting Postgres. +// Opt-in DB lifecycle. Call once at the top of any test file that uses +// `db`/`conn` or `withinTransaction` — registers beforeAll/afterAll +// for that file's suite. Unit-only test files don't call it and avoid +// booting Postgres. export const setupDb = (): void => { + db = new Database({ dialect: "postgres" }); beforeAll(async () => { driver = await PgDriver.create(requireDatabaseUrl(), { max: 1, options: `-csearch_path=${schema}`, }); - db = new Database(driver); - await db.execute(sql`DROP SCHEMA IF EXISTS ${sql.ident(schema)} CASCADE`); - await db.execute(sql`CREATE SCHEMA ${sql.ident(schema)}`); + conn = db.attach(driver); + await conn.execute(sql`DROP SCHEMA IF EXISTS ${sql.ident(schema)} CASCADE`); + await conn.execute(sql`CREATE SCHEMA ${sql.ident(schema)}`); }); afterAll(async () => { - await db.execute(sql`DROP SCHEMA IF EXISTS ${sql.ident(schema)} CASCADE`); - await driver.close(); + await conn.execute(sql`DROP SCHEMA IF EXISTS ${sql.ident(schema)} CASCADE`); + await conn.close(); }); }; // Runs `fn` inside a transaction that always rolls back. The tx is passed -// in so tests explicitly operate on the txn-bound Database — queries, sql +// in so tests explicitly operate on the txn-bound Connection — queries, sql // fragments, and mutations all go through it. Pass `isolation` when the // test (or anything it calls) needs at least that level — e.g. live tests // that nest a `repeatable read` runLiveIteration inside. export const withinTransaction = async ( - fn: (tx: Database) => Promise, + fn: (tx: Connection) => Promise, opts?: { isolation?: TransactionIsolation }, ) => { - await db.transaction(opts ?? {}, async (tx) => { + await conn.transaction(opts ?? {}, async (tx) => { await fn(tx); throw new Error("__test_rollback__"); }).catch((e) => { diff --git a/src/types/postgres/index.test.ts b/src/types/postgres/index.test.ts index 971bb91..430ef21 100644 --- a/src/types/postgres/index.test.ts +++ b/src/types/postgres/index.test.ts @@ -7,13 +7,15 @@ import { compile, pgCtx } from "../../builder/sql"; import { sql } from "../../builder/sql"; import { PgDriver } from "../../driver"; import { requireDatabaseUrl } from "../../pg"; +import type { Connection } from "../../database"; import { Database } from "../../database"; -let exec: Database; +let exec: Connection; beforeAll(async () => { const driver = await PgDriver.create(requireDatabaseUrl(), { max: 1 }); - exec = new Database(driver); + const localDb = new Database({ dialect: "postgres" }); + exec = localDb.attach(driver); }); afterAll(async () => { diff --git a/src/types/sqlite/smoke.test.ts b/src/types/sqlite/smoke.test.ts index 2c55e1a..97359e0 100644 --- a/src/types/sqlite/smoke.test.ts +++ b/src/types/sqlite/smoke.test.ts @@ -10,56 +10,59 @@ // broken, the runtime throws. import { test, expect, beforeAll, afterAll } from "vitest"; import { SqliteDriver } from "../../driver"; +import type { Connection } from "../../database"; import { Database } from "../../database"; import { compile, sql, sqliteCtx } from "../../builder/sql"; import { Integer, Text } from "./index"; let driver: SqliteDriver; let db: Database; +let conn: Connection; beforeAll(async () => { driver = await SqliteDriver.create(":memory:"); - db = new Database(driver); + db = new Database({ dialect: "sqlite" }); + conn = db.attach(driver); }); afterAll(async () => { - await driver.close(); + await conn.close(); }); test("Integer.abs on a negative literal", async () => { const expr = Integer.from(-5).abs(); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("5"); }); test("Integer.abs composed with itself is idempotent", async () => { const expr = Integer.from(-3).abs().abs(); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("3"); }); test("Text.upper on a literal", async () => { const expr = Text.from("hello").upper(); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("HELLO"); }); test("Text.upper composed with Text.length", async () => { const expr = Text.from("hello").upper().length(); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("5"); }); test("Text.lower composed with Text.upper (round-trip)", async () => { const expr = Text.from("Hello").upper().lower(); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("hello"); }); test("isNull returns 1 for NULL, 0 for a value", async () => { const nullExpr = Text.from(sql`NULL`).isNull(); const notNullExpr = Text.from("x").isNull(); - const r = await db.execute( + const r = await conn.execute( sql`SELECT ${nullExpr.toSql()} AS n, ${notNullExpr.toSql()} AS nn`, ); // SQLite returns 1/0 as integer for boolean expressions; we normalize to strings @@ -69,26 +72,26 @@ test("isNull returns 1 for NULL, 0 for a value", async () => { test("isNotNull is inverse of isNull", async () => { const expr = Text.from("x").isNotNull(); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("1"); }); test(".in() matches a literal in a small list", async () => { const expr = Integer.from(3).in(1, 2, 3); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("1"); }); test(".in() rejects when no literal matches", async () => { const expr = Integer.from(99).in(1, 2, 3); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("0"); }); test("placeholder emission uses ? not $N", async () => { // Integer.from(5) wraps in a TypedParam; compile should emit `?`. const expr = Integer.from(5); - const r = await db.execute(sql`SELECT ${expr.toSql()} as v`); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("5"); // Direct compile probe — belt-and-suspenders. const compiled = compile(expr.toSql(), sqliteCtx); diff --git a/src/types/sqlite/table.test.ts b/src/types/sqlite/table.test.ts index 1d70713..6e880a2 100644 --- a/src/types/sqlite/table.test.ts +++ b/src/types/sqlite/table.test.ts @@ -8,13 +8,15 @@ // dispatches placeholders (`?` vs `$N`). import { test, expect, beforeAll, afterAll } from "vitest"; import { SqliteDriver } from "../../driver"; +import type { Connection } from "../../database"; import { Database } from "../../database"; import { sql } from "../../builder/sql"; -import { Table } from "../../table"; import { expose } from "../../exoeval/tool"; import { Integer, Text } from "./index"; -class Users extends Table("users") { +const db = new Database({ dialect: "sqlite" }); + +class Users extends db.Table("users") { @expose() id = Integer.column({ nonNull: true }); @expose() @@ -22,24 +24,24 @@ class Users extends Table("users") { } let driver: SqliteDriver; -let db: Database; +let conn: Connection; beforeAll(async () => { driver = await SqliteDriver.create(":memory:"); - db = new Database(driver); + conn = db.attach(driver); // Bootstrap schema. The Table("users") class only owns the *shape*; // the actual CREATE lives in application-land (or a codegen'd migration). - await db.execute(sql`CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL)`); + await conn.execute(sql`CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL)`); }); afterAll(async () => { - await driver.close(); + await conn.close(); }); test("INSERT rows and read them back with .from()", async () => { - await Users.insert({ id: 1, name: "alice" }).execute(db); - await Users.insert({ id: 2, name: "bob" }).execute(db); - const rows = await Users.from().execute(db); + await Users.insert({ id: 1, name: "alice" }).execute(conn); + await Users.insert({ id: 2, name: "bob" }).execute(conn); + const rows = await Users.from().execute(conn); expect(rows.length).toBe(2); // Rows come out in insertion order (SQLite rowid ordering). expect(rows[0]!.name).toBe("alice"); @@ -49,21 +51,21 @@ test("INSERT rows and read them back with .from()", async () => { test("INSERT ... RETURNING id", async () => { const returned = await Users.insert({ id: 3, name: "carol" }) .returning(({ users }) => ({ id: users.id })) - .execute(db); + .execute(conn); expect(returned).toEqual([{ id: 3 }]); }); test("SELECT projection with method composition (upper)", async () => { const rows = await Users.from() .select((u) => ({ upperName: u.users.name.upper() })) - .execute(db); + .execute(conn); expect(rows.map((r) => r.upperName)).toEqual(["ALICE", "BOB", "CAROL"]); }); test("WHERE with sql template + .isNull()", async () => { const rows = await Users.from() .where((u) => u.users.name.isNotNull()) - .execute(db); + .execute(conn); expect(rows.length).toBe(3); }); @@ -82,7 +84,7 @@ test("WHERE with raw sql predicate + placeholder is `?`", async () => { Text.from(sql`(${u.users.name.toSql()} = ${target.toSql()})`).isNotNull(), ), ) - .execute(db); + .execute(conn); // isNotNull composed with itself matches all non-null equalities (i.e. // all rows) — this test mainly validates that placeholders emit as // `?` inside a compiled WHERE. Row count == full table means it did @@ -95,7 +97,7 @@ test("UPDATE ... RETURNING name", async () => { .where((u) => u.users.id.isNotNull()) .set(() => ({ name: "renamed" })) .returning(({ users }) => ({ name: users.name })) - .execute(db); + .execute(conn); // Three rows updated → three returned. expect(returned.length).toBe(3); expect(returned.every((r) => r.name === "renamed")).toBe(true); @@ -105,8 +107,8 @@ test("DELETE ... RETURNING id", async () => { const returned = await Users.delete() .where((u) => u.users.id.isNotNull()) .returning(({ users }) => ({ id: users.id })) - .execute(db); + .execute(conn); expect(returned.length).toBe(3); - const remaining = await Users.from().execute(db); + const remaining = await Users.from().execute(conn); expect(remaining.length).toBe(0); }); From 68f74cd29425d0824f3ec251f1750a7483e2a160 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:02:58 -0700 Subject: [PATCH 18/33] docs(issues): mark Database/Connection split complete under #16 Removes it from the "still open" list; keeps only the instance-scoped typed-value factory (`db.Int4.from(5)`) as the remaining provenance follow-up. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/ISSUES.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/ISSUES.md b/docs/ISSUES.md index 769e7ae..09c9c43 100644 --- a/docs/ISSUES.md +++ b/docs/ISSUES.md @@ -135,6 +135,9 @@ - Instance-scoped `db.Int4.from(5)` typed-value factories (currently typed values from `Int4.from(5)` are untagged; only their embedded Idents get provenance via Table). - - Database/Connection split (currently `Database` doubles as both - the metadata handle and the runtime; the naming refactor lands in - a follow-up). + + ~~Database/Connection split~~ — done. `new Database({ dialect })` is the + immutable metadata handle at module load; `db.attach(driver)` returns + a runtime `Connection`. Multiple attaches allowed. Builders' + `.execute(conn)` verifies conn.database matches, then compiles with + the tagged ctx. From 88485f818bd2e2443538301fcd2d293d9c48bd08 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:19:02 -0700 Subject: [PATCH 19/33] feat(provenance): sweep tests to db.Table + provenance-enforcement suite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up on the escape-hatch discussion. Test sweep — no more untagged Tables in test files: - Every `class X extends Table("name")` in the PG test suite becomes `class X extends db.Table("name")`, with `db` imported from test-helpers (or a locally-constructed `Database` for standalone unit tests like extractor.test). - `db.Table(name)` gets an optional per-class LocalC override so scope tests (each defining a distinct Principal shape) can override the app-wide `C` per class. - `expectSqlEqual` auto-detects the compile ctx by walking the sql tree for the first tagged Ident, falls back to the suite's `db`, falls back to pgCtx. Provenance-enforcement suite (src/provenance.test.ts, 18 tests): - Ident from dbA rejected when compiled against dbB. - Ident from dbA accepted against dbA. - Untagged `sql.ident(...)` passes any ctx (escape hatch preserved). - Column via db.Table carries the Table's database. - PG Func in SQLite ctx → throws (`upper()`). - SQLite Func in PG ctx → throws (`abs()`). - PG Op in SQLite ctx → throws (`+`). - Untagged Func/Op/UnaryOp/Cast pass any ctx. - Tagged UnaryOp/Cast reject cross-dialect. - Cross-dialect Ident smuggling caught (PG-tagged Ident inside a SQLite compile). Also: Bus's `private db` field renamed to `private conn` (was a Connection since the last commit; field name kept for smaller diff previously — cleaned up now). `npm run check` green: 29 files / 570 tests + examples/basic 6/6. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/database.ts | 8 +- src/hydrate.test.ts | 15 ++-- src/live/bus.ts | 6 +- src/live/db-live.test.ts | 7 +- src/live/events.test.ts | 5 +- src/live/extractor.test.ts | 28 ++++--- src/provenance.test.ts | 163 +++++++++++++++++++++++++++++++++++++ src/rpc.test.ts | 8 +- src/scope.test.ts | 32 ++++---- src/test-helpers.ts | 29 ++++++- 10 files changed, 247 insertions(+), 54 deletions(-) create mode 100644 src/provenance.test.ts diff --git a/src/database.ts b/src/database.ts index b82de8a..746cc8c 100644 --- a/src/database.ts +++ b/src/database.ts @@ -66,9 +66,11 @@ export class Database implements DatabaseRef { // Forwarded to codegen'd `Table(name, opts, database)` — attaches // `this` as the class's `.database` static, so every Ident it emits - // carries this Database's id. - public Table = (name: Name, opts: TableOptions = {}) => - Table(name, opts, this); + // carries this Database's id. The optional `LocalC` type parameter + // lets a class-def override the app-wide context type (used by scope + // tests where each test has its own Principal shape). + public Table = (name: Name, opts: TableOptions = {}) => + Table(name, opts, this); // Attach a driver → get a runtime Connection. Multiple `attach` calls // are allowed (test + prod, worker pools, replicas) — Connections diff --git a/src/hydrate.test.ts b/src/hydrate.test.ts index f80497d..400cf0b 100644 --- a/src/hydrate.test.ts +++ b/src/hydrate.test.ts @@ -1,13 +1,17 @@ import { describe, test, expect, expectTypeOf, beforeAll } from "vitest"; -import { typegres, sql, Table, Int8, Text, Bool, expose } from "typegres"; -import type { Connection, QueryBuilder } from "typegres"; +import { typegres, sql, Int8, Text, Bool, expose } from "typegres"; +import type { Connection, Database, QueryBuilder } from "typegres"; // End-to-end tests for conn.hydrate(): materialize query rows as class // instances with methods, then use those methods in follow-up queries. -let conn: Connection; +// Constructed at module load via typegres(); classes below reference +// db.Table so their Idents carry provenance. +const { db, conn } = await typegres({ type: "pglite" }); +// Placeholder type usage to keep the imports referenced. +const _typed: [Database, Connection] = [db, conn]; -class User extends Table("users") { +class User extends db.Table("users") { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); @@ -16,7 +20,7 @@ class User extends Table("users") { } } -class Todo extends Table("todos") { +class Todo extends db.Table("todos") { @expose() id = (Int8<1>).column({ nonNull: true, generated: true }); @@ -37,7 +41,6 @@ class Todo extends Table("todos") { } beforeAll(async () => { - ({ conn } = await typegres({ type: "pglite" })); await conn.execute(sql` CREATE TABLE users ( id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, diff --git a/src/live/bus.ts b/src/live/bus.ts index 3f72884..3f031a0 100644 --- a/src/live/bus.ts +++ b/src/live/bus.ts @@ -108,7 +108,7 @@ export class Bus { readonly #windowSize: number; constructor( - private db: Connection, + private conn: Connection, opts: BusOptions = {}, ) { this.#intervalMs = opts.intervalMs ?? 100; @@ -284,7 +284,7 @@ export class Bus { } async #readCursor(): Promise { - const r = await this.db.execute(sql`SELECT pg_current_snapshot()::text AS s`); + const r = await this.conn.execute(sql`SELECT pg_current_snapshot()::text AS s`); return parseSnapshot((r.rows as { s: string }[])[0]!.s); } @@ -299,7 +299,7 @@ export class Bus { // refined by per-row visibility against both cursors. pg_snapshot // can't bind as a typed param so cursor text round-trips through // `::pg_snapshot`. - const r = await this.db.execute(sql` + const r = await this.conn.execute(sql` SELECT xid::text AS xid, "table", before::text AS before, after::text AS after FROM ${sql.ident(EVENTS_TABLE)} WHERE xid >= pg_snapshot_xmin(${sql.param(cursorToText(prev))}::pg_snapshot) diff --git a/src/live/db-live.test.ts b/src/live/db-live.test.ts index e2a7da6..f142c76 100644 --- a/src/live/db-live.test.ts +++ b/src/live/db-live.test.ts @@ -1,8 +1,7 @@ import { test, expect, afterEach } from "vitest"; import { Int8, Text } from "../types"; import { sql } from "../builder/sql"; -import { Table } from "../table"; -import { conn, setupDb } from "../test-helpers"; +import { conn, db, setupDb } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; import { setupLiveEvents } from "./test-helpers"; setupDb(); @@ -26,7 +25,7 @@ const makeNotesTable = async () => { user_id int8 NOT NULL, body text NOT NULL )`); - return class Notes extends Table("notes", { transformer: TypegresLiveEvents.makeTransformer() }) { + return class Notes extends db.Table("notes", { transformer: TypegresLiveEvents.makeTransformer() }) { id = (Int8<1>).column({ nonNull: true, generated: true }); user_id = (Int8<1>).column({ nonNull: true }); body = (Text<1>).column({ nonNull: true }); @@ -132,7 +131,7 @@ test("join: mutation on either side triggers re-yield (literal propagates across await conn.execute(sql`INSERT INTO users (id, name) OVERRIDING SYSTEM VALUE VALUES (5, 'alice')`); const Notes = await makeNotesTable(); - class Users extends Table("users", { transformer: TypegresLiveEvents.makeTransformer() }) { + class Users extends db.Table("users", { transformer: TypegresLiveEvents.makeTransformer() }) { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); } diff --git a/src/live/events.test.ts b/src/live/events.test.ts index b5a11a9..85a4384 100644 --- a/src/live/events.test.ts +++ b/src/live/events.test.ts @@ -1,15 +1,14 @@ import { test, expect, beforeAll, afterEach } from "vitest"; import { Int8, Text } from "../types"; import { sql } from "../builder/sql"; -import { Table } from "../table"; -import { conn, setupDb } from "../test-helpers"; +import { conn, db, setupDb } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; import { setupLiveEvents } from "./test-helpers"; setupDb(); setupLiveEvents(); -class Foos extends Table("foos", { transformer: TypegresLiveEvents.makeTransformer() }) { +class Foos extends db.Table("foos", { transformer: TypegresLiveEvents.makeTransformer() }) { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); qty = (Int8<0 | 1>).column(); diff --git a/src/live/extractor.test.ts b/src/live/extractor.test.ts index 1146d07..3e6b4f8 100644 --- a/src/live/extractor.test.ts +++ b/src/live/extractor.test.ts @@ -1,17 +1,21 @@ import { test, expect } from "vitest"; import { Int8, Text } from "../types"; -import { Table } from "../table"; +import { Database } from "../database"; import { sql } from "../builder/sql"; import { expectSqlEqual } from "../test-helpers"; + +// Local metadata Database — extractor tests don't execute queries, just +// walk the tree, so no driver / conn needed. +const db = new Database({ dialect: "postgres" }); import { buildExtractor, materializePredicateSet, sortAliases, traverse } from "./extractor"; -class Users extends Table("users") { +class Users extends db.Table("users") { id = (Int8<1>).column({ nonNull: true, generated: true }); manager_id = (Int8<0 | 1>).column(); role = (Text<1>).column({ nonNull: true }); } -class Dogs extends Table("dogs") { +class Dogs extends db.Table("dogs") { id = (Int8<1>).column({ nonNull: true, generated: true }); user_id = (Int8<1>).column({ nonNull: true }); name = (Text<1>).column({ nonNull: true }); @@ -34,7 +38,7 @@ test("join chain: anchor propagates to dependent alias", () => { }); test("three-table chain: order", () => { - class Toys extends Table("toys") { + class Toys extends db.Table("toys") { id = (Int8<1>).column({ nonNull: true, generated: true }); dog_id = (Int8<1>).column({ nonNull: true }); } @@ -176,10 +180,10 @@ test("buildExtractor: multiple anchors keep their literal predicates plus join e test("materializePredicateSet: literal anchor flows through equality edge", () => { // Users WHERE id=1 JOIN Notes ON notes.user_id = users.id. // Even with no rows in `users` or `notes`, notes.user_id watched ⊇ {1}. - class Users extends Table("users") { + class Users extends db.Table("users") { id = (Int8<1>).column({ nonNull: true, generated: true }); } - class Notes extends Table("notes") { + class Notes extends db.Table("notes") { id = (Int8<1>).column({ nonNull: true, generated: true }); user_id = (Int8<1>).column({ nonNull: true }); } @@ -199,10 +203,10 @@ test("materializePredicateSet: literal anchor flows through equality edge", () = }); test("materializePredicateSet: data values propagate both directions across edge", () => { - class Users extends Table("users") { + class Users extends db.Table("users") { id = (Int8<1>).column({ nonNull: true, generated: true }); } - class Notes extends Table("notes") { + class Notes extends db.Table("notes") { user_id = (Int8<1>).column({ nonNull: true }); } const q = Users.from() @@ -231,16 +235,16 @@ test("materializePredicateSet: cross-edge merges two pre-existing groups", () => // B.c_id = C.id then forces those classes to merge — every column in // the chain ends up with the same value set. Without the merge walk, // C.id would orphan from the survivor. - class A extends Table("a") { + class A extends db.Table("a") { id = (Int8<1>).column({ nonNull: true, generated: true }); b_id = (Int8<1>).column({ nonNull: true }); c_id = (Int8<1>).column({ nonNull: true }); } - class B extends Table("b") { + class B extends db.Table("b") { id = (Int8<1>).column({ nonNull: true, generated: true }); c_id = (Int8<1>).column({ nonNull: true }); } - class C extends Table("c") { + class C extends db.Table("c") { id = (Int8<1>).column({ nonNull: true, generated: true }); } const q = A.from() @@ -271,7 +275,7 @@ test("materializePredicateSet: cross-edge merges two pre-existing groups", () => }); test("materializePredicateSet: drops null values", () => { - class Users extends Table("users") { + class Users extends db.Table("users") { id = (Int8<1>).column({ nonNull: true, generated: true }); role = (Text<1>).column({ nonNull: true }); } diff --git a/src/provenance.test.ts b/src/provenance.test.ts new file mode 100644 index 0000000..b486e20 --- /dev/null +++ b/src/provenance.test.ts @@ -0,0 +1,163 @@ +// Provenance enforcement tests — the security property from ISSUES.md #16. +// +// Each tagged Sql AST node checks its provenance against the compile +// ctx at bind time: +// - Ident: this.database.id must match ctx.database.id +// - Func / Op / UnaryOp / Cast / Srf: this.dialect must match ctx.database.dialect +// +// This suite is unit-only (no driver / no execute); everything is +// exercised via `compile(sql, { database })` directly. +import { test, expect, describe } from "vitest"; +import { Database } from "./database"; +import { compile, sql, Func, Op, UnaryOp, Cast, Raw, Param } from "./builder/sql"; +import { Int4, Text } from "./types"; +import { Integer } from "./types/sqlite"; + +// Two same-dialect databases → distinct provenance identities. +const dbA = new Database({ dialect: "postgres", name: "dbA" }); +const dbB = new Database({ dialect: "postgres", name: "dbB" }); +// Different-dialect databases for Func/Op/Cast/Srf dialect checks. +const pgDb = new Database({ dialect: "postgres", name: "pg" }); +const sqliteDb = new Database({ dialect: "sqlite", name: "sqlite" }); + +describe("Ident provenance", () => { + test("Ident from db A rejected when compiled against db B", () => { + class UsersA extends dbA.Table("users") {} + const q = sql`SELECT * FROM ${UsersA.bind()}`; + expect(() => compile(q, { database: dbB })).toThrow( + /Ident 'users' provenance mismatch/, + ); + }); + + test("Ident from db A accepted when compiled against db A", () => { + class UsersA extends dbA.Table("users") {} + const q = sql`SELECT * FROM ${UsersA.bind()}`; + expect(() => compile(q, { database: dbA })).not.toThrow(); + }); + + test("untagged Ident (raw sql.ident) passes any ctx — escape hatch", () => { + // Server-authored raw templates that don't route through a db can + // still compile against either database (no provenance to check). + const q = sql`SELECT ${sql.ident("foo")} FROM t`; + expect(() => compile(q, { database: dbA })).not.toThrow(); + expect(() => compile(q, { database: dbB })).not.toThrow(); + expect(() => compile(q, { database: sqliteDb })).not.toThrow(); + }); + + test("Column via db.Table carries its Table's database", () => { + class Users extends dbA.Table("users") { + id = Int4.column({ nonNull: true }); + } + const q = Users.from().where(({ users }) => users.id.eq(Int4.from(1))); + expect(() => compile(q, { database: dbB })).toThrow( + /provenance mismatch/, + ); + expect(() => compile(q, { database: dbA })).not.toThrow(); + }); +}); + +describe("Func dialect", () => { + test("PG Func rejected in SQLite ctx", () => { + // `upper()` codegen'd from PG carries dialect: "postgres". + const q = sql`SELECT ${Text.from("x").upper().toSql()}`; + expect(() => compile(q, { database: sqliteDb })).toThrow( + /Func 'upper'.* dialect 'postgres'.* against 'sqlite'/, + ); + }); + + test("PG Func accepted in PG ctx", () => { + const q = sql`SELECT ${Text.from("x").upper().toSql()}`; + expect(() => compile(q, { database: pgDb })).not.toThrow(); + }); + + test("SQLite Func rejected in PG ctx", () => { + // `Integer.abs()` codegen'd from SQLite carries dialect: "sqlite". + const q = sql`SELECT ${Integer.from(1).abs().toSql()}`; + expect(() => compile(q, { database: pgDb })).toThrow( + /Func 'abs'.* dialect 'sqlite'.* against 'postgres'/, + ); + }); + + test("SQLite Func accepted in SQLite ctx", () => { + const q = sql`SELECT ${Integer.from(1).abs().toSql()}`; + expect(() => compile(q, { database: sqliteDb })).not.toThrow(); + }); + + test("untagged Func passes any ctx — escape hatch", () => { + const q = new Func("my_fn", []); // no dialect arg + expect(() => compile(q, { database: pgDb })).not.toThrow(); + expect(() => compile(q, { database: sqliteDb })).not.toThrow(); + }); +}); + +describe("Op dialect", () => { + test("PG Op rejected in SQLite ctx", () => { + // Int4["+"] is codegen'd from PG; the emitted Op node carries + // dialect: "postgres". + const q = sql`SELECT ${Int4.from(1)["+"](Int4.from(2)).toSql()}`; + expect(() => compile(q, { database: sqliteDb })).toThrow( + /Op '\+'.* dialect 'postgres'.* against 'sqlite'/, + ); + }); + + test("PG Op accepted in PG ctx", () => { + const q = sql`SELECT ${Int4.from(1)["+"](Int4.from(2)).toSql()}`; + expect(() => compile(q, { database: pgDb })).not.toThrow(); + }); + + test("untagged Op passes any ctx", () => { + const q = new Op(new Raw("+"), new Param(1), new Param(2)); // no dialect + expect(() => compile(q, { database: pgDb })).not.toThrow(); + expect(() => compile(q, { database: sqliteDb })).not.toThrow(); + }); +}); + +describe("UnaryOp dialect", () => { + test("untagged UnaryOp passes any ctx", () => { + const q = new UnaryOp(new Raw("NOT"), new Param(true)); + expect(() => compile(q, { database: pgDb })).not.toThrow(); + expect(() => compile(q, { database: sqliteDb })).not.toThrow(); + }); + + test("tagged UnaryOp rejects cross-dialect", () => { + const q = new UnaryOp(new Raw("NOT"), new Param(true), "postgres"); + expect(() => compile(q, { database: sqliteDb })).toThrow( + /UnaryOp.* dialect 'postgres'.* against 'sqlite'/, + ); + expect(() => compile(q, { database: pgDb })).not.toThrow(); + }); +}); + +describe("Cast dialect", () => { + test("PG Cast rejected in SQLite ctx", () => { + // `Int4.from(5)` produces a TypedParam → Cast tagged postgres. + const q = sql`SELECT ${Int4.from(5).toSql()}`; + expect(() => compile(q, { database: sqliteDb })).toThrow( + /Cast.* dialect 'postgres'.* against 'sqlite'/, + ); + }); + + test("SQLite Cast rejected in PG ctx", () => { + const q = sql`SELECT ${Integer.from(5).toSql()}`; + expect(() => compile(q, { database: pgDb })).toThrow( + /Cast.* dialect 'sqlite'.* against 'postgres'/, + ); + }); + + test("untagged Cast passes any ctx", () => { + const q = new Cast(new Param(1), sql`int4`); + expect(() => compile(q, { database: pgDb })).not.toThrow(); + expect(() => compile(q, { database: sqliteDb })).not.toThrow(); + }); +}); + +describe("cross-dialect Ident smuggling", () => { + test("A PG-tagged Ident spliced into a SQLite query throws at compile", () => { + class PgUsers extends pgDb.Table("users") {} + // Attacker angle: build a SQLite query and splice in a PG-provenance Ident. + const q = sql`SELECT ${PgUsers.bind()} FROM t`; + expect(() => compile(q, { database: sqliteDb })).toThrow( + /provenance mismatch/, + ); + }); +}); diff --git a/src/rpc.test.ts b/src/rpc.test.ts index 12be8fe..60796e5 100644 --- a/src/rpc.test.ts +++ b/src/rpc.test.ts @@ -1,9 +1,9 @@ import { describe, test, expect, expectTypeOf } from "vitest"; -import { sql, Table, Int8, Text, Record, Anyarray } from "typegres"; +import { sql, Int8, Text, Record, Anyarray } from "typegres"; import type { Connection } from "typegres"; import { expose } from "./exoeval/tool"; import { RpcClient, inMemoryChannel } from "./exoeval/rpc"; -import { setupDb, withinTransaction } from "./test-helpers"; +import { setupDb, withinTransaction, db } from "./test-helpers"; setupDb(); // End-to-end: typegres queries authored client-side, shipped over the @@ -26,7 +26,7 @@ setupDb(); // QueryBuilder method is @expose-decorated, so the builder composes over // the wire directly — no host-side wrapper class needed. -class Users extends Table("users") { +class Users extends db.Table("users") { @expose() id = (Int8<1>).column({ nonNull: true, generated: true }); @@ -196,7 +196,7 @@ describe("typegres over exoeval rpc — in-memory", () => { await tx.execute(sql`INSERT INTO secrets (public_name, password) VALUES ('alice', 'hunter2')`); }; - class Secrets extends Table("secrets") { + class Secrets extends db.Table("secrets") { @expose() id = (Int8<1>).column({ nonNull: true, generated: true }); @expose() public_name = (Text<1>).column({ nonNull: true }); // Intentionally NOT @expose'd: diff --git a/src/scope.test.ts b/src/scope.test.ts index 9300bf1..4a8ec21 100644 --- a/src/scope.test.ts +++ b/src/scope.test.ts @@ -1,7 +1,7 @@ import { describe, test, expect, expectTypeOf } from "vitest"; -import { sql, Int8, Text, Table } from "."; +import { sql, Int8, Text } from "."; import { compile } from "./builder/sql"; -import { setupDb, withinTransaction } from "./test-helpers"; +import { setupDb, withinTransaction, db } from "./test-helpers"; setupDb(); // Spike: `Table.scope(ctx)` carries an arbitrary tag through the chain @@ -15,7 +15,7 @@ describe("Table.scope(ctx)", () => { await tx.execute(sql`INSERT INTO foos (name) VALUES ('a'), ('b')`); type Principal = { user: string; role: string }; - class Foos extends Table<"foos", Principal>("foos") { + class Foos extends db.Table<"foos", Principal>("foos") { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); } @@ -36,7 +36,7 @@ describe("Table.scope(ctx)", () => { await tx.execute(sql`CREATE TABLE bars (id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text NOT NULL)`); await tx.execute(sql`INSERT INTO bars (name) VALUES ('x')`); - class Bars extends Table("bars") { + class Bars extends db.Table("bars") { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); } @@ -51,7 +51,7 @@ describe("Table.scope(ctx)", () => { await tx.execute(sql`CREATE TABLE bazs (id int8 GENERATED ALWAYS AS IDENTITY PRIMARY KEY)`); await tx.execute(sql`INSERT INTO bazs DEFAULT VALUES`); - class Bazs extends Table<"bazs", string>("bazs") { + class Bazs extends db.Table<"bazs", string>("bazs") { id = (Int8<1>).column({ nonNull: true, generated: true }); } @@ -61,10 +61,12 @@ describe("Table.scope(ctx)", () => { }); test("emitted SQL is identical for Foos.from() and Foos.scope(...)", () => { - class Things extends Table<"things", { p: number }>("things") { + class Things extends db.Table<"things", { p: number }>("things") { id = (Int8<1>).column({ nonNull: true, generated: true }); } - expect(compile(Things.scope({ p: 1 }) as any).text).toBe(compile(Things.from() as any).text); + const ctx = { database: db }; + expect(compile(Things.scope({ p: 1 }) as any, ctx).text) + .toBe(compile(Things.from() as any, ctx).text); }); test("a column literally named 'context' does not collide with the scope tag", async () => { @@ -76,7 +78,7 @@ describe("Table.scope(ctx)", () => { await tx.execute(sql`INSERT INTO notes (context) VALUES ('hello world')`); type P = { user: string }; - class Notes extends Table<"notes", P>("notes") { + class Notes extends db.Table<"notes", P>("notes") { id = (Int8<1>).column({ nonNull: true, generated: true }); // Column literally named "context" — would collide with an // *instance* getter, but `static context` lives in a separate @@ -96,7 +98,7 @@ describe("Table.scope(ctx)", () => { test("Table pins context type — scope() narrows, contextOf() returns C", () => { type Principal = { user: string; role: "admin" | "viewer" }; - class Resources extends Table<"resources", Principal>("resources") { + class Resources extends db.Table<"resources", Principal>("resources") { id = (Int8<1>).column({ nonNull: true, generated: true }); } @@ -129,11 +131,11 @@ describe("Table.scope(ctx)", () => { await tx.execute(sql`INSERT INTO books (title, author_id) VALUES ('Foundation', 1)`); type P = { user: string }; - class Authors extends Table<"authors", P>("authors") { + class Authors extends db.Table<"authors", P>("authors") { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); } - class Books extends Table<"books", P>("books") { + class Books extends db.Table<"books", P>("books") { id = (Int8<1>).column({ nonNull: true, generated: true }); title = (Text<1>).column({ nonNull: true }); author_id = (Int8<1>).column({ nonNull: true }); @@ -170,11 +172,11 @@ describe("Table.scope(ctx)", () => { await tx.execute(sql`INSERT INTO bks (title, auth_id) VALUES ('Foundation', 1)`); type P = { user: string }; - class Pubs extends Table<"pubs", P>("pubs") { + class Pubs extends db.Table<"pubs", P>("pubs") { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); } - class Auths extends Table<"auths", P>("auths") { + class Auths extends db.Table<"auths", P>("auths") { id = (Int8<1>).column({ nonNull: true, generated: true }); name = (Text<1>).column({ nonNull: true }); pub_id = (Int8<1>).column({ nonNull: true }); @@ -184,7 +186,7 @@ describe("Table.scope(ctx)", () => { .cardinality("one"); } } - class Bks extends Table<"bks", P>("bks") { + class Bks extends db.Table<"bks", P>("bks") { id = (Int8<1>).column({ nonNull: true, generated: true }); title = (Text<1>).column({ nonNull: true }); auth_id = (Int8<1>).column({ nonNull: true }); @@ -217,7 +219,7 @@ describe("Table.scope(ctx)", () => { await tx.execute(sql`INSERT INTO widgets DEFAULT VALUES`); type P = { user: string }; - class Widgets extends Table<"widgets", P>("widgets") { + class Widgets extends db.Table<"widgets", P>("widgets") { id = (Int8<1>).column({ nonNull: true, generated: true }); whoCalledMe(): string { diff --git a/src/test-helpers.ts b/src/test-helpers.ts index 4dc8c32..19746dc 100644 --- a/src/test-helpers.ts +++ b/src/test-helpers.ts @@ -3,7 +3,8 @@ import { PgDriver } from "./driver"; import type { Driver } from "./driver"; import { requireDatabaseUrl } from "./pg"; import { Database } from "./database"; -import { compile, type Sql, sql } from "./builder/sql"; +import { compile, Ident, sql, type DatabaseRef } from "./builder/sql"; +import type { Sql } from "./builder/sql"; import type { TransactionIsolation , Connection } from "./database"; export let driver: Driver; @@ -64,12 +65,32 @@ export const withinTransaction = async ( // // Whitespace is collapsed and trimmed adjacent to () and , so the expected // template can be freely indented across lines / aligned with extra spaces. -export const expectSqlEqual = (actual: Sql, expected: Sql): void => { +// Walk a Sql tree and return the first tagged Ident's database. Used by +// expectSqlEqual to derive its compile ctx from the query itself so +// tests don't have to thread a `db` variable through every call. +const findDatabase = (root: Sql): DatabaseRef | undefined => { + const stack: Sql[] = [root]; + while (stack.length) { + const n = stack.pop()!; + if (n instanceof Ident && n.database) {return n.database;} + for (const c of n.children()) {stack.push(c);} + } + return undefined; +}; + +export const expectSqlEqual = (actual: Sql, expected: Sql, database?: DatabaseRef): void => { const normalize = (s: string) => s.replace(/\s+/g, " ").replace(/\s*([(),])\s*/g, "$1").trim(); - const a = compile(actual); - const e = compile(expected); + // Resolution order for the compile ctx: + // 1. explicit caller-supplied `database` + // 2. any tagged Ident found in the actual tree (auto-detect) + // 3. suite-wide `db` (setupDb tests) + // 4. pgCtx sentinel (unit tests before setupDb) + const resolved = database ?? findDatabase(actual) ?? db; + const ctx = resolved ? { database: resolved } : undefined; + const a = compile(actual, ctx); + const e = compile(expected, ctx); expect(normalize(a.text)).toEqual(normalize(e.text)); expect(a.values).toEqual(e.values); }; From 66734ae7fe4282388ded6ed7f2b2a7314f0e7f30 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:27:12 -0700 Subject: [PATCH 20/33] feat(provenance): remove sql.ident from public helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit External code can no longer construct untagged Idents via \`sql.ident("x")\`. The only public path is \`db.scopedIdent(name)\`, which yields a provenance-checked Ident. Internal library callers (live/events, live/extractor, live/bus, live/events-ddl, builder/query output labels, builder/query AS clause column names) continue to use \`new Ident(name)\` directly — the class constructor still allows a \`database?\` optional for these schema-agnostic local-scope uses (CTE aliases, output labels, hardcoded event-table columns). The library-internal path is unreachable from external code: - \`sql\` is not exposed to exoeval callbacks (attackers over RPC can't even reference \`sql.ident\`). - \`Ident\` is exported from builder/sql but requires import; external users don't touch it. Callsite updates: - test-helpers: \`sql.ident(schema)\` → \`db.scopedIdent(schema)\` - postgres/index.test: \`sql.ident("result")\` → \`exec.database.scopedIdent(...)\` - builder/sql.test: unit test shim that constructs \`new Ident(name)\` directly — kept for SQL emission testing without a real Database. - provenance.test: added test that \`sql.ident\` is undefined on the public helper; kept the library-internal \`new Ident(name)\` test as documentation. 571 tests + 6 examples green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/query.ts | 4 ++-- src/builder/sql.test.ts | 18 +++++++++++------- src/builder/sql.ts | 21 +++++++++++++++------ src/live/bus.ts | 4 ++-- src/live/events-ddl.ts | 6 +++--- src/live/events.ts | 24 ++++++++++++------------ src/live/extractor.ts | 6 +++--- src/provenance.test.ts | 23 ++++++++++++++++++----- src/test-helpers.ts | 6 +++--- src/types/postgres/index.test.ts | 22 +++++++++++----------- 10 files changed, 80 insertions(+), 54 deletions(-) diff --git a/src/builder/query.ts b/src/builder/query.ts index 47abdc8..cdb5d28 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -24,7 +24,7 @@ export const compileSelectList = (output: RowType, omitAliases = false): Sql => Object.entries(output).flatMap(([k, v]) => v instanceof SqlValue ? [ omitAliases ? v.toSql() : - sql`${v.toSql()} as ${sql.ident(k)}`] : [], + sql`${v.toSql()} as ${new Ident(k)}`] : [], ), ); }; @@ -599,7 +599,7 @@ export class FinalizedQuery extends Sql { const alias = t.alias; const sourceSql = t.source.bind(ctx); const asClause = t.source.emitColumnNamesWithAlias - ? sql`AS ${alias}(${sql.join(Object.keys(t.source.rowType()).map((col) => sql.ident(col)))})` + ? sql`AS ${alias}(${sql.join(Object.keys(t.source.rowType()).map((col) => new Ident(col)))})` : sql`AS ${alias}`; if (t.type === "from") { tableSql.push(sql`FROM ${sourceSql} ${asClause}`); diff --git a/src/builder/sql.test.ts b/src/builder/sql.test.ts index 48a9da3..6f1296b 100644 --- a/src/builder/sql.test.ts +++ b/src/builder/sql.test.ts @@ -1,5 +1,9 @@ import { test, expect } from "vitest"; -import { sql, compile, pgCtx, sqliteCtx } from "./sql"; +import { sql, compile, pgCtx, sqliteCtx, Ident } from "./sql"; +// Test-only shim: these unit tests exercise SQL emission without a real +// Database. Untagged Idents (constructed via the library-internal `new +// Ident(name)` path) still pass through — a wrapper for readability. +const $ident = (name: string) => new Ident(name); test("param compiles with pg style", () => { const q = sql`SELECT ${1}, ${2}`; @@ -12,24 +16,24 @@ test("param compiles with sqlite style", () => { }); test("ident in tagged template", () => { - const col = sql.ident("user_name"); - const q = sql`SELECT ${col} FROM ${sql.ident("users")}`; + const col = $ident("user_name"); + const q = sql`SELECT ${col} FROM ${$ident("users")}`; expect(compile(q, pgCtx)).toEqual({ text: 'SELECT "user_name" FROM "users"', values: [] }); }); test("ident escapes double quotes", () => { - const q = sql.ident('foo"bar'); + const q = $ident('foo"bar'); expect(compile(q, pgCtx)).toEqual({ text: '"foo""bar"', values: [] }); }); test("join", () => { - const cols = [sql.ident("a"), sql.ident("b"), sql.ident("c")]; + const cols = [$ident("a"), $ident("b"), $ident("c")]; const q = sql`SELECT ${sql.join(cols)}`; expect(compile(q, pgCtx)).toEqual({ text: 'SELECT "a", "b", "c"', values: [] }); }); test("mixed params and idents", () => { - const q = sql`SELECT ${sql.ident("name")} FROM ${sql.ident("users")} WHERE ${sql.ident("id")} = ${42}`; + const q = sql`SELECT ${$ident("name")} FROM ${$ident("users")} WHERE ${$ident("id")} = ${42}`; expect(compile(q, pgCtx)).toEqual({ text: 'SELECT "name" FROM "users" WHERE "id" = $1', values: [42], @@ -37,6 +41,6 @@ test("mixed params and idents", () => { }); test("raw sql", () => { - const q = sql`SELECT ${sql.raw("COUNT(*)")} FROM ${sql.ident("users")}`; + const q = sql`SELECT ${sql.raw("COUNT(*)")} FROM ${$ident("users")}`; expect(compile(q, pgCtx)).toEqual({ text: 'SELECT COUNT(*) FROM "users"', values: [] }); }); diff --git a/src/builder/sql.ts b/src/builder/sql.ts index 90ed6ed..de8b6f0 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -107,11 +107,18 @@ export class Raw extends Sql { } export class Ident extends Sql { - // `database` is optional to keep the escape hatch alive: raw templates - // (`sql.ident("x")`) construct untagged Idents that pass through - // unchecked — trusted server-authored SQL. Table classes attached via - // `db.Table(name)` propagate their database to their emitted Idents; - // those are checked against ctx.database at bind time. + // Public API: the only way to construct a schema-referencing Ident is + // `db.scopedIdent(name)` — free-standing `sql.ident(...)` has been + // removed from the public helpers. + // + // `database` is technically optional so library-internal code + // (TypegresLiveEvents, CTE-alias names in live/events.ts, output + // labels in query.ts) can construct untagged Idents that pass any + // ctx. External users can't reach this constructor: `new Ident(...)` + // requires importing the class directly and typegres barrels only + // re-export from public paths. Attacker code over RPC has no access + // to `sql` or `Ident` at all — the escape hatch is unreachable + // outside the library. constructor(readonly name: string, readonly database?: DatabaseRef) { super(); } bind(ctx: CompileContext): BoundSql { if (this.database && this.database.id !== ctx.database.id) { @@ -374,7 +381,9 @@ function _sql(strings: TemplateStringsArray, ...exprs: unknown[]): BoundSql { _sql.param = (value: unknown): BoundSql => new Param(value); // Provided for clients, not to be used internally (internal code should use literal templates instead of `raw`.) _sql.raw = (s: string): BoundSql => new Raw(s); -_sql.ident = (name: string): Ident => new Ident(name); +// Untagged Ident construction removed. Callers who need a schema- +// referencing identifier go through `db.scopedIdent(name)`; the Ident +// class itself is exported but requires a DatabaseRef. _sql.column = (table: Alias, name: Ident): Sql => new Column(table, name); _sql.unbound = (): Sql => new Unbound(); _sql.withScope = (aliases: readonly Alias[], child: Sql): BoundSql => new WithScope(aliases, child); diff --git a/src/live/bus.ts b/src/live/bus.ts index 3f031a0..3c06d0d 100644 --- a/src/live/bus.ts +++ b/src/live/bus.ts @@ -1,5 +1,5 @@ import type { Connection } from "../database"; -import { sql } from "../builder/sql"; +import { sql, Ident } from "../builder/sql"; import { type Cursor, parseSnapshot, visible } from "./snapshot"; import type { PredicateSet } from "./extractor"; @@ -301,7 +301,7 @@ export class Bus { // `::pg_snapshot`. const r = await this.conn.execute(sql` SELECT xid::text AS xid, "table", before::text AS before, after::text AS after - FROM ${sql.ident(EVENTS_TABLE)} + FROM ${new Ident(EVENTS_TABLE)} WHERE xid >= pg_snapshot_xmin(${sql.param(cursorToText(prev))}::pg_snapshot) AND pg_visible_in_snapshot(xid, ${sql.param(cursorToText(cur))}::pg_snapshot) AND NOT pg_visible_in_snapshot(xid, ${sql.param(cursorToText(prev))}::pg_snapshot) diff --git a/src/live/events-ddl.ts b/src/live/events-ddl.ts index 0bda699..8a4b052 100644 --- a/src/live/events-ddl.ts +++ b/src/live/events-ddl.ts @@ -4,14 +4,14 @@ // insert → database) — that cycle bit us at the chunk boundary // when vite bundled the site (TDZ during dynamic import). -import { sql, type Sql } from "../builder/sql"; +import { sql, Ident, type Sql } from "../builder/sql"; export const EVENTS_TABLE_NAME = "_typegres_live_events"; export const eventsTableSqlStatements = (): Sql[] => { return [ sql` - CREATE TABLE IF NOT EXISTS ${sql.ident(EVENTS_TABLE_NAME)} ( + CREATE TABLE IF NOT EXISTS ${new Ident(EVENTS_TABLE_NAME)} ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, xid xid8 NOT NULL, -- before/after are jsonb objects keyed by column name with @@ -27,6 +27,6 @@ export const eventsTableSqlStatements = (): Sql[] => { inserted_at timestamptz NOT NULL DEFAULT clock_timestamp() ) `, - sql`CREATE INDEX IF NOT EXISTS ${sql.ident(`${EVENTS_TABLE_NAME}_xid_idx`)} ON ${sql.ident(EVENTS_TABLE_NAME)} (xid)`, + sql`CREATE INDEX IF NOT EXISTS ${new Ident(`${EVENTS_TABLE_NAME}_xid_idx`)} ON ${new Ident(EVENTS_TABLE_NAME)} (xid)`, ]; }; diff --git a/src/live/events.ts b/src/live/events.ts index 550e785..511bb1a 100644 --- a/src/live/events.ts +++ b/src/live/events.ts @@ -1,6 +1,6 @@ import { Any, Int8, Jsonb, Text, Timestamptz, Xid8 } from "../types"; import { Table, type QueryTransformer } from "../table"; -import { sql, type Sql } from "../builder/sql"; +import { sql, Ident, type Sql } from "../builder/sql"; import type { InsertBuilder } from "../builder/insert"; import type { DeleteBuilder } from "../builder/delete"; import type { UpdateBuilder} from "../builder/update"; @@ -71,7 +71,7 @@ const liveAfterReturning = // enough — Database.execute discards rows since rowType() is undefined. const userReturningProjection = (returning: RowType, ...internalKeys: readonly string[]): Sql => { const userKeys = Object.keys(returning).filter((k) => !internalKeys.includes(k)); - return userKeys.length > 0 ? sql.join(userKeys.map((k) => sql.ident(k))) : sql`1`; + return userKeys.length > 0 ? sql.join(userKeys.map((k) => new Ident(k))) : sql`1`; }; // All internal CTE names + RETURNING aliases use the __typegres_ prefix so @@ -86,7 +86,7 @@ const T_LIVE_AFTER = "__typegres_live_after"; // `INSERT INTO _typegres_live_events (xid, "table", before, after) SELECT ... FROM __typegres_cte`. // Used by both the insert/delete and update wraps. const eventsInsertCte = (tableName: string, before: Sql, after: Sql): Sql => - sql`INSERT INTO ${sql.ident(TypegresLiveEvents.tableName)} (${sql.ident("xid")}, ${sql.ident("table")}, ${sql.ident("before")}, ${sql.ident("after")}) SELECT pg_current_xact_id(), ${sql.param(tableName)}::text, ${before}, ${after} FROM ${sql.ident(T_CTE)}`; + sql`INSERT INTO ${new Ident(TypegresLiveEvents.tableName)} (${new Ident("xid")}, ${new Ident("table")}, ${new Ident("before")}, ${new Ident("after")}) SELECT pg_current_xact_id(), ${sql.param(tableName)}::text, ${before}, ${after} FROM ${new Ident(T_CTE)}`; // Wrap an INSERT or DELETE in the events-emitting CTE chain. The two ops // are mirror images — INSERT captures the post-image as `after`, DELETE @@ -110,11 +110,11 @@ const wrapInsertOrDelete = ( .returningMerge(liveAfterReturning(tableName, side)) .finalize(); - const beforeRef = side === "before" ? sql.ident(liveKey) : sql`NULL::jsonb`; - const afterRef = side === "after" ? sql.ident(liveKey) : sql`NULL::jsonb`; + const beforeRef = side === "before" ? new Ident(liveKey) : sql`NULL::jsonb`; + const afterRef = side === "after" ? new Ident(liveKey) : sql`NULL::jsonb`; const events = eventsInsertCte(tableName, beforeRef, afterRef); const projection = userReturningProjection(innerFinalized.opts.returning ?? {}, liveKey); - return sql`WITH ${sql.ident(T_CTE)} AS (${innerFinalized}), ${sql.ident(T_EVENTS)} AS (${events}) SELECT ${projection} FROM ${sql.ident(T_CTE)}`; + return sql`WITH ${new Ident(T_CTE)} AS (${innerFinalized}), ${new Ident(T_EVENTS)} AS (${events}) SELECT ${projection} FROM ${new Ident(T_CTE)}`; }; // Wrap an UPDATE with ctid-paired before/after capture: @@ -147,7 +147,7 @@ const wrapUpdate = (builder: UpdateBuilder): Sql => { const tableInstance = (ns as { [k: string]: object })[tableName] as { [c: string]: Any }; return { [T_LIVE_BEFORE]: Jsonb.from( - buildLiveJsonb(tableInstance, (c) => sql`${sql.ident(T_BEFORE)}.${sql.ident(c)}::text`), + buildLiveJsonb(tableInstance, (c) => sql`${new Ident(T_BEFORE)}.${new Ident(c)}::text`), ), [T_LIVE_AFTER]: Jsonb.from(buildLiveJsonb(tableInstance)), }; @@ -164,15 +164,15 @@ const wrapUpdate = (builder: UpdateBuilder): Sql => { // before-CTE `FOR UPDATE` snapshot, so emit `WHERE TRUE` explicitly // — always PG here since live is PG-only. const whereClause = where ? where.toSql() : sql`TRUE`; - const beforeCte = sql`SELECT *, ctid FROM ${sql.ident(tableName)} AS ${alias} WHERE ${whereClause} FOR UPDATE`; - const ctidJoin = sql`${sql.column(alias, sql.ident("ctid"))} = ${sql.ident(T_BEFORE)}.${sql.ident("ctid")}`; - const updateCte = sql`UPDATE ${sql.ident(tableName)} AS ${alias} SET ${sql.join(compileSetClauses(instance, setRow))} FROM ${sql.ident(T_BEFORE)} WHERE ${ctidJoin} RETURNING ${compileSelectList(returning)}`; + const beforeCte = sql`SELECT *, ctid FROM ${new Ident(tableName)} AS ${alias} WHERE ${whereClause} FOR UPDATE`; + const ctidJoin = sql`${sql.column(alias, new Ident("ctid"))} = ${new Ident(T_BEFORE)}.${new Ident("ctid")}`; + const updateCte = sql`UPDATE ${new Ident(tableName)} AS ${alias} SET ${sql.join(compileSetClauses(instance, setRow))} FROM ${new Ident(T_BEFORE)} WHERE ${ctidJoin} RETURNING ${compileSelectList(returning)}`; - const events = eventsInsertCte(tableName, sql.ident(T_LIVE_BEFORE), sql.ident(T_LIVE_AFTER)); + const events = eventsInsertCte(tableName, new Ident(T_LIVE_BEFORE), new Ident(T_LIVE_AFTER)); const projection = userReturningProjection(returning ?? {}, T_LIVE_BEFORE, T_LIVE_AFTER); return sql.withScope( [alias], - sql`WITH ${sql.ident(T_BEFORE)} AS (${beforeCte}), ${sql.ident(T_CTE)} AS (${updateCte}), ${sql.ident(T_EVENTS)} AS (${events}) SELECT ${projection} FROM ${sql.ident(T_CTE)}`, + sql`WITH ${new Ident(T_BEFORE)} AS (${beforeCte}), ${new Ident(T_CTE)} AS (${updateCte}), ${new Ident(T_EVENTS)} AS (${events}) SELECT ${projection} FROM ${new Ident(T_CTE)}`, ); }; diff --git a/src/live/extractor.ts b/src/live/extractor.ts index 9a27cfb..888ba77 100644 --- a/src/live/extractor.ts +++ b/src/live/extractor.ts @@ -1,6 +1,6 @@ import type { Connection } from "../database"; import { FinalizedQuery, type QueryBuilder, type RowType, type RowTypeToTsType } from "../builder/query"; -import { type Alias, Column, Op, type Raw, type Sql, sql, TypedParam } from "../builder/sql"; +import { type Alias, Column, Ident, Op, type Raw, type Sql, sql, TypedParam } from "../builder/sql"; import { type TableBase, isTableClass } from "../table"; type Table = typeof TableBase; @@ -203,8 +203,8 @@ export const buildExtractor = (specs: CteSpec[]): Sql => { const uniqueColumnNames = [...new Set(spec.predicates.map((p) => p.col.name.name))]; const body = sql.join( [ - sql`SELECT ${sql.join(uniqueColumnNames.map((c) => sql.ident(c)))}`, - sql`FROM ${sql.ident(spec.tableName)} AS ${spec.alias}`, + sql`SELECT ${sql.join(uniqueColumnNames.map((c) => new Ident(c)))}`, + sql`FROM ${new Ident(spec.tableName)} AS ${spec.alias}`, whereClauses.length > 0 && sql`WHERE ${sql.join(whereClauses, sql` AND `)}`, ].filter((x) => x !== false), sql` `, diff --git a/src/provenance.test.ts b/src/provenance.test.ts index b486e20..70b1d93 100644 --- a/src/provenance.test.ts +++ b/src/provenance.test.ts @@ -9,7 +9,7 @@ // exercised via `compile(sql, { database })` directly. import { test, expect, describe } from "vitest"; import { Database } from "./database"; -import { compile, sql, Func, Op, UnaryOp, Cast, Raw, Param } from "./builder/sql"; +import { compile, sql, Ident, Func, Op, UnaryOp, Cast, Raw, Param } from "./builder/sql"; import { Int4, Text } from "./types"; import { Integer } from "./types/sqlite"; @@ -35,10 +35,23 @@ describe("Ident provenance", () => { expect(() => compile(q, { database: dbA })).not.toThrow(); }); - test("untagged Ident (raw sql.ident) passes any ctx — escape hatch", () => { - // Server-authored raw templates that don't route through a db can - // still compile against either database (no provenance to check). - const q = sql`SELECT ${sql.ident("foo")} FROM t`; + test("`sql.ident` is not on the public helper (escape hatch closed)", () => { + // Free-standing `sql.ident(...)` used to construct untagged Idents + // that passed any ctx. Removed from the public helper — the only + // API path is `db.scopedIdent(name)`. Library-internal code can + // still construct untagged Idents via `new Ident(name)` but that + // isn't reachable from external code (and is definitely not + // reachable from exoeval callbacks — `sql` is not exposed on the + // wire). + expect((sql as unknown as { ident?: unknown }).ident).toBeUndefined(); + }); + + test("library-internal untagged Ident (new Ident(name)) still passes any ctx", () => { + // The library uses this pattern for CTE-alias names, output labels, + // and other local-scope identifiers where no schema is referenced. + // Verified here so future refactors that tighten Ident construction + // don't silently break the internal use case. + const q = sql`SELECT ${new Ident("foo")} FROM t`; expect(() => compile(q, { database: dbA })).not.toThrow(); expect(() => compile(q, { database: dbB })).not.toThrow(); expect(() => compile(q, { database: sqliteDb })).not.toThrow(); diff --git a/src/test-helpers.ts b/src/test-helpers.ts index 19746dc..9ad7523 100644 --- a/src/test-helpers.ts +++ b/src/test-helpers.ts @@ -29,12 +29,12 @@ export const setupDb = (): void => { options: `-csearch_path=${schema}`, }); conn = db.attach(driver); - await conn.execute(sql`DROP SCHEMA IF EXISTS ${sql.ident(schema)} CASCADE`); - await conn.execute(sql`CREATE SCHEMA ${sql.ident(schema)}`); + await conn.execute(sql`DROP SCHEMA IF EXISTS ${db.scopedIdent(schema)} CASCADE`); + await conn.execute(sql`CREATE SCHEMA ${db.scopedIdent(schema)}`); }); afterAll(async () => { - await conn.execute(sql`DROP SCHEMA IF EXISTS ${sql.ident(schema)} CASCADE`); + await conn.execute(sql`DROP SCHEMA IF EXISTS ${db.scopedIdent(schema)} CASCADE`); await conn.close(); }); }; diff --git a/src/types/postgres/index.test.ts b/src/types/postgres/index.test.ts index 430ef21..d7cb23e 100644 --- a/src/types/postgres/index.test.ts +++ b/src/types/postgres/index.test.ts @@ -173,37 +173,37 @@ test("chained operations", () => { test("e2e: integer addition (raw strings)", async () => { const expr = Int4.from(1)["+"](Int4.from(2)); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("result")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("result")}`); expect(result.rows[0]?.["result"]).toBe("3"); }); test("e2e: string upper (raw strings)", async () => { const expr = Text.from("hello").upper(); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("result")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("result")}`); expect(result.rows[0]?.["result"]).toBe("HELLO"); }); test("e2e: boolean equality (raw strings)", async () => { const expr = Bool.from(true)["="](Bool.from(true)); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("result")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("result")}`); expect(result.rows[0]?.["result"]).toBe("t"); }); test("e2e: integer comparison (raw strings)", async () => { const expr = Int4.from(5)[">"](Int4.from(3)); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("result")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("result")}`); expect(result.rows[0]?.["result"]).toBe("t"); }); test("e2e: string concatenation (raw strings)", async () => { const expr = Text.from("hello")["||"](Text.from(" world")); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("result")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("result")}`); expect(result.rows[0]?.["result"]).toBe("hello world"); }); test("e2e: primitive arg (raw strings)", async () => { const expr = Int4.from(10)["+"](5); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("result")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("result")}`); expect(result.rows[0]?.["result"]).toBe("15"); }); @@ -211,7 +211,7 @@ test("e2e: nested expressions", async () => { const left = Int4.from(1)["+"](Int4.from(2)); const right = Int4.from(3)["+"](Int4.from(4)); const expr = left["*"](right); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("result")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("result")}`); expect(result.rows[0]?.["result"]).toBe("21"); }); @@ -576,28 +576,28 @@ test("Any.in: accepts primitives directly", () => { test("e2e: x IN (1, 2) where x=3 → false", async () => { const expr = Int4.from(3).in(Int4.from(1), Int4.from(2)); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("hit")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("hit")}`); expect(result.rows[0]?.["hit"]).toBe("f"); }); test("e2e: x IN (1, 2, NULL) where x=3 → null", async () => { const nullInt = sql`NULL::int4` as unknown as Int4<0 | 1>; const expr = Int4.from(3).in(Int4.from(1), Int4.from(2), Int4.from(nullInt)); - const result = await exec.execute(sql`SELECT (${expr.toSql()}) IS NULL as ${sql.ident("isnull")}`); + const result = await exec.execute(sql`SELECT (${expr.toSql()}) IS NULL as ${exec.database.scopedIdent("isnull")}`); expect(result.rows[0]?.["isnull"]).toBe("t"); }); test("e2e: NULL IN (1, 2) → null", async () => { const nullInt = Int4.from(sql`NULL::int4`); const expr = nullInt.in(Int4.from(1), Int4.from(2)); - const result = await exec.execute(sql`SELECT (${expr.toSql()}) IS NULL as ${sql.ident("isnull")}`); + const result = await exec.execute(sql`SELECT (${expr.toSql()}) IS NULL as ${exec.database.scopedIdent("isnull")}`); expect(result.rows[0]?.["isnull"]).toBe("t"); }); test("e2e: x IN (1, NULL) where x=1 → true (a match overrides nulls in the list)", async () => { const nullInt = Int4.from(sql`NULL::int4`); const expr = Int4.from(1).in(Int4.from(1), nullInt); - const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${sql.ident("hit")}`); + const result = await exec.execute(sql`SELECT ${expr.toSql()} as ${exec.database.scopedIdent("hit")}`); expect(result.rows[0]?.["hit"]).toBe("t"); }); From 0f26696b8068b786b88c0483e6645cd60983c742 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:41:22 -0700 Subject: [PATCH 21/33] chore: address copilot/review feedback (small fixes batch) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove stale isBool doc comment in query.ts. - Strip narrative comments from types/meta.ts. - eslint ignore: src/types/postgres/generated → src/types/*/generated (also covers SQLite codegen output). - package.json codegen + codegen:check scripts run both PG and SQLite generators; codegen:check diffs both trees. - Delete src/types/index.ts (transitional PG re-export). All callers updated to import from src/types/postgres directly. - SQLite deserialize: blob tsType flipped from "object" to a sentinel string so the overload matcher can't wrongly accept arbitrary objects (Date, plain records) as blob primitives. - isSetRow widened from `instanceof types.Any` (PG-only) to `instanceof SqlValue` — SQLite SqlValue instances now pass through the mutation SET-row validator. - QueryResult row values typed `string | null` (SQL NULL is real; the previous `string` typing was unsound). - QueryBuilder.scalar() detects a SQLite source Table via first-source.database.dialect and throws with a clear Phase 2.1 pointer, replacing the "defer to bind" TODO. 29 files / 571 tests + examples/basic 6/6 all green. Co-Authored-By: Claude Opus 4.7 (1M context) --- package.json | 4 ++-- src/builder/delete.test.ts | 2 +- src/builder/insert.test.ts | 2 +- src/builder/query.test.ts | 2 +- src/builder/query.ts | 26 +++++++++++++------------- src/builder/update.test.ts | 2 +- src/database.test.ts | 2 +- src/driver.ts | 9 +++++---- src/index.ts | 2 +- src/live/db-live.test.ts | 2 +- src/live/events.test.ts | 2 +- src/live/events.ts | 2 +- src/live/extractor.test.ts | 2 +- src/live/iteration.test.ts | 2 +- src/provenance.test.ts | 2 +- src/table.test.ts | 2 +- src/types/cast.test.ts | 2 +- src/types/index.ts | 3 --- src/types/match.test.ts | 5 ++--- src/types/meta.ts | 10 ---------- src/types/runtime.ts | 13 +++++++------ src/types/sqlite/deserialize.ts | 14 ++++++++++---- 22 files changed, 53 insertions(+), 59 deletions(-) delete mode 100644 src/types/index.ts diff --git a/package.json b/package.json index bb5a5fa..fb3d218 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ }, "scripts": { "build": "tsdown", - "codegen": "node --experimental-strip-types src/types/postgres/generate.ts", - "codegen:check": "tmp=$(mktemp -d) && node --experimental-strip-types src/types/postgres/generate.ts --out-dir \"$tmp\" && { diff -r \"$tmp\" src/types/postgres/generated || { echo 'src/types/postgres/generated is stale — run `npm run codegen` and commit.' >&2; rm -rf \"$tmp\"; exit 1; }; } && rm -rf \"$tmp\"", + "codegen": "node --experimental-strip-types src/types/postgres/generate.ts && node --experimental-strip-types src/types/sqlite/generate.ts", + "codegen:check": "tmp=$(mktemp -d) && node --experimental-strip-types src/types/postgres/generate.ts --out-dir \"$tmp/pg\" && { diff -r \"$tmp/pg\" src/types/postgres/generated || { echo 'src/types/postgres/generated is stale — run `npm run codegen` and commit.' >&2; rm -rf \"$tmp\"; exit 1; }; } && node --experimental-strip-types src/types/sqlite/generate.ts --out-dir \"$tmp/sqlite\" && { diff -r \"$tmp/sqlite/generated\" src/types/sqlite/generated || { echo 'src/types/sqlite/generated is stale — run `npm run codegen` and commit.' >&2; rm -rf \"$tmp\"; exit 1; }; } && rm -rf \"$tmp\"", "lint": "eslint src", "typecheck": "tsgo --noEmit", "format": "prettier --write src", diff --git a/src/builder/delete.test.ts b/src/builder/delete.test.ts index 7e2418b..72ebbc7 100644 --- a/src/builder/delete.test.ts +++ b/src/builder/delete.test.ts @@ -1,5 +1,5 @@ import { test, expect, expectTypeOf } from "vitest"; -import { Int8, Text } from "../types"; +import { Int8, Text } from "../types/postgres"; import { sql } from "./sql"; import { setupDb, db, withinTransaction } from "../test-helpers"; setupDb(); diff --git a/src/builder/insert.test.ts b/src/builder/insert.test.ts index cc7e3c9..d7dced2 100644 --- a/src/builder/insert.test.ts +++ b/src/builder/insert.test.ts @@ -1,5 +1,5 @@ import { test, expect, expectTypeOf } from "vitest"; -import { Int8, Text } from "../types"; +import { Int8, Text } from "../types/postgres"; import type { InsertRow } from "../types/runtime"; import { sql } from "./sql"; import { setupDb, db, withinTransaction } from "../test-helpers"; diff --git a/src/builder/query.test.ts b/src/builder/query.test.ts index caf1929..f5f79b8 100644 --- a/src/builder/query.test.ts +++ b/src/builder/query.test.ts @@ -1,5 +1,5 @@ import { test, expect, expectTypeOf } from "vitest"; -import { Int4, Int8, Text, Bool, Jsonb } from "../types"; +import { Int4, Int8, Text, Bool, Jsonb } from "../types/postgres"; import { sql, compile, pgCtx } from "./sql"; import { setupDb, db, conn } from "../test-helpers"; import { expose } from "typegres"; diff --git a/src/builder/query.ts b/src/builder/query.ts index cdb5d28..16ec9d8 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -4,13 +4,10 @@ import { Connection } from "../database"; // Anyarray / Record stay pinned to PG — scalar() below emits ROW() / // array_agg / COALESCE which are PG-specific. When the Scalar AST node // dispatches per-dialect (Phase 2.1) these will be gated by ctx.dialect. -import { Anyarray, Record } from "../types"; +import { Anyarray, Record } from "../types/postgres"; // Dialect-agnostic base for shape/predicate/instanceof checks — accepts // PG's Any or SQLite's SqliteValue uniformly. import { SqlValue } from "../types/any"; -// Shared Bool detection — RPC validators check "is this a Bool?" without -// caring which dialect produced it. isBool uses each class's dialect -// object to identify Bool identity. import { isBool, type Bool as SharedBool } from "../types/bool"; import { type TsTypeOf, type Nullable, type AggregateRow, meta } from "../types/runtime"; import { fn, expose } from "../exoeval/tool"; @@ -426,16 +423,10 @@ export class QueryBuilder< return row ?? null; } - // TODO: ROW(), array_agg(), COALESCE should be regular typed ops once we support them - // Conditional return type avoids overload resolution quirks: TS's `this:` - // overloads can pick the wrong branch when the Card type is already narrowed. - // // Currently PG-only: emits ROW() + array_agg + COALESCE(..., '{}'). SQLite - // needs json_object + json_group_array; that dispatch lands with the - // Phase 2.1 Scalar AST node. Until then, calling scalar() on a query - // that will run against SQLite raises at bind-time via the first source - // Table's dialect. Detection defers to bind() because construction - // doesn't know the Database yet. + // needs json_object + json_group_array (Phase 2.1 Scalar AST node). + // Detected here via the first source Table's database dialect — + // callers get a clear error before the malformed SQL reaches the driver. scalar(): [Card] extends ["one"] ? Record : [Card] extends ["maybe"] @@ -443,6 +434,15 @@ export class QueryBuilder< : Anyarray, 1>; @expose() scalar(): any { + const firstSource = this.opts.tables[0].source; + const dialect = isTableClass(firstSource) ? firstSource.database?.dialect : undefined; + if (dialect === "sqlite") { + throw new Error( + ".scalar() is not yet supported on SQLite — the Phase 2.1 Scalar AST " + + "node will dispatch ROW()/array_agg → json_object/json_group_array. " + + "For now, build the JSON aggregation directly via a raw sql template.", + ); + } const RecordClass = Record.of(this.rowType()); // Wrap as a subquery: (SELECT ROW(...) FROM ... WHERE ...) diff --git a/src/builder/update.test.ts b/src/builder/update.test.ts index 7e6fa23..63c92c0 100644 --- a/src/builder/update.test.ts +++ b/src/builder/update.test.ts @@ -1,5 +1,5 @@ import { test, expect, expectTypeOf } from "vitest"; -import { Int8, Text } from "../types"; +import { Int8, Text } from "../types/postgres"; import { sql } from "./sql"; import { setupDb, db, withinTransaction } from "../test-helpers"; setupDb(); diff --git a/src/database.test.ts b/src/database.test.ts index a12a012..b39fde0 100644 --- a/src/database.test.ts +++ b/src/database.test.ts @@ -1,5 +1,5 @@ import { test, expect, beforeAll, afterAll } from "vitest"; -import { Int8, Text } from "./types"; +import { Int8, Text } from "./types/postgres"; import { sql } from "./builder/sql"; import { setupDb, db, conn } from "./test-helpers"; import { PgDriver } from "./driver"; diff --git a/src/driver.ts b/src/driver.ts index aa5dff5..19fd4fb 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -2,10 +2,11 @@ import type { DialectName } from "./types/deserialize"; import type pg from "pg"; import type BetterSqlite3 from "better-sqlite3"; -// Rows come back as plain objects keyed by column name. Values are always -// strings here because every type parser is overridden to return raw text; -// typed coercion happens downstream in QueryBuilder/InsertBuilder/etc. -export type QueryResult = { rows: { [key: string]: string }[] }; +// Rows come back as plain objects keyed by column name. Values are +// strings (every driver's type parser is overridden to return raw text) +// or null (SQL NULL). Typed coercion happens downstream in +// QueryBuilder/InsertBuilder/etc. +export type QueryResult = { rows: { [key: string]: string | null }[] }; // Drivers receive already-compiled text + values. Compilation happens in // Database (which owns the CompileContext/DatabaseRef); the driver's // only job is to hand the query to its underlying pool/wasm and normalize diff --git a/src/index.ts b/src/index.ts index e128374..f6c3200 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,4 +31,4 @@ export const typegres = async ( return { db, conn }; }; -export * from "./types"; +export * from "./types/postgres"; diff --git a/src/live/db-live.test.ts b/src/live/db-live.test.ts index f142c76..28714b8 100644 --- a/src/live/db-live.test.ts +++ b/src/live/db-live.test.ts @@ -1,5 +1,5 @@ import { test, expect, afterEach } from "vitest"; -import { Int8, Text } from "../types"; +import { Int8, Text } from "../types/postgres"; import { sql } from "../builder/sql"; import { conn, db, setupDb } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; diff --git a/src/live/events.test.ts b/src/live/events.test.ts index 85a4384..8089f0b 100644 --- a/src/live/events.test.ts +++ b/src/live/events.test.ts @@ -1,5 +1,5 @@ import { test, expect, beforeAll, afterEach } from "vitest"; -import { Int8, Text } from "../types"; +import { Int8, Text } from "../types/postgres"; import { sql } from "../builder/sql"; import { conn, db, setupDb } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; diff --git a/src/live/events.ts b/src/live/events.ts index 511bb1a..3debfbf 100644 --- a/src/live/events.ts +++ b/src/live/events.ts @@ -1,4 +1,4 @@ -import { Any, Int8, Jsonb, Text, Timestamptz, Xid8 } from "../types"; +import { Any, Int8, Jsonb, Text, Timestamptz, Xid8 } from "../types/postgres"; import { Table, type QueryTransformer } from "../table"; import { sql, Ident, type Sql } from "../builder/sql"; import type { InsertBuilder } from "../builder/insert"; diff --git a/src/live/extractor.test.ts b/src/live/extractor.test.ts index 3e6b4f8..e3fbbc5 100644 --- a/src/live/extractor.test.ts +++ b/src/live/extractor.test.ts @@ -1,5 +1,5 @@ import { test, expect } from "vitest"; -import { Int8, Text } from "../types"; +import { Int8, Text } from "../types/postgres"; import { Database } from "../database"; import { sql } from "../builder/sql"; import { expectSqlEqual } from "../test-helpers"; diff --git a/src/live/iteration.test.ts b/src/live/iteration.test.ts index cd58b90..62e02cd 100644 --- a/src/live/iteration.test.ts +++ b/src/live/iteration.test.ts @@ -1,5 +1,5 @@ import { test, expect } from "vitest"; -import { Int8, Text } from "../types"; +import { Int8, Text } from "../types/postgres"; import { sql } from "../builder/sql"; import { setupDb, withinTransaction } from "../test-helpers"; import { runLiveIteration } from "./extractor"; diff --git a/src/provenance.test.ts b/src/provenance.test.ts index 70b1d93..9123230 100644 --- a/src/provenance.test.ts +++ b/src/provenance.test.ts @@ -10,7 +10,7 @@ import { test, expect, describe } from "vitest"; import { Database } from "./database"; import { compile, sql, Ident, Func, Op, UnaryOp, Cast, Raw, Param } from "./builder/sql"; -import { Int4, Text } from "./types"; +import { Int4, Text } from "./types/postgres"; import { Integer } from "./types/sqlite"; // Two same-dialect databases → distinct provenance identities. diff --git a/src/table.test.ts b/src/table.test.ts index 03e365c..44eb291 100644 --- a/src/table.test.ts +++ b/src/table.test.ts @@ -1,5 +1,5 @@ import { test, expect, expectTypeOf } from "vitest"; -import { Int8, Text } from "./types"; +import { Int8, Text } from "./types/postgres"; import { sql } from "./builder/sql"; import { setupDb, db, withinTransaction } from "./test-helpers"; import type { Fromable } from "./builder/query"; diff --git a/src/types/cast.test.ts b/src/types/cast.test.ts index 47935d4..4208ee5 100644 --- a/src/types/cast.test.ts +++ b/src/types/cast.test.ts @@ -1,5 +1,5 @@ import { test, expectTypeOf } from "vitest"; -import { Int4, Text } from "./index"; +import { Int4, Text } from "./postgres"; import { sql } from "../builder/sql"; // .cast(cls) must preserve the source's nullability class when producing diff --git a/src/types/index.ts b/src/types/index.ts deleted file mode 100644 index 3c2d109..0000000 --- a/src/types/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Transitional re-export of the Postgres type barrel. -// Direct callers should migrate to `../types/postgres` over time. -export * from "./postgres"; diff --git a/src/types/match.test.ts b/src/types/match.test.ts index d0d5e6e..037d9a8 100644 --- a/src/types/match.test.ts +++ b/src/types/match.test.ts @@ -1,5 +1,5 @@ import { test, expect } from "vitest"; -import { Int4, Int8, Text, Bool } from "./index"; +import { Int4, Int8, Text, Bool } from "./postgres"; import { compile, pgCtx } from "../builder/sql"; // --- match via operators/functions --- @@ -18,8 +18,7 @@ test("match: primitive passes when allowed", () => { test("match: wrong primitive type throws", () => { const a = Int4.from(5) as Int4<1>; - // @ts-expect-error — string is not a valid arg for Int4["+"] - expect(() => a["+"](("hello" as unknown))).toThrow("No matching overload"); + expect(() => a["+"]("hello" as unknown as number)).toThrow("No matching overload"); }); test("match: wrong class type throws", () => { diff --git a/src/types/meta.ts b/src/types/meta.ts index c19c089..bdb57ac 100644 --- a/src/types/meta.ts +++ b/src/types/meta.ts @@ -1,11 +1 @@ -// Global metadata symbol — hides internals from autocomplete. All type -// metadata (__class, __nullability, __aggregate, __nullable, etc.) -// lives under this key on `SqlValue` instances. -// -// Lives in its own tiny module so both `any.ts` (defines `SqlValue`) -// and `runtime.ts` (uses the symbol in type-utility definitions) can -// import it without triggering a load cycle. Previously the symbol -// lived in `runtime.ts`, but `runtime.ts` also does `import * as types -// from "./index"` which triggers the PG barrel — extending `SqlValue` -// via any generated class before `any.ts` had defined it. export const meta = Symbol("typegres"); diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 740797b..2d1ba6c 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -2,12 +2,12 @@ export type { Sql } from "../builder/sql"; export { sql } from "../builder/sql"; import type { BoundSql, Raw, CompileContext } from "../builder/sql"; import { Func, Ident, Op, Sql, sql } from "../builder/sql"; -import * as types from "./index"; -import type { Any } from "./index"; +import * as types from "./postgres"; +import type { Any } from "./postgres"; // Shared base for type-level utilities (NullOf, TsTypeOf, Aggregate). // Extracting an N from a typed value works uniformly across dialects // because every dialect's root class extends SqlValue. -import type { SqlValue } from "./any"; +import { SqlValue } from "./any"; import { getTypeDef } from "./deserialize"; import { isPlainData } from "../util"; import type { RowType } from "../builder/query"; @@ -103,10 +103,11 @@ export const isSetRow = (row: unknown): row is SetRow => { if (typeof row !== "object" || row === null || Array.isArray(row)) { return false; } - // Each value must be either a typegres expression OR plain data - // (recursively — no class instances at any depth). + // Each value must be either a typegres expression (any dialect — + // PG's Any or SQLite's SqliteValue both extend SqlValue) OR plain + // data (recursively — no other class instances at any depth). return Object.values(row).every( - (v) => v instanceof types.Any || isPlainData(v), + (v) => v instanceof SqlValue || isPlainData(v), ); }; diff --git a/src/types/sqlite/deserialize.ts b/src/types/sqlite/deserialize.ts index 34eab9b..604c5de 100644 --- a/src/types/sqlite/deserialize.ts +++ b/src/types/sqlite/deserialize.ts @@ -19,10 +19,16 @@ export const sqliteRegistry: { [key: string]: TypeDef } = { integer: { tsType: "number", deserialize: parseIntFromText }, real: { tsType: "number", deserialize: parseFloat }, text: { tsType: "string", deserialize: identity }, - // Blob deserialize is a placeholder — the driver returns Buffer - // directly, so this path is only used if a raw string sneaks in. - // Real repr TBD (Buffer? Uint8Array? hex? see plan.md A1). - blob: { tsType: "object", deserialize: identity }, + // Blob's TS-primitive slot is a sentinel that `typeof x` never + // returns — so the overload matcher won't wrongly accept arbitrary + // objects (Date, plain records, arrays) as a blob primitive. + // Blob values pass through as Uint8Array/Buffer at the driver + // layer; the deserialize path is unreachable for now. + // + // See ISSUES.md #A1: proper JS-side blob repr (Uint8Array vs Buffer + // vs base64) is still open. When resolved, replace this sentinel + // with a matcher that accepts the chosen representation. + blob: { tsType: "__blob_unsupported__", deserialize: identity }, bool: { tsType: "boolean", deserialize: (raw) => raw === "1" }, }; From e64c00c4d99d8c70d4cf74f1e78d34b53ad8eb66 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:44:15 -0700 Subject: [PATCH 22/33] refactor(sqlite): table.test wrapped in txns + type asserts + expected-type declares MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Each test in sqlite/table.test wrapped in a rollback transaction (same pattern as PG's withinTransaction) so tests are independent and idempotent — no id-numbering assumptions carry across. - Ordering assertions explicitly ORDER BY id — no more assumption that SQLite returns rows in insertion order. - expectTypeOf assertions on every test's row shape. - SQLite codegen now emits `declare deserialize: (raw: string) => ` per storage class (integer→number, real→number, text→string, blob→Uint8Array). Without it TsTypeOf collapses to unknown and SQLite row assertions can't be typed. - Regenerated the four SQLite class files. Also tightens bool-mixin: boolAnd/boolOr drop the primitive-boolean coercion path (no callers) and take a Bool value directly. PG + SQLite Bool signatures narrow from `Bool | boolean` to `Bool` accordingly. Runtime.ts: removed unused `import * as types from "./postgres"`. 29 files / 571 tests + examples 6/6 green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/types/bool-mixin.ts | 24 ++-- src/types/postgres/overrides/bool.ts | 10 +- src/types/runtime.ts | 1 - src/types/sqlite/functions.json | 2 +- src/types/sqlite/generate.ts | 10 ++ src/types/sqlite/generated/blob.ts | 1 + src/types/sqlite/generated/bool.ts | 8 +- src/types/sqlite/generated/integer.ts | 1 + src/types/sqlite/generated/real.ts | 1 + src/types/sqlite/generated/text.ts | 1 + src/types/sqlite/table.test.ts | 168 +++++++++++++++----------- 11 files changed, 132 insertions(+), 95 deletions(-) diff --git a/src/types/bool-mixin.ts b/src/types/bool-mixin.ts index 212dd6f..1d2773a 100644 --- a/src/types/bool-mixin.ts +++ b/src/types/bool-mixin.ts @@ -1,21 +1,15 @@ // Dialect-agnostic helpers for Bool's and/or/not. Concrete Bool classes -// pass their own __typname so a primitive TS boolean gets wrapped in the -// dialect's native bool representation via Cast. Cast itself is -// dialect-aware via CompileContext at bind time. -import { Cast, Op, Param, UnaryOp, sql, type Sql } from "../builder/sql"; +// call these with their own .toSql() and Bool args — no primitive +// boolean coercion (that path had no callers and expanded the accepted +// runtime shapes wider than the API contract needed). +import { Op, UnaryOp, sql, type Sql } from "../builder/sql"; -const coerceBoolArg = (v: unknown, typname: Sql): Sql => { - if (v !== null && typeof v === "object" && typeof (v as { toSql?: unknown }).toSql === "function") { - return (v as { toSql: () => Sql }).toSql(); - } - return new Cast(new Param(v), typname); -}; +// `right` is a Bool value (any dialect); its .toSql() feeds the Op. +export const boolAnd = (leftSql: Sql, right: { toSql: () => Sql }): Sql => + new Op(sql`AND`, leftSql, right.toSql()); -export const boolAnd = (leftSql: Sql, right: unknown, typname: Sql): Sql => - new Op(sql`AND`, leftSql, coerceBoolArg(right, typname)); - -export const boolOr = (leftSql: Sql, right: unknown, typname: Sql): Sql => - new Op(sql`OR`, leftSql, coerceBoolArg(right, typname)); +export const boolOr = (leftSql: Sql, right: { toSql: () => Sql }): Sql => + new Op(sql`OR`, leftSql, right.toSql()); export const boolNot = (sqlExpr: Sql): Sql => new UnaryOp(sql`NOT`, sqlExpr); diff --git a/src/types/postgres/overrides/bool.ts b/src/types/postgres/overrides/bool.ts index e11813b..d705860 100644 --- a/src/types/postgres/overrides/bool.ts +++ b/src/types/postgres/overrides/bool.ts @@ -1,6 +1,6 @@ import { Bool as Generated } from "../generated/bool"; import { boolAnd, boolOr, boolNot } from "../../bool-mixin"; -import type { StrictNull, NullOf } from "../../runtime"; +import type { NullOf, StrictNull } from "../../runtime"; export class Bool extends Generated { // Codegen skips `declare deserialize` when an override exists (the override @@ -8,12 +8,12 @@ export class Bool extends Generated { // `boolean` instead of `unknown`. declare deserialize: (raw: string) => boolean; - and | boolean>(other: M): Bool>> { - return Bool.from(boolAnd(this.toSql(), other, Bool.__typname)) as any; + and>(other: M): Bool>> { + return Bool.from(boolAnd(this.toSql(), other)) as any; } - or | boolean>(other: M): Bool>> { - return Bool.from(boolOr(this.toSql(), other, Bool.__typname)) as any; + or>(other: M): Bool>> { + return Bool.from(boolOr(this.toSql(), other)) as any; } not(): Bool { diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 2d1ba6c..5b1f310 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -2,7 +2,6 @@ export type { Sql } from "../builder/sql"; export { sql } from "../builder/sql"; import type { BoundSql, Raw, CompileContext } from "../builder/sql"; import { Func, Ident, Op, Sql, sql } from "../builder/sql"; -import * as types from "./postgres"; import type { Any } from "./postgres"; // Shared base for type-level utilities (NullOf, TsTypeOf, Aggregate). // Extracting an N from a typed value works uniformly across dialects diff --git a/src/types/sqlite/functions.json b/src/types/sqlite/functions.json index 68977e1..309a592 100644 --- a/src/types/sqlite/functions.json +++ b/src/types/sqlite/functions.json @@ -1,6 +1,6 @@ { "sqlite_version": "3.53.2", - "generated_at": "2026-07-01T22:41:31.905Z", + "generated_at": "2026-07-01T23:43:35.468Z", "function_count": 197, "functions": { "->": [ diff --git a/src/types/sqlite/generate.ts b/src/types/sqlite/generate.ts index 01a22d3..9c13a0c 100644 --- a/src/types/sqlite/generate.ts +++ b/src/types/sqlite/generate.ts @@ -315,6 +315,16 @@ const emitClassFile = ( lines.push(" };"); lines.push(` static override __typname = sql\`${ownerType.toUpperCase()}\`;`); lines.push(` static override __typnameText = "${ownerType}";`); + // deserialize's return type feeds `TsTypeOf` in runtime.ts; without + // an explicit signature it falls through to `unknown` and rows come + // back untyped. The tsType strings map to concrete TS types below. + const deserializeTsType: Record, string> = { + integer: "number", + real: "number", + text: "string", + blob: "Uint8Array", + }; + lines.push(` declare deserialize: (raw: string) => ${deserializeTsType[ownerType]};`); lines.push(""); for (const m of methods) { diff --git a/src/types/sqlite/generated/blob.ts b/src/types/sqlite/generated/blob.ts index ee35c27..1bfffa9 100644 --- a/src/types/sqlite/generated/blob.ts +++ b/src/types/sqlite/generated/blob.ts @@ -21,6 +21,7 @@ export class Blob extends SqliteValue { }; static override __typname = sql`BLOB`; static override __typnameText = "blob"; + declare deserialize: (raw: string) => Uint8Array; abs(): types.Real { return funcCall("abs", [this], types.Real) as types.Real; diff --git a/src/types/sqlite/generated/bool.ts b/src/types/sqlite/generated/bool.ts index c774f18..2ec4bb7 100644 --- a/src/types/sqlite/generated/bool.ts +++ b/src/types/sqlite/generated/bool.ts @@ -26,12 +26,12 @@ export class Bool extends SqliteValue { static override __typnameText = "bool"; declare deserialize: (raw: string) => boolean; - and | boolean>(other: M): Bool>> { - return Bool.from(boolAnd(this.toSql(), other, Bool.__typname)) as any; + and>(other: M): Bool>> { + return Bool.from(boolAnd(this.toSql(), other)) as any; } - or | boolean>(other: M): Bool>> { - return Bool.from(boolOr(this.toSql(), other, Bool.__typname)) as any; + or>(other: M): Bool>> { + return Bool.from(boolOr(this.toSql(), other)) as any; } not(): Bool { diff --git a/src/types/sqlite/generated/integer.ts b/src/types/sqlite/generated/integer.ts index 4fac99b..3fcadda 100644 --- a/src/types/sqlite/generated/integer.ts +++ b/src/types/sqlite/generated/integer.ts @@ -21,6 +21,7 @@ export class Integer extends SqliteValue { }; static override __typname = sql`INTEGER`; static override __typnameText = "integer"; + declare deserialize: (raw: string) => number; abs(): types.Integer { return funcCall("abs", [this], types.Integer) as types.Integer; diff --git a/src/types/sqlite/generated/real.ts b/src/types/sqlite/generated/real.ts index fd24c76..f1d9765 100644 --- a/src/types/sqlite/generated/real.ts +++ b/src/types/sqlite/generated/real.ts @@ -21,6 +21,7 @@ export class Real extends SqliteValue { }; static override __typname = sql`REAL`; static override __typnameText = "real"; + declare deserialize: (raw: string) => number; abs(): types.Real { return funcCall("abs", [this], types.Real) as types.Real; diff --git a/src/types/sqlite/generated/text.ts b/src/types/sqlite/generated/text.ts index 9ca1628..431d375 100644 --- a/src/types/sqlite/generated/text.ts +++ b/src/types/sqlite/generated/text.ts @@ -21,6 +21,7 @@ export class Text extends SqliteValue { }; static override __typname = sql`TEXT`; static override __typnameText = "text"; + declare deserialize: (raw: string) => string; abs(): types.Real { return funcCall("abs", [this], types.Real) as types.Real; diff --git a/src/types/sqlite/table.test.ts b/src/types/sqlite/table.test.ts index 6e880a2..375fe38 100644 --- a/src/types/sqlite/table.test.ts +++ b/src/types/sqlite/table.test.ts @@ -1,12 +1,12 @@ -// Table + QueryBuilder smoke tests against SQLite. Extends the -// generated-method smoke suite (./smoke.test.ts) into the mutation -// path: Table("users") + INSERT / SELECT / UPDATE / DELETE, with -// RETURNING where useful. +// Table + QueryBuilder tests against SQLite. Extends the generated- +// method smoke suite (./smoke.test.ts) into the mutation path: +// Table("users") + INSERT / SELECT / UPDATE / DELETE, with RETURNING +// where useful. // -// SQLite 3.35+ speaks the same RETURNING syntax as PG, so the mutation -// builders should compile identically once the receiving driver -// dispatches placeholders (`?` vs `$N`). -import { test, expect, beforeAll, afterAll } from "vitest"; +// Each test runs inside a transaction that always rolls back, so +// tests are independent and idempotent — no id-numbering assumptions +// carry across cases. +import { test, expect, expectTypeOf, beforeAll, afterAll } from "vitest"; import { SqliteDriver } from "../../driver"; import type { Connection } from "../../database"; import { Database } from "../../database"; @@ -26,11 +26,21 @@ class Users extends db.Table("users") { let driver: SqliteDriver; let conn: Connection; +// Each test wraps in a transaction that always rolls back — same +// pattern as PG's withinTransaction. Tests build up whatever rows +// they need inside the closure and see them wiped after the throw. +const withinTransaction = async (fn: (tx: Connection) => Promise) => { + await conn.transaction(async (tx) => { + await fn(tx); + throw new Error("__test_rollback__"); + }).catch((e) => { + if ((e as Error).message !== "__test_rollback__") { throw e; } + }); +}; + beforeAll(async () => { driver = await SqliteDriver.create(":memory:"); conn = db.attach(driver); - // Bootstrap schema. The Table("users") class only owns the *shape*; - // the actual CREATE lives in application-land (or a codegen'd migration). await conn.execute(sql`CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL)`); }); @@ -38,77 +48,97 @@ afterAll(async () => { await conn.close(); }); -test("INSERT rows and read them back with .from()", async () => { - await Users.insert({ id: 1, name: "alice" }).execute(conn); - await Users.insert({ id: 2, name: "bob" }).execute(conn); - const rows = await Users.from().execute(conn); - expect(rows.length).toBe(2); - // Rows come out in insertion order (SQLite rowid ordering). - expect(rows[0]!.name).toBe("alice"); - expect(rows[1]!.name).toBe("bob"); +test("INSERT + .from().select() roundtrip preserves values (order-by-id)", async () => { + await withinTransaction(async (tx) => { + await Users.insert({ id: 1, name: "alice" }).execute(tx); + await Users.insert({ id: 2, name: "bob" }).execute(tx); + const rows = await Users.from() + .orderBy(({ users }) => users.id) + .select(({ users }) => ({ id: users.id, name: users.name })) + .execute(tx); + expectTypeOf(rows).toEqualTypeOf<{ id: number; name: string }[]>(); + expect(rows).toEqual([ + { id: 1, name: "alice" }, + { id: 2, name: "bob" }, + ]); + }); }); test("INSERT ... RETURNING id", async () => { - const returned = await Users.insert({ id: 3, name: "carol" }) - .returning(({ users }) => ({ id: users.id })) - .execute(conn); - expect(returned).toEqual([{ id: 3 }]); + await withinTransaction(async (tx) => { + const returned = await Users.insert({ id: 7, name: "carol" }) + .returning(({ users }) => ({ id: users.id })) + .execute(tx); + expectTypeOf(returned).toEqualTypeOf<{ id: number }[]>(); + expect(returned).toEqual([{ id: 7 }]); + }); }); -test("SELECT projection with method composition (upper)", async () => { - const rows = await Users.from() - .select((u) => ({ upperName: u.users.name.upper() })) - .execute(conn); - expect(rows.map((r) => r.upperName)).toEqual(["ALICE", "BOB", "CAROL"]); +test("SELECT projection composes generated methods (upper)", async () => { + await withinTransaction(async (tx) => { + await Users.insert({ id: 1, name: "alice" }).execute(tx); + const rows = await Users.from() + .select(({ users }) => ({ upperName: users.name.upper() })) + .execute(tx); + expectTypeOf(rows).toEqualTypeOf<{ upperName: string }[]>(); + expect(rows).toEqual([{ upperName: "ALICE" }]); + }); }); -test("WHERE with sql template + .isNull()", async () => { - const rows = await Users.from() - .where((u) => u.users.name.isNotNull()) - .execute(conn); - expect(rows.length).toBe(3); +test("WHERE with .isNotNull() filters rows", async () => { + await withinTransaction(async (tx) => { + await Users.insert({ id: 1, name: "alice" }).execute(tx); + const rows = await Users.from() + .where(({ users }) => users.name.isNotNull()) + .select(({ users }) => ({ id: users.id, name: users.name })) + .execute(tx); + expectTypeOf(rows).toEqualTypeOf<{ id: number; name: string }[]>(); + expect(rows.length).toBe(1); + }); }); -test("WHERE with raw sql predicate + placeholder is `?`", async () => { - // The QB accepts any Bool-typed expression. Constructing one from a - // raw sql template exercises the ctx placeholder dispatch inside a - // WHERE clause (rather than in a bare projection). - const target = Text.from("alice"); - const rows = await Users.from() - .where((u) => - // Bool via raw template — the equivalent of an .eq() operator - // (which the codegen'd sqlite Text class doesn't have yet). - Text.from(sql`(${u.users.name.toSql()} = ${target.toSql()})`).isNotNull().and( - // The above always returns 1 for non-null result of `=` — including 0-valued - // matches. To get actual filter behavior, wrap in the raw comparison: - Text.from(sql`(${u.users.name.toSql()} = ${target.toSql()})`).isNotNull(), - ), - ) - .execute(conn); - // isNotNull composed with itself matches all non-null equalities (i.e. - // all rows) — this test mainly validates that placeholders emit as - // `?` inside a compiled WHERE. Row count == full table means it did - // execute successfully. - expect(rows.length).toBe(3); +test("placeholder emission is `?` inside a WHERE (compiled through the QB)", async () => { + await withinTransaction(async (tx) => { + await Users.insert({ id: 1, name: "alice" }).execute(tx); + // SQLite's Text class doesn't have a codegen'd `.eq()` operator + // yet, so this raw-template predicate exercises the placeholder + // dispatch inside a compiled WHERE clause. + const target = Text.from("alice"); + const rows = await Users.from() + .where(({ users }) => + Text.from(sql`(${users.name.toSql()} = ${target.toSql()})`).isNotNull(), + ) + .execute(tx); + expect(rows.length).toBe(1); + }); }); test("UPDATE ... RETURNING name", async () => { - const returned = await Users.update() - .where((u) => u.users.id.isNotNull()) - .set(() => ({ name: "renamed" })) - .returning(({ users }) => ({ name: users.name })) - .execute(conn); - // Three rows updated → three returned. - expect(returned.length).toBe(3); - expect(returned.every((r) => r.name === "renamed")).toBe(true); + await withinTransaction(async (tx) => { + await Users.insert({ id: 1, name: "alice" }).execute(tx); + await Users.insert({ id: 2, name: "bob" }).execute(tx); + const returned = await Users.update() + .where(({ users }) => users.id.isNotNull()) + .set(() => ({ name: "renamed" })) + .returning(({ users }) => ({ name: users.name })) + .execute(tx); + expectTypeOf(returned).toEqualTypeOf<{ name: string }[]>(); + expect(returned).toHaveLength(2); + expect(returned.every((r) => r.name === "renamed")).toBe(true); + }); }); -test("DELETE ... RETURNING id", async () => { - const returned = await Users.delete() - .where((u) => u.users.id.isNotNull()) - .returning(({ users }) => ({ id: users.id })) - .execute(conn); - expect(returned.length).toBe(3); - const remaining = await Users.from().execute(conn); - expect(remaining.length).toBe(0); +test("DELETE ... RETURNING id removes the rows", async () => { + await withinTransaction(async (tx) => { + await Users.insert({ id: 1, name: "alice" }).execute(tx); + await Users.insert({ id: 2, name: "bob" }).execute(tx); + const returned = await Users.delete() + .where(({ users }) => users.id.isNotNull()) + .returning(({ users }) => ({ id: users.id })) + .execute(tx); + expectTypeOf(returned).toEqualTypeOf<{ id: number }[]>(); + expect(returned).toHaveLength(2); + const remaining = await Users.from().execute(tx); + expect(remaining).toHaveLength(0); + }); }); From 8f6072e05d798113fce224a975ec12310b18e4ca Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:46:09 -0700 Subject: [PATCH 23/33] refactor(compile): ctx auto-detected from Sql tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit compile(root) walks the tree for a tagged Ident (yielding its database) or a dialect-tagged Func/Op/Cast/Srf/TypedParam (yielding a synthetic DatabaseRef with the matching dialect). Falls back to the pgCtx sentinel only when the tree is fully untagged. The second arg stays optional so callers that want to force a particular ctx — e.g., sqlite/smoke.test's placeholder-emission check — still work. Most `compile(qb, pgCtx)` call sites could now drop the second arg without behavior change, but I've left them untouched to keep this diff small. 571 tests + 6 examples green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/sql.ts | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/builder/sql.ts b/src/builder/sql.ts index de8b6f0..40e5025 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -297,7 +297,45 @@ const quoteIdent = (name: string): string => `"${name.replace(/"/g, '""')}"`; // frames stash the previous scope to restore on pop. type Frame = { iter: Iterator; prevScope?: Scope }; -export const compile = (root: Sql, ctx: CompileContext = pgCtx): CompiledSql => { +// Walk a Sql tree and return the first tagged Ident's database, or a +// synthetic DatabaseRef from the first dialect-tagged Func/Op/Cast/Srf +// node's dialect if no tagged Ident is present. Used by `compile()` +// when the caller doesn't supply an explicit ctx — the tree usually +// carries enough provenance to derive its own compile context. +const walkForDatabase = (root: Sql): DatabaseRef | undefined => { + const stack: Sql[] = [root]; + let dialectOnly: DialectName | undefined; + while (stack.length) { + const n = stack.pop()!; + if (n instanceof Ident && n.database) { return n.database; } + if (dialectOnly === undefined) { + if (n instanceof Func && n.dialect) { dialectOnly = n.dialect; } + else if (n instanceof Op && n.dialect) { dialectOnly = n.dialect; } + else if (n instanceof UnaryOp && n.dialect) { dialectOnly = n.dialect; } + else if (n instanceof Cast && n.dialect) { dialectOnly = n.dialect; } + else if (n instanceof TypedParam && n.dialect) { dialectOnly = n.dialect; } + } + for (const c of n.children()) { stack.push(c); } + } + if (dialectOnly) { + return { id: Symbol("compile-inferred"), dialect: dialectOnly, name: "compile-inferred" }; + } + return undefined; +}; + +export const compile = (root: Sql, ctx?: CompileContext): CompiledSql => { + // Auto-detect ctx from the tree when the caller omits it. Fully + // untagged trees (raw templates with no typed values, no Idents) + // fall back to the `pgCtx` sentinel — matches the pre-refactor + // default behavior for hand-authored templates. + const resolvedCtx: CompileContext = ctx ?? (() => { + const database = walkForDatabase(root); + return database ? { database } : pgCtx; + })(); + return compileWithCtx(root, resolvedCtx); +}; + +const compileWithCtx = (root: Sql, ctx: CompileContext): CompiledSql => { const values: unknown[] = []; const out: string[] = []; let scope = new Scope(); From 4a84cedeb65e3d1d1b3a9fa3fe9671e8a097ba65 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:48:33 -0700 Subject: [PATCH 24/33] feat(sqlite): codegen emits runtime.match dispatch + JS primitives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parity with PG codegen shape: - Every method with args gets ` | number>` (or `| string` for text, plain type for blob) — accepts the typed value or a JS-native primitive. - Runtime dispatch through runtime.match([args], [[[matchers], retType]]) validates arg types + serializes primitives, then funcCall constructs a dialect-tagged Func node. - Blob-typed args reject primitives (registry sentinel from prior commit; no meaningful JS blob primitive yet). - Return type nullability tracked via `StrictNull | ...>` from the actual method type params rather than opaque `typeof arg0`. Runtime widening: match's ArgMatcher.type + MatchCase.retType + Srf's column-type slot go from `typeof Any` (PG-only) to `typeof SqlValue` (dialect-agnostic). Both PG and SQLite codegen output typechecks. Regenerated all four SQLite class files. Two smoke tests added: Integer.atan2(1) works with a JS number primitive; passing a string throws with `No matching overload` at runtime. 573 tests + 6 examples green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/types/runtime.ts | 12 +- src/types/sqlite/functions.json | 2 +- src/types/sqlite/generate.ts | 56 ++-- src/types/sqlite/generated/blob.ts | 271 ++++++++++------- src/types/sqlite/generated/integer.ts | 407 +++++++++++++++++--------- src/types/sqlite/generated/real.ts | 383 +++++++++++++++--------- src/types/sqlite/generated/text.ts | 229 +++++++++------ src/types/sqlite/smoke.test.ts | 14 + 8 files changed, 886 insertions(+), 488 deletions(-) diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 5b1f310..53f7471 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -119,12 +119,14 @@ export const pgElement = (expr: Any): typeof Any => (expr[meta].__class as // Overload matching: validate args and resolve return type constructor. // Each case: [argMatchers (one per arg), returnType constructor]. // allowPrimitive: true if the corresponding TS primitive is accepted for this arg. -type ArgMatcher = { type: typeof Any; allowPrimitive?: boolean }; -type MatchCase = [args: ArgMatcher[], retType: typeof Any]; +// `type` is widened to `typeof SqlValue` so both PG- and SQLite-codegen +// call sites typecheck (both dialects' classes descend from SqlValue). +type ArgMatcher = { type: typeof SqlValue; allowPrimitive?: boolean }; +type MatchCase = [args: ArgMatcher[], retType: typeof SqlValue]; // Validates args, serializes primitives, and returns [retType, ...serializedArgs]. // The caller destructures: const [retType, ...args] = match(...) -export const match = (args: unknown[], cases: MatchCase[]): [typeof Any, ...unknown[]] => { +export const match = (args: unknown[], cases: MatchCase[]): [typeof SqlValue, ...unknown[]] => { for (const [matchers, retType] of cases) { const matched = matchers.every((m, i) => { const arg = args[i]; @@ -183,11 +185,11 @@ export const opCall = (op: Raw, args: [unknown, unknown], type: typeof SqlValue) export class Srf }, A extends string> extends Sql { readonly tsAlias: A; #name: string; - #columns: [string, typeof Any][]; + #columns: [string, typeof SqlValue][]; #argsSql: Sql; #dialect: string | undefined; - constructor(name: A, args: unknown[], columns: [string, typeof Any][]) { + constructor(name: A, args: unknown[], columns: [string, typeof SqlValue][]) { super(); this.tsAlias = name; this.#name = name; diff --git a/src/types/sqlite/functions.json b/src/types/sqlite/functions.json index 309a592..ca0237e 100644 --- a/src/types/sqlite/functions.json +++ b/src/types/sqlite/functions.json @@ -1,6 +1,6 @@ { "sqlite_version": "3.53.2", - "generated_at": "2026-07-01T23:43:35.468Z", + "generated_at": "2026-07-01T23:46:51.962Z", "function_count": 197, "functions": { "->": [ diff --git a/src/types/sqlite/generate.ts b/src/types/sqlite/generate.ts index 9c13a0c..3b095d7 100644 --- a/src/types/sqlite/generate.ts +++ b/src/types/sqlite/generate.ts @@ -293,14 +293,13 @@ const emitClassFile = ( const argClass = (t: Exclude): string => `types.${CLASS_FOR[t]}`; const lines: string[] = []; lines.push("// Auto-generated by src/types/sqlite/generate.ts — do not edit."); - lines.push("// First-pass codegen: one method per (owner-type, function-name);"); - lines.push("// same-type-args only. Heterogeneous overloads (e.g. substr) will"); - lines.push("// be added via hand-curated overrides (Phase 1.4)."); + lines.push("// One method per (owner-type, function-name); same-type-args only."); + lines.push("// Heterogeneous overloads (e.g. substr) will be added via hand-"); + lines.push("// curated overrides (Phase 1.4)."); lines.push('import { SqliteValue } from "../base";'); lines.push('import { sql, type Sql } from "../../../builder/sql";'); lines.push('import { meta } from "../../runtime";'); - lines.push('import { funcCall } from "../../runtime";'); - lines.push('import type { NullOf, StrictNull } from "../../runtime";'); + lines.push('import * as runtime from "../../runtime";'); lines.push('import * as types from "../index";'); lines.push(""); lines.push(`export class ${className} extends SqliteValue {`); @@ -327,20 +326,43 @@ const emitClassFile = ( lines.push(` declare deserialize: (raw: string) => ${deserializeTsType[ownerType]};`); lines.push(""); + // Per-storage-class JS primitive that gets accepted alongside the + // typegres instance. Blob has no meaningful JS primitive so its + // methods reject non-Blob args at runtime (see registry sentinel). + const primitiveOf: Record, string | null> = { + integer: "number", + real: "number", + text: "string", + blob: null, + }; for (const m of methods) { const retClass = argClass(m.resultType); - // Build TS arg params: arg0, arg1, ... each typed as `dialect_class | prim`. - // For the first-cut TS we don't do overload dispatch; just take the - // typegres instances (no primitive coercion yet). Simplify. - const params = m.argTypes.map((t, i) => `arg${i}: ${argClass(t)}`).join(", "); - // Result nullability: null propagates from any arg (strict). - const nullTerms = ["N", ...m.argTypes.map((_, i) => `NullOf`)]; - const nullExpr = nullTerms.length === 1 ? nullTerms[0]! : `StrictNull<${nullTerms.join(" | ")}>`; - // Route through runtime.funcCall so the Func node carries the target - // type's dialect tag — enforced at compile via CompileContext. - const argList = ["this", ...m.argTypes.map((_, i) => `arg${i}`)].join(", "); - lines.push(` ${m.tsName}(${params}): ${retClass}<${nullExpr}> {`); - lines.push(` return funcCall("${m.sqlName}", [${argList}], ${retClass}) as ${retClass}<${nullExpr}>;`); + const params = m.argTypes.map((t, i) => { + const prim = primitiveOf[t]; + const tParam = prim + ? `M${i} extends ${argClass(t)} | ${prim}` + : `M${i} extends ${argClass(t)}`; + return { tParam, argParam: `arg${i}: M${i}` }; + }); + const tsGenerics = params.length > 0 + ? `<${params.map((p) => p.tParam).join(", ")}>` + : ""; + const paramList = params.map((p) => p.argParam).join(", "); + const nullTerms = ["N", ...m.argTypes.map((_, i) => `runtime.NullOf`)]; + const nullExpr = nullTerms.length === 1 ? nullTerms[0]! : `runtime.StrictNull<${nullTerms.join(" | ")}>`; + // Runtime dispatch via runtime.match for arg validation + serialization, + // then runtime.funcCall for the actual Func node (dialect-tagged via + // the target return type's static .dialect). + const matchers = m.argTypes.map((t) => { + const prim = primitiveOf[t]; + return prim + ? `{ type: ${argClass(t)}, allowPrimitive: true }` + : `{ type: ${argClass(t)} }`; + }).join(", "); + const inputArgs = m.argTypes.map((_, i) => `arg${i}`).join(", "); + lines.push(` ${m.tsName}${tsGenerics}(${paramList}): ${retClass}<${nullExpr}> {`); + lines.push(` const [__rt, ...__rest] = runtime.match([${inputArgs}], [[[${matchers}], ${retClass}]]);`); + lines.push(` return runtime.funcCall("${m.sqlName}", [this, ...__rest], __rt) as ${retClass}<${nullExpr}>;`); lines.push(" }"); } lines.push("}"); diff --git a/src/types/sqlite/generated/blob.ts b/src/types/sqlite/generated/blob.ts index 1bfffa9..7f9209c 100644 --- a/src/types/sqlite/generated/blob.ts +++ b/src/types/sqlite/generated/blob.ts @@ -1,12 +1,11 @@ // Auto-generated by src/types/sqlite/generate.ts — do not edit. -// First-pass codegen: one method per (owner-type, function-name); -// same-type-args only. Heterogeneous overloads (e.g. substr) will -// be added via hand-curated overrides (Phase 1.4). +// One method per (owner-type, function-name); same-type-args only. +// Heterogeneous overloads (e.g. substr) will be added via hand- +// curated overrides (Phase 1.4). import { SqliteValue } from "../base"; import { sql, type Sql } from "../../../builder/sql"; import { meta } from "../../runtime"; -import { funcCall } from "../../runtime"; -import type { NullOf, StrictNull } from "../../runtime"; +import * as runtime from "../../runtime"; import * as types from "../index"; export class Blob extends SqliteValue { @@ -24,231 +23,307 @@ export class Blob extends SqliteValue { declare deserialize: (raw: string) => Uint8Array; abs(): types.Real { - return funcCall("abs", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("abs", [this, ...__rest], __rt) as types.Real; } avg(): types.Real { - return funcCall("avg", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("avg", [this, ...__rest], __rt) as types.Real; } char(): types.Text { - return funcCall("char", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("char", [this, ...__rest], __rt) as types.Text; } - concat(arg0: types.Blob): types.Text>> { - return funcCall("concat", [this, arg0], types.Text) as types.Text>>; + concat>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Text]]); + return runtime.funcCall("concat", [this, ...__rest], __rt) as types.Text>>; } count(): types.Integer { - return funcCall("count", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("count", [this, ...__rest], __rt) as types.Integer; } firstValue(): types.Blob { - return funcCall("first_value", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("first_value", [this, ...__rest], __rt) as types.Blob; } format(): types.Text { - return funcCall("format", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("format", [this, ...__rest], __rt) as types.Text; } fts5Insttoken(): types.Blob { - return funcCall("fts5_insttoken", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("fts5_insttoken", [this, ...__rest], __rt) as types.Blob; } - fts5Locale(arg0: types.Blob): types.Blob>> { - return funcCall("fts5_locale", [this, arg0], types.Blob) as types.Blob>>; + fts5Locale>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("fts5_locale", [this, ...__rest], __rt) as types.Blob>>; } - glob(arg0: types.Blob): types.Integer>> { - return funcCall("glob", [this, arg0], types.Integer) as types.Integer>>; + glob>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Integer]]); + return runtime.funcCall("glob", [this, ...__rest], __rt) as types.Integer>>; } groupConcat(): types.Text { - return funcCall("group_concat", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("group_concat", [this, ...__rest], __rt) as types.Text; } hex(): types.Text { - return funcCall("hex", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("hex", [this, ...__rest], __rt) as types.Text; } - ifnull(arg0: types.Blob): types.Blob>> { - return funcCall("ifnull", [this, arg0], types.Blob) as types.Blob>>; + ifnull>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("ifnull", [this, ...__rest], __rt) as types.Blob>>; } - instr(arg0: types.Blob): types.Integer>> { - return funcCall("instr", [this, arg0], types.Integer) as types.Integer>>; + instr>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Integer]]); + return runtime.funcCall("instr", [this, ...__rest], __rt) as types.Integer>>; } json(): types.Text { - return funcCall("json", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json", [this, ...__rest], __rt) as types.Text; } jsonArray(): types.Text { - return funcCall("json_array", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array", [this, ...__rest], __rt) as types.Text; } jsonArrayInsert(): types.Text { - return funcCall("json_array_insert", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array_insert", [this, ...__rest], __rt) as types.Text; } jsonArrayLength(): types.Integer { - return funcCall("json_array_length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_array_length", [this, ...__rest], __rt) as types.Integer; } jsonb(): types.Blob { - return funcCall("jsonb", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb", [this, ...__rest], __rt) as types.Blob; } jsonbArray(): types.Blob { - return funcCall("jsonb_array", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array", [this, ...__rest], __rt) as types.Blob; } jsonbArrayInsert(): types.Blob { - return funcCall("jsonb_array_insert", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array_insert", [this, ...__rest], __rt) as types.Blob; } jsonbGroupArray(): types.Blob { - return funcCall("jsonb_group_array", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_group_array", [this, ...__rest], __rt) as types.Blob; } - jsonbGroupObject(arg0: types.Blob): types.Blob>> { - return funcCall("jsonb_group_object", [this, arg0], types.Blob) as types.Blob>>; + jsonbGroupObject>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("jsonb_group_object", [this, ...__rest], __rt) as types.Blob>>; } jsonbInsert(): types.Blob { - return funcCall("jsonb_insert", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_insert", [this, ...__rest], __rt) as types.Blob; } - jsonbPatch(arg0: types.Blob): types.Blob>> { - return funcCall("jsonb_patch", [this, arg0], types.Blob) as types.Blob>>; + jsonbPatch>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("jsonb_patch", [this, ...__rest], __rt) as types.Blob>>; } jsonbRemove(): types.Blob { - return funcCall("jsonb_remove", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_remove", [this, ...__rest], __rt) as types.Blob; } jsonbReplace(): types.Blob { - return funcCall("jsonb_replace", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_replace", [this, ...__rest], __rt) as types.Blob; } jsonbSet(): types.Blob { - return funcCall("jsonb_set", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_set", [this, ...__rest], __rt) as types.Blob; } jsonErrorPosition(): types.Integer { - return funcCall("json_error_position", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_error_position", [this, ...__rest], __rt) as types.Integer; } jsonGroupArray(): types.Text { - return funcCall("json_group_array", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_group_array", [this, ...__rest], __rt) as types.Text; } - jsonGroupObject(arg0: types.Blob): types.Text>> { - return funcCall("json_group_object", [this, arg0], types.Text) as types.Text>>; + jsonGroupObject>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Text]]); + return runtime.funcCall("json_group_object", [this, ...__rest], __rt) as types.Text>>; } jsonInsert(): types.Text { - return funcCall("json_insert", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_insert", [this, ...__rest], __rt) as types.Text; } - jsonPatch(arg0: types.Blob): types.Text>> { - return funcCall("json_patch", [this, arg0], types.Text) as types.Text>>; + jsonPatch>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Text]]); + return runtime.funcCall("json_patch", [this, ...__rest], __rt) as types.Text>>; } jsonPretty(): types.Text { - return funcCall("json_pretty", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_pretty", [this, ...__rest], __rt) as types.Text; } jsonQuote(): types.Text { - return funcCall("json_quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_quote", [this, ...__rest], __rt) as types.Text; } jsonRemove(): types.Text { - return funcCall("json_remove", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_remove", [this, ...__rest], __rt) as types.Text; } jsonReplace(): types.Text { - return funcCall("json_replace", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_replace", [this, ...__rest], __rt) as types.Text; } jsonSet(): types.Text { - return funcCall("json_set", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_set", [this, ...__rest], __rt) as types.Text; } jsonType(): types.Text { - return funcCall("json_type", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_type", [this, ...__rest], __rt) as types.Text; } jsonValid(): types.Integer { - return funcCall("json_valid", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_valid", [this, ...__rest], __rt) as types.Integer; } - lag(arg0: types.Blob): types.Blob>> { - return funcCall("lag", [this, arg0], types.Blob) as types.Blob>>; + lag>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("lag", [this, ...__rest], __rt) as types.Blob>>; } lastValue(): types.Blob { - return funcCall("last_value", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("last_value", [this, ...__rest], __rt) as types.Blob; } - lead(arg0: types.Blob): types.Blob>> { - return funcCall("lead", [this, arg0], types.Blob) as types.Blob>>; + lead>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("lead", [this, ...__rest], __rt) as types.Blob>>; } length(): types.Integer { - return funcCall("length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("length", [this, ...__rest], __rt) as types.Integer; } - like(arg0: types.Blob): types.Integer>> { - return funcCall("like", [this, arg0], types.Integer) as types.Integer>>; + like>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Integer]]); + return runtime.funcCall("like", [this, ...__rest], __rt) as types.Integer>>; } likely(): types.Blob { - return funcCall("likely", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("likely", [this, ...__rest], __rt) as types.Blob; } lower(): types.Text { - return funcCall("lower", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("lower", [this, ...__rest], __rt) as types.Text; } ltrim(): types.Text { - return funcCall("ltrim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("ltrim", [this, ...__rest], __rt) as types.Text; } max(): types.Blob { - return funcCall("max", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("max", [this, ...__rest], __rt) as types.Blob; } min(): types.Blob { - return funcCall("min", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("min", [this, ...__rest], __rt) as types.Blob; } octetLength(): types.Integer { - return funcCall("octet_length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("octet_length", [this, ...__rest], __rt) as types.Integer; } printf(): types.Text { - return funcCall("printf", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("printf", [this, ...__rest], __rt) as types.Text; } quote(): types.Text { - return funcCall("quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("quote", [this, ...__rest], __rt) as types.Text; } randomblob(): types.Blob { - return funcCall("randomblob", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("randomblob", [this, ...__rest], __rt) as types.Blob; } - replace(arg0: types.Blob, arg1: types.Blob): types.Text | NullOf>> { - return funcCall("replace", [this, arg0, arg1], types.Text) as types.Text | NullOf>>; + replace, M1 extends types.Blob>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { + const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Blob }, { type: types.Blob }], types.Text]]); + return runtime.funcCall("replace", [this, ...__rest], __rt) as types.Text | runtime.NullOf>>; } round(): types.Real { - return funcCall("round", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("round", [this, ...__rest], __rt) as types.Real; } rtrim(): types.Text { - return funcCall("rtrim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("rtrim", [this, ...__rest], __rt) as types.Text; } soundex(): types.Text { - return funcCall("soundex", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("soundex", [this, ...__rest], __rt) as types.Text; } sqliteCompileoptionGet(): types.Text { - return funcCall("sqlite_compileoption_get", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("sqlite_compileoption_get", [this, ...__rest], __rt) as types.Text; } sqliteCompileoptionUsed(): types.Integer { - return funcCall("sqlite_compileoption_used", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sqlite_compileoption_used", [this, ...__rest], __rt) as types.Integer; } strftime(): types.Text { - return funcCall("strftime", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("strftime", [this, ...__rest], __rt) as types.Text; } - stringAgg(arg0: types.Blob): types.Text>> { - return funcCall("string_agg", [this, arg0], types.Text) as types.Text>>; + stringAgg>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Text]]); + return runtime.funcCall("string_agg", [this, ...__rest], __rt) as types.Text>>; } - substr(arg0: types.Blob): types.Blob>> { - return funcCall("substr", [this, arg0], types.Blob) as types.Blob>>; + substr>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("substr", [this, ...__rest], __rt) as types.Blob>>; } - substring(arg0: types.Blob): types.Blob>> { - return funcCall("substring", [this, arg0], types.Blob) as types.Blob>>; + substring>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("substring", [this, ...__rest], __rt) as types.Blob>>; } subtype(): types.Integer { - return funcCall("subtype", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("subtype", [this, ...__rest], __rt) as types.Integer; } sum(): types.Real { - return funcCall("sum", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sum", [this, ...__rest], __rt) as types.Real; } total(): types.Real { - return funcCall("total", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("total", [this, ...__rest], __rt) as types.Real; } trim(): types.Text { - return funcCall("trim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("trim", [this, ...__rest], __rt) as types.Text; } typeof(): types.Text { - return funcCall("typeof", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("typeof", [this, ...__rest], __rt) as types.Text; } - unhex(arg0: types.Blob): types.Blob>> { - return funcCall("unhex", [this, arg0], types.Blob) as types.Blob>>; + unhex>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Blob }], types.Blob]]); + return runtime.funcCall("unhex", [this, ...__rest], __rt) as types.Blob>>; } unicode(): types.Integer { - return funcCall("unicode", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unicode", [this, ...__rest], __rt) as types.Integer; } unistr(): types.Text { - return funcCall("unistr", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr", [this, ...__rest], __rt) as types.Text; } unistrQuote(): types.Text { - return funcCall("unistr_quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr_quote", [this, ...__rest], __rt) as types.Text; } unlikely(): types.Blob { - return funcCall("unlikely", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("unlikely", [this, ...__rest], __rt) as types.Blob; } upper(): types.Text { - return funcCall("upper", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("upper", [this, ...__rest], __rt) as types.Text; } zeroblob(): types.Blob { - return funcCall("zeroblob", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("zeroblob", [this, ...__rest], __rt) as types.Blob; } } diff --git a/src/types/sqlite/generated/integer.ts b/src/types/sqlite/generated/integer.ts index 3fcadda..af36052 100644 --- a/src/types/sqlite/generated/integer.ts +++ b/src/types/sqlite/generated/integer.ts @@ -1,12 +1,11 @@ // Auto-generated by src/types/sqlite/generate.ts — do not edit. -// First-pass codegen: one method per (owner-type, function-name); -// same-type-args only. Heterogeneous overloads (e.g. substr) will -// be added via hand-curated overrides (Phase 1.4). +// One method per (owner-type, function-name); same-type-args only. +// Heterogeneous overloads (e.g. substr) will be added via hand- +// curated overrides (Phase 1.4). import { SqliteValue } from "../base"; import { sql, type Sql } from "../../../builder/sql"; import { meta } from "../../runtime"; -import { funcCall } from "../../runtime"; -import type { NullOf, StrictNull } from "../../runtime"; +import * as runtime from "../../runtime"; import * as types from "../index"; export class Integer extends SqliteValue { @@ -24,351 +23,467 @@ export class Integer extends SqliteValue { declare deserialize: (raw: string) => number; abs(): types.Integer { - return funcCall("abs", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("abs", [this, ...__rest], __rt) as types.Integer; } acos(): types.Real { - return funcCall("acos", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("acos", [this, ...__rest], __rt) as types.Real; } acosh(): types.Real { - return funcCall("acosh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("acosh", [this, ...__rest], __rt) as types.Real; } asin(): types.Real { - return funcCall("asin", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("asin", [this, ...__rest], __rt) as types.Real; } asinh(): types.Real { - return funcCall("asinh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("asinh", [this, ...__rest], __rt) as types.Real; } atan(): types.Real { - return funcCall("atan", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("atan", [this, ...__rest], __rt) as types.Real; } - atan2(arg0: types.Integer): types.Real>> { - return funcCall("atan2", [this, arg0], types.Real) as types.Real>>; + atan2 | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("atan2", [this, ...__rest], __rt) as types.Real>>; } atanh(): types.Real { - return funcCall("atanh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("atanh", [this, ...__rest], __rt) as types.Real; } avg(): types.Real { - return funcCall("avg", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("avg", [this, ...__rest], __rt) as types.Real; } ceil(): types.Integer { - return funcCall("ceil", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("ceil", [this, ...__rest], __rt) as types.Integer; } ceiling(): types.Integer { - return funcCall("ceiling", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("ceiling", [this, ...__rest], __rt) as types.Integer; } char(): types.Text { - return funcCall("char", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("char", [this, ...__rest], __rt) as types.Text; } - concat(arg0: types.Integer): types.Text>> { - return funcCall("concat", [this, arg0], types.Text) as types.Text>>; + concat | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("concat", [this, ...__rest], __rt) as types.Text>>; } cos(): types.Real { - return funcCall("cos", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("cos", [this, ...__rest], __rt) as types.Real; } cosh(): types.Real { - return funcCall("cosh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("cosh", [this, ...__rest], __rt) as types.Real; } count(): types.Integer { - return funcCall("count", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("count", [this, ...__rest], __rt) as types.Integer; } date(): types.Text { - return funcCall("date", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("date", [this, ...__rest], __rt) as types.Text; } datetime(): types.Text { - return funcCall("datetime", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("datetime", [this, ...__rest], __rt) as types.Text; } degrees(): types.Real { - return funcCall("degrees", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("degrees", [this, ...__rest], __rt) as types.Real; } exp(): types.Real { - return funcCall("exp", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("exp", [this, ...__rest], __rt) as types.Real; } firstValue(): types.Integer { - return funcCall("first_value", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("first_value", [this, ...__rest], __rt) as types.Integer; } floor(): types.Integer { - return funcCall("floor", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("floor", [this, ...__rest], __rt) as types.Integer; } format(): types.Text { - return funcCall("format", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("format", [this, ...__rest], __rt) as types.Text; } fts5Insttoken(): types.Integer { - return funcCall("fts5_insttoken", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("fts5_insttoken", [this, ...__rest], __rt) as types.Integer; } - fts5Locale(arg0: types.Integer): types.Blob>> { - return funcCall("fts5_locale", [this, arg0], types.Blob) as types.Blob>>; + fts5Locale | number>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("fts5_locale", [this, ...__rest], __rt) as types.Blob>>; } - glob(arg0: types.Integer): types.Integer>> { - return funcCall("glob", [this, arg0], types.Integer) as types.Integer>>; + glob | number>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("glob", [this, ...__rest], __rt) as types.Integer>>; } groupConcat(): types.Text { - return funcCall("group_concat", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("group_concat", [this, ...__rest], __rt) as types.Text; } hex(): types.Text { - return funcCall("hex", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("hex", [this, ...__rest], __rt) as types.Text; } - ifnull(arg0: types.Integer): types.Integer>> { - return funcCall("ifnull", [this, arg0], types.Integer) as types.Integer>>; + ifnull | number>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("ifnull", [this, ...__rest], __rt) as types.Integer>>; } - instr(arg0: types.Integer): types.Integer>> { - return funcCall("instr", [this, arg0], types.Integer) as types.Integer>>; + instr | number>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("instr", [this, ...__rest], __rt) as types.Integer>>; } json(): types.Text { - return funcCall("json", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json", [this, ...__rest], __rt) as types.Text; } jsonArray(): types.Text { - return funcCall("json_array", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array", [this, ...__rest], __rt) as types.Text; } jsonArrayInsert(): types.Text { - return funcCall("json_array_insert", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array_insert", [this, ...__rest], __rt) as types.Text; } jsonArrayLength(): types.Integer { - return funcCall("json_array_length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_array_length", [this, ...__rest], __rt) as types.Integer; } jsonb(): types.Blob { - return funcCall("jsonb", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb", [this, ...__rest], __rt) as types.Blob; } jsonbArray(): types.Blob { - return funcCall("jsonb_array", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array", [this, ...__rest], __rt) as types.Blob; } jsonbArrayInsert(): types.Blob { - return funcCall("jsonb_array_insert", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array_insert", [this, ...__rest], __rt) as types.Blob; } jsonbGroupArray(): types.Blob { - return funcCall("jsonb_group_array", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_group_array", [this, ...__rest], __rt) as types.Blob; } - jsonbGroupObject(arg0: types.Integer): types.Blob>> { - return funcCall("jsonb_group_object", [this, arg0], types.Blob) as types.Blob>>; + jsonbGroupObject | number>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("jsonb_group_object", [this, ...__rest], __rt) as types.Blob>>; } jsonbInsert(): types.Blob { - return funcCall("jsonb_insert", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_insert", [this, ...__rest], __rt) as types.Blob; } - jsonbPatch(arg0: types.Integer): types.Blob>> { - return funcCall("jsonb_patch", [this, arg0], types.Blob) as types.Blob>>; + jsonbPatch | number>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("jsonb_patch", [this, ...__rest], __rt) as types.Blob>>; } jsonbRemove(): types.Blob { - return funcCall("jsonb_remove", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_remove", [this, ...__rest], __rt) as types.Blob; } jsonbReplace(): types.Blob { - return funcCall("jsonb_replace", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_replace", [this, ...__rest], __rt) as types.Blob; } jsonbSet(): types.Blob { - return funcCall("jsonb_set", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_set", [this, ...__rest], __rt) as types.Blob; } jsonErrorPosition(): types.Integer { - return funcCall("json_error_position", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_error_position", [this, ...__rest], __rt) as types.Integer; } jsonGroupArray(): types.Text { - return funcCall("json_group_array", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_group_array", [this, ...__rest], __rt) as types.Text; } - jsonGroupObject(arg0: types.Integer): types.Text>> { - return funcCall("json_group_object", [this, arg0], types.Text) as types.Text>>; + jsonGroupObject | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("json_group_object", [this, ...__rest], __rt) as types.Text>>; } jsonInsert(): types.Text { - return funcCall("json_insert", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_insert", [this, ...__rest], __rt) as types.Text; } - jsonPatch(arg0: types.Integer): types.Text>> { - return funcCall("json_patch", [this, arg0], types.Text) as types.Text>>; + jsonPatch | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("json_patch", [this, ...__rest], __rt) as types.Text>>; } jsonPretty(): types.Text { - return funcCall("json_pretty", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_pretty", [this, ...__rest], __rt) as types.Text; } jsonQuote(): types.Text { - return funcCall("json_quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_quote", [this, ...__rest], __rt) as types.Text; } jsonRemove(): types.Text { - return funcCall("json_remove", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_remove", [this, ...__rest], __rt) as types.Text; } jsonReplace(): types.Text { - return funcCall("json_replace", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_replace", [this, ...__rest], __rt) as types.Text; } jsonSet(): types.Text { - return funcCall("json_set", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_set", [this, ...__rest], __rt) as types.Text; } jsonType(): types.Text { - return funcCall("json_type", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_type", [this, ...__rest], __rt) as types.Text; } jsonValid(): types.Integer { - return funcCall("json_valid", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_valid", [this, ...__rest], __rt) as types.Integer; } julianday(): types.Real { - return funcCall("julianday", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("julianday", [this, ...__rest], __rt) as types.Real; } - lag(arg0: types.Integer, arg1: types.Integer): types.Integer | NullOf>> { - return funcCall("lag", [this, arg0, arg1], types.Integer) as types.Integer | NullOf>>; + lag | number, M1 extends types.Integer | number>(arg0: M0, arg1: M1): types.Integer | runtime.NullOf>> { + const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Integer, allowPrimitive: true }, { type: types.Integer, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("lag", [this, ...__rest], __rt) as types.Integer | runtime.NullOf>>; } lastValue(): types.Integer { - return funcCall("last_value", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("last_value", [this, ...__rest], __rt) as types.Integer; } - lead(arg0: types.Integer, arg1: types.Integer): types.Integer | NullOf>> { - return funcCall("lead", [this, arg0, arg1], types.Integer) as types.Integer | NullOf>>; + lead | number, M1 extends types.Integer | number>(arg0: M0, arg1: M1): types.Integer | runtime.NullOf>> { + const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Integer, allowPrimitive: true }, { type: types.Integer, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("lead", [this, ...__rest], __rt) as types.Integer | runtime.NullOf>>; } length(): types.Integer { - return funcCall("length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("length", [this, ...__rest], __rt) as types.Integer; } - like(arg0: types.Integer): types.Integer>> { - return funcCall("like", [this, arg0], types.Integer) as types.Integer>>; + like | number>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("like", [this, ...__rest], __rt) as types.Integer>>; } likely(): types.Integer { - return funcCall("likely", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("likely", [this, ...__rest], __rt) as types.Integer; } ln(): types.Real { - return funcCall("ln", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("ln", [this, ...__rest], __rt) as types.Real; } log(): types.Real { - return funcCall("log", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log", [this, ...__rest], __rt) as types.Real; } log10(): types.Real { - return funcCall("log10", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log10", [this, ...__rest], __rt) as types.Real; } log2(): types.Real { - return funcCall("log2", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log2", [this, ...__rest], __rt) as types.Real; } lower(): types.Text { - return funcCall("lower", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("lower", [this, ...__rest], __rt) as types.Text; } ltrim(): types.Text { - return funcCall("ltrim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("ltrim", [this, ...__rest], __rt) as types.Text; } max(): types.Integer { - return funcCall("max", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("max", [this, ...__rest], __rt) as types.Integer; } median(): types.Real { - return funcCall("median", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("median", [this, ...__rest], __rt) as types.Real; } min(): types.Integer { - return funcCall("min", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("min", [this, ...__rest], __rt) as types.Integer; } - mod(arg0: types.Integer): types.Real>> { - return funcCall("mod", [this, arg0], types.Real) as types.Real>>; + mod | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("mod", [this, ...__rest], __rt) as types.Real>>; } - nthValue(arg0: types.Integer): types.Integer>> { - return funcCall("nth_value", [this, arg0], types.Integer) as types.Integer>>; + nthValue | number>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("nth_value", [this, ...__rest], __rt) as types.Integer>>; } ntile(): types.Integer { - return funcCall("ntile", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("ntile", [this, ...__rest], __rt) as types.Integer; } octetLength(): types.Integer { - return funcCall("octet_length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("octet_length", [this, ...__rest], __rt) as types.Integer; } - percentile(arg0: types.Integer): types.Real>> { - return funcCall("percentile", [this, arg0], types.Real) as types.Real>>; + percentile | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("percentile", [this, ...__rest], __rt) as types.Real>>; } - percentileCont(arg0: types.Integer): types.Real>> { - return funcCall("percentile_cont", [this, arg0], types.Real) as types.Real>>; + percentileCont | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("percentile_cont", [this, ...__rest], __rt) as types.Real>>; } - percentileDisc(arg0: types.Integer): types.Real>> { - return funcCall("percentile_disc", [this, arg0], types.Real) as types.Real>>; + percentileDisc | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("percentile_disc", [this, ...__rest], __rt) as types.Real>>; } - pow(arg0: types.Integer): types.Real>> { - return funcCall("pow", [this, arg0], types.Real) as types.Real>>; + pow | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("pow", [this, ...__rest], __rt) as types.Real>>; } - power(arg0: types.Integer): types.Real>> { - return funcCall("power", [this, arg0], types.Real) as types.Real>>; + power | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("power", [this, ...__rest], __rt) as types.Real>>; } printf(): types.Text { - return funcCall("printf", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("printf", [this, ...__rest], __rt) as types.Text; } quote(): types.Text { - return funcCall("quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("quote", [this, ...__rest], __rt) as types.Text; } radians(): types.Real { - return funcCall("radians", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("radians", [this, ...__rest], __rt) as types.Real; } randomblob(): types.Blob { - return funcCall("randomblob", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("randomblob", [this, ...__rest], __rt) as types.Blob; } - replace(arg0: types.Integer, arg1: types.Integer): types.Text | NullOf>> { - return funcCall("replace", [this, arg0, arg1], types.Text) as types.Text | NullOf>>; + replace | number, M1 extends types.Integer | number>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { + const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Integer, allowPrimitive: true }, { type: types.Integer, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("replace", [this, ...__rest], __rt) as types.Text | runtime.NullOf>>; } round(): types.Real { - return funcCall("round", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("round", [this, ...__rest], __rt) as types.Real; } rtrim(): types.Text { - return funcCall("rtrim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("rtrim", [this, ...__rest], __rt) as types.Text; } sign(): types.Integer { - return funcCall("sign", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sign", [this, ...__rest], __rt) as types.Integer; } sin(): types.Real { - return funcCall("sin", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sin", [this, ...__rest], __rt) as types.Real; } sinh(): types.Real { - return funcCall("sinh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sinh", [this, ...__rest], __rt) as types.Real; } soundex(): types.Text { - return funcCall("soundex", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("soundex", [this, ...__rest], __rt) as types.Text; } sqliteCompileoptionGet(): types.Text { - return funcCall("sqlite_compileoption_get", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("sqlite_compileoption_get", [this, ...__rest], __rt) as types.Text; } sqliteCompileoptionUsed(): types.Integer { - return funcCall("sqlite_compileoption_used", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sqlite_compileoption_used", [this, ...__rest], __rt) as types.Integer; } sqrt(): types.Real { - return funcCall("sqrt", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sqrt", [this, ...__rest], __rt) as types.Real; } strftime(): types.Text { - return funcCall("strftime", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("strftime", [this, ...__rest], __rt) as types.Text; } - stringAgg(arg0: types.Integer): types.Text>> { - return funcCall("string_agg", [this, arg0], types.Text) as types.Text>>; + stringAgg | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("string_agg", [this, ...__rest], __rt) as types.Text>>; } - substr(arg0: types.Integer): types.Text>> { - return funcCall("substr", [this, arg0], types.Text) as types.Text>>; + substr | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("substr", [this, ...__rest], __rt) as types.Text>>; } - substring(arg0: types.Integer): types.Text>> { - return funcCall("substring", [this, arg0], types.Text) as types.Text>>; + substring | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("substring", [this, ...__rest], __rt) as types.Text>>; } subtype(): types.Integer { - return funcCall("subtype", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("subtype", [this, ...__rest], __rt) as types.Integer; } sum(): types.Integer { - return funcCall("sum", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sum", [this, ...__rest], __rt) as types.Integer; } tan(): types.Real { - return funcCall("tan", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("tan", [this, ...__rest], __rt) as types.Real; } tanh(): types.Real { - return funcCall("tanh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("tanh", [this, ...__rest], __rt) as types.Real; } time(): types.Text { - return funcCall("time", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("time", [this, ...__rest], __rt) as types.Text; } - timediff(arg0: types.Integer): types.Text>> { - return funcCall("timediff", [this, arg0], types.Text) as types.Text>>; + timediff | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Integer, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("timediff", [this, ...__rest], __rt) as types.Text>>; } total(): types.Real { - return funcCall("total", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("total", [this, ...__rest], __rt) as types.Real; } trim(): types.Text { - return funcCall("trim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("trim", [this, ...__rest], __rt) as types.Text; } trunc(): types.Integer { - return funcCall("trunc", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("trunc", [this, ...__rest], __rt) as types.Integer; } typeof(): types.Text { - return funcCall("typeof", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("typeof", [this, ...__rest], __rt) as types.Text; } unicode(): types.Integer { - return funcCall("unicode", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unicode", [this, ...__rest], __rt) as types.Integer; } unistr(): types.Text { - return funcCall("unistr", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr", [this, ...__rest], __rt) as types.Text; } unistrQuote(): types.Text { - return funcCall("unistr_quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr_quote", [this, ...__rest], __rt) as types.Text; } unixepoch(): types.Integer { - return funcCall("unixepoch", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unixepoch", [this, ...__rest], __rt) as types.Integer; } unlikely(): types.Integer { - return funcCall("unlikely", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unlikely", [this, ...__rest], __rt) as types.Integer; } upper(): types.Text { - return funcCall("upper", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("upper", [this, ...__rest], __rt) as types.Text; } zeroblob(): types.Blob { - return funcCall("zeroblob", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("zeroblob", [this, ...__rest], __rt) as types.Blob; } } diff --git a/src/types/sqlite/generated/real.ts b/src/types/sqlite/generated/real.ts index f1d9765..29c462e 100644 --- a/src/types/sqlite/generated/real.ts +++ b/src/types/sqlite/generated/real.ts @@ -1,12 +1,11 @@ // Auto-generated by src/types/sqlite/generate.ts — do not edit. -// First-pass codegen: one method per (owner-type, function-name); -// same-type-args only. Heterogeneous overloads (e.g. substr) will -// be added via hand-curated overrides (Phase 1.4). +// One method per (owner-type, function-name); same-type-args only. +// Heterogeneous overloads (e.g. substr) will be added via hand- +// curated overrides (Phase 1.4). import { SqliteValue } from "../base"; import { sql, type Sql } from "../../../builder/sql"; import { meta } from "../../runtime"; -import { funcCall } from "../../runtime"; -import type { NullOf, StrictNull } from "../../runtime"; +import * as runtime from "../../runtime"; import * as types from "../index"; export class Real extends SqliteValue { @@ -24,333 +23,443 @@ export class Real extends SqliteValue { declare deserialize: (raw: string) => number; abs(): types.Real { - return funcCall("abs", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("abs", [this, ...__rest], __rt) as types.Real; } acosh(): types.Real { - return funcCall("acosh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("acosh", [this, ...__rest], __rt) as types.Real; } asinh(): types.Real { - return funcCall("asinh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("asinh", [this, ...__rest], __rt) as types.Real; } atan(): types.Real { - return funcCall("atan", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("atan", [this, ...__rest], __rt) as types.Real; } - atan2(arg0: types.Real): types.Real>> { - return funcCall("atan2", [this, arg0], types.Real) as types.Real>>; + atan2 | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("atan2", [this, ...__rest], __rt) as types.Real>>; } avg(): types.Real { - return funcCall("avg", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("avg", [this, ...__rest], __rt) as types.Real; } ceil(): types.Real { - return funcCall("ceil", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("ceil", [this, ...__rest], __rt) as types.Real; } ceiling(): types.Real { - return funcCall("ceiling", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("ceiling", [this, ...__rest], __rt) as types.Real; } char(): types.Text { - return funcCall("char", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("char", [this, ...__rest], __rt) as types.Text; } - concat(arg0: types.Real): types.Text>> { - return funcCall("concat", [this, arg0], types.Text) as types.Text>>; + concat | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("concat", [this, ...__rest], __rt) as types.Text>>; } cos(): types.Real { - return funcCall("cos", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("cos", [this, ...__rest], __rt) as types.Real; } cosh(): types.Real { - return funcCall("cosh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("cosh", [this, ...__rest], __rt) as types.Real; } count(): types.Integer { - return funcCall("count", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("count", [this, ...__rest], __rt) as types.Integer; } date(): types.Text { - return funcCall("date", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("date", [this, ...__rest], __rt) as types.Text; } datetime(): types.Text { - return funcCall("datetime", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("datetime", [this, ...__rest], __rt) as types.Text; } degrees(): types.Real { - return funcCall("degrees", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("degrees", [this, ...__rest], __rt) as types.Real; } exp(): types.Real { - return funcCall("exp", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("exp", [this, ...__rest], __rt) as types.Real; } firstValue(): types.Real { - return funcCall("first_value", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("first_value", [this, ...__rest], __rt) as types.Real; } floor(): types.Real { - return funcCall("floor", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("floor", [this, ...__rest], __rt) as types.Real; } format(): types.Text { - return funcCall("format", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("format", [this, ...__rest], __rt) as types.Text; } fts5Insttoken(): types.Real { - return funcCall("fts5_insttoken", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("fts5_insttoken", [this, ...__rest], __rt) as types.Real; } - fts5Locale(arg0: types.Real): types.Blob>> { - return funcCall("fts5_locale", [this, arg0], types.Blob) as types.Blob>>; + fts5Locale | number>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("fts5_locale", [this, ...__rest], __rt) as types.Blob>>; } - glob(arg0: types.Real): types.Integer>> { - return funcCall("glob", [this, arg0], types.Integer) as types.Integer>>; + glob | number>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("glob", [this, ...__rest], __rt) as types.Integer>>; } groupConcat(): types.Text { - return funcCall("group_concat", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("group_concat", [this, ...__rest], __rt) as types.Text; } hex(): types.Text { - return funcCall("hex", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("hex", [this, ...__rest], __rt) as types.Text; } - ifnull(arg0: types.Real): types.Real>> { - return funcCall("ifnull", [this, arg0], types.Real) as types.Real>>; + ifnull | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("ifnull", [this, ...__rest], __rt) as types.Real>>; } - instr(arg0: types.Real): types.Integer>> { - return funcCall("instr", [this, arg0], types.Integer) as types.Integer>>; + instr | number>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("instr", [this, ...__rest], __rt) as types.Integer>>; } json(): types.Text { - return funcCall("json", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json", [this, ...__rest], __rt) as types.Text; } jsonArray(): types.Text { - return funcCall("json_array", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array", [this, ...__rest], __rt) as types.Text; } jsonArrayInsert(): types.Text { - return funcCall("json_array_insert", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array_insert", [this, ...__rest], __rt) as types.Text; } jsonArrayLength(): types.Integer { - return funcCall("json_array_length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_array_length", [this, ...__rest], __rt) as types.Integer; } jsonb(): types.Blob { - return funcCall("jsonb", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb", [this, ...__rest], __rt) as types.Blob; } jsonbArray(): types.Blob { - return funcCall("jsonb_array", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array", [this, ...__rest], __rt) as types.Blob; } jsonbArrayInsert(): types.Blob { - return funcCall("jsonb_array_insert", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array_insert", [this, ...__rest], __rt) as types.Blob; } jsonbGroupArray(): types.Blob { - return funcCall("jsonb_group_array", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_group_array", [this, ...__rest], __rt) as types.Blob; } - jsonbGroupObject(arg0: types.Real): types.Blob>> { - return funcCall("jsonb_group_object", [this, arg0], types.Blob) as types.Blob>>; + jsonbGroupObject | number>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("jsonb_group_object", [this, ...__rest], __rt) as types.Blob>>; } jsonbInsert(): types.Blob { - return funcCall("jsonb_insert", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_insert", [this, ...__rest], __rt) as types.Blob; } - jsonbPatch(arg0: types.Real): types.Blob>> { - return funcCall("jsonb_patch", [this, arg0], types.Blob) as types.Blob>>; + jsonbPatch | number>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("jsonb_patch", [this, ...__rest], __rt) as types.Blob>>; } jsonbRemove(): types.Blob { - return funcCall("jsonb_remove", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_remove", [this, ...__rest], __rt) as types.Blob; } jsonbReplace(): types.Blob { - return funcCall("jsonb_replace", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_replace", [this, ...__rest], __rt) as types.Blob; } jsonbSet(): types.Blob { - return funcCall("jsonb_set", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_set", [this, ...__rest], __rt) as types.Blob; } jsonErrorPosition(): types.Integer { - return funcCall("json_error_position", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_error_position", [this, ...__rest], __rt) as types.Integer; } jsonGroupArray(): types.Text { - return funcCall("json_group_array", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_group_array", [this, ...__rest], __rt) as types.Text; } - jsonGroupObject(arg0: types.Real): types.Text>> { - return funcCall("json_group_object", [this, arg0], types.Text) as types.Text>>; + jsonGroupObject | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("json_group_object", [this, ...__rest], __rt) as types.Text>>; } jsonInsert(): types.Text { - return funcCall("json_insert", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_insert", [this, ...__rest], __rt) as types.Text; } - jsonPatch(arg0: types.Real): types.Text>> { - return funcCall("json_patch", [this, arg0], types.Text) as types.Text>>; + jsonPatch | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("json_patch", [this, ...__rest], __rt) as types.Text>>; } jsonPretty(): types.Text { - return funcCall("json_pretty", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_pretty", [this, ...__rest], __rt) as types.Text; } jsonQuote(): types.Text { - return funcCall("json_quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_quote", [this, ...__rest], __rt) as types.Text; } jsonRemove(): types.Text { - return funcCall("json_remove", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_remove", [this, ...__rest], __rt) as types.Text; } jsonReplace(): types.Text { - return funcCall("json_replace", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_replace", [this, ...__rest], __rt) as types.Text; } jsonSet(): types.Text { - return funcCall("json_set", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_set", [this, ...__rest], __rt) as types.Text; } jsonType(): types.Text { - return funcCall("json_type", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_type", [this, ...__rest], __rt) as types.Text; } jsonValid(): types.Integer { - return funcCall("json_valid", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_valid", [this, ...__rest], __rt) as types.Integer; } julianday(): types.Real { - return funcCall("julianday", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("julianday", [this, ...__rest], __rt) as types.Real; } - lag(arg0: types.Real, arg1: types.Real): types.Real | NullOf>> { - return funcCall("lag", [this, arg0, arg1], types.Real) as types.Real | NullOf>>; + lag | number, M1 extends types.Real | number>(arg0: M0, arg1: M1): types.Real | runtime.NullOf>> { + const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Real, allowPrimitive: true }, { type: types.Real, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("lag", [this, ...__rest], __rt) as types.Real | runtime.NullOf>>; } lastValue(): types.Real { - return funcCall("last_value", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("last_value", [this, ...__rest], __rt) as types.Real; } - lead(arg0: types.Real, arg1: types.Real): types.Real | NullOf>> { - return funcCall("lead", [this, arg0, arg1], types.Real) as types.Real | NullOf>>; + lead | number, M1 extends types.Real | number>(arg0: M0, arg1: M1): types.Real | runtime.NullOf>> { + const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Real, allowPrimitive: true }, { type: types.Real, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("lead", [this, ...__rest], __rt) as types.Real | runtime.NullOf>>; } length(): types.Integer { - return funcCall("length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("length", [this, ...__rest], __rt) as types.Integer; } - like(arg0: types.Real): types.Integer>> { - return funcCall("like", [this, arg0], types.Integer) as types.Integer>>; + like | number>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("like", [this, ...__rest], __rt) as types.Integer>>; } likely(): types.Real { - return funcCall("likely", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("likely", [this, ...__rest], __rt) as types.Real; } ln(): types.Real { - return funcCall("ln", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("ln", [this, ...__rest], __rt) as types.Real; } log(): types.Real { - return funcCall("log", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log", [this, ...__rest], __rt) as types.Real; } log10(): types.Real { - return funcCall("log10", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log10", [this, ...__rest], __rt) as types.Real; } log2(): types.Real { - return funcCall("log2", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log2", [this, ...__rest], __rt) as types.Real; } lower(): types.Text { - return funcCall("lower", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("lower", [this, ...__rest], __rt) as types.Text; } ltrim(): types.Text { - return funcCall("ltrim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("ltrim", [this, ...__rest], __rt) as types.Text; } max(): types.Real { - return funcCall("max", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("max", [this, ...__rest], __rt) as types.Real; } median(): types.Real { - return funcCall("median", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("median", [this, ...__rest], __rt) as types.Real; } min(): types.Real { - return funcCall("min", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("min", [this, ...__rest], __rt) as types.Real; } - mod(arg0: types.Real): types.Real>> { - return funcCall("mod", [this, arg0], types.Real) as types.Real>>; + mod | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("mod", [this, ...__rest], __rt) as types.Real>>; } ntile(): types.Integer { - return funcCall("ntile", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("ntile", [this, ...__rest], __rt) as types.Integer; } octetLength(): types.Integer { - return funcCall("octet_length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("octet_length", [this, ...__rest], __rt) as types.Integer; } - percentile(arg0: types.Real): types.Real>> { - return funcCall("percentile", [this, arg0], types.Real) as types.Real>>; + percentile | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("percentile", [this, ...__rest], __rt) as types.Real>>; } - pow(arg0: types.Real): types.Real>> { - return funcCall("pow", [this, arg0], types.Real) as types.Real>>; + pow | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("pow", [this, ...__rest], __rt) as types.Real>>; } - power(arg0: types.Real): types.Real>> { - return funcCall("power", [this, arg0], types.Real) as types.Real>>; + power | number>(arg0: M0): types.Real>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Real]]); + return runtime.funcCall("power", [this, ...__rest], __rt) as types.Real>>; } printf(): types.Text { - return funcCall("printf", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("printf", [this, ...__rest], __rt) as types.Text; } quote(): types.Text { - return funcCall("quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("quote", [this, ...__rest], __rt) as types.Text; } radians(): types.Real { - return funcCall("radians", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("radians", [this, ...__rest], __rt) as types.Real; } randomblob(): types.Blob { - return funcCall("randomblob", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("randomblob", [this, ...__rest], __rt) as types.Blob; } - replace(arg0: types.Real, arg1: types.Real): types.Text | NullOf>> { - return funcCall("replace", [this, arg0, arg1], types.Text) as types.Text | NullOf>>; + replace | number, M1 extends types.Real | number>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { + const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Real, allowPrimitive: true }, { type: types.Real, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("replace", [this, ...__rest], __rt) as types.Text | runtime.NullOf>>; } round(): types.Real { - return funcCall("round", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("round", [this, ...__rest], __rt) as types.Real; } rtrim(): types.Text { - return funcCall("rtrim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("rtrim", [this, ...__rest], __rt) as types.Text; } sign(): types.Integer { - return funcCall("sign", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sign", [this, ...__rest], __rt) as types.Integer; } sin(): types.Real { - return funcCall("sin", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sin", [this, ...__rest], __rt) as types.Real; } sinh(): types.Real { - return funcCall("sinh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sinh", [this, ...__rest], __rt) as types.Real; } soundex(): types.Text { - return funcCall("soundex", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("soundex", [this, ...__rest], __rt) as types.Text; } sqliteCompileoptionGet(): types.Text { - return funcCall("sqlite_compileoption_get", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("sqlite_compileoption_get", [this, ...__rest], __rt) as types.Text; } sqliteCompileoptionUsed(): types.Integer { - return funcCall("sqlite_compileoption_used", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sqlite_compileoption_used", [this, ...__rest], __rt) as types.Integer; } sqrt(): types.Real { - return funcCall("sqrt", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sqrt", [this, ...__rest], __rt) as types.Real; } strftime(): types.Text { - return funcCall("strftime", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("strftime", [this, ...__rest], __rt) as types.Text; } - stringAgg(arg0: types.Real): types.Text>> { - return funcCall("string_agg", [this, arg0], types.Text) as types.Text>>; + stringAgg | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("string_agg", [this, ...__rest], __rt) as types.Text>>; } - substr(arg0: types.Real): types.Text>> { - return funcCall("substr", [this, arg0], types.Text) as types.Text>>; + substr | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("substr", [this, ...__rest], __rt) as types.Text>>; } - substring(arg0: types.Real): types.Text>> { - return funcCall("substring", [this, arg0], types.Text) as types.Text>>; + substring | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("substring", [this, ...__rest], __rt) as types.Text>>; } subtype(): types.Integer { - return funcCall("subtype", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("subtype", [this, ...__rest], __rt) as types.Integer; } sum(): types.Real { - return funcCall("sum", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sum", [this, ...__rest], __rt) as types.Real; } tan(): types.Real { - return funcCall("tan", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("tan", [this, ...__rest], __rt) as types.Real; } tanh(): types.Real { - return funcCall("tanh", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("tanh", [this, ...__rest], __rt) as types.Real; } time(): types.Text { - return funcCall("time", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("time", [this, ...__rest], __rt) as types.Text; } - timediff(arg0: types.Real): types.Text>> { - return funcCall("timediff", [this, arg0], types.Text) as types.Text>>; + timediff | number>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Real, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("timediff", [this, ...__rest], __rt) as types.Text>>; } total(): types.Real { - return funcCall("total", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("total", [this, ...__rest], __rt) as types.Real; } trim(): types.Text { - return funcCall("trim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("trim", [this, ...__rest], __rt) as types.Text; } trunc(): types.Real { - return funcCall("trunc", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("trunc", [this, ...__rest], __rt) as types.Real; } typeof(): types.Text { - return funcCall("typeof", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("typeof", [this, ...__rest], __rt) as types.Text; } unicode(): types.Integer { - return funcCall("unicode", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unicode", [this, ...__rest], __rt) as types.Integer; } unistr(): types.Text { - return funcCall("unistr", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr", [this, ...__rest], __rt) as types.Text; } unistrQuote(): types.Text { - return funcCall("unistr_quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr_quote", [this, ...__rest], __rt) as types.Text; } unixepoch(): types.Integer { - return funcCall("unixepoch", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unixepoch", [this, ...__rest], __rt) as types.Integer; } unlikely(): types.Real { - return funcCall("unlikely", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("unlikely", [this, ...__rest], __rt) as types.Real; } upper(): types.Text { - return funcCall("upper", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("upper", [this, ...__rest], __rt) as types.Text; } zeroblob(): types.Blob { - return funcCall("zeroblob", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("zeroblob", [this, ...__rest], __rt) as types.Blob; } } diff --git a/src/types/sqlite/generated/text.ts b/src/types/sqlite/generated/text.ts index 431d375..20e5460 100644 --- a/src/types/sqlite/generated/text.ts +++ b/src/types/sqlite/generated/text.ts @@ -1,12 +1,11 @@ // Auto-generated by src/types/sqlite/generate.ts — do not edit. -// First-pass codegen: one method per (owner-type, function-name); -// same-type-args only. Heterogeneous overloads (e.g. substr) will -// be added via hand-curated overrides (Phase 1.4). +// One method per (owner-type, function-name); same-type-args only. +// Heterogeneous overloads (e.g. substr) will be added via hand- +// curated overrides (Phase 1.4). import { SqliteValue } from "../base"; import { sql, type Sql } from "../../../builder/sql"; import { meta } from "../../runtime"; -import { funcCall } from "../../runtime"; -import type { NullOf, StrictNull } from "../../runtime"; +import * as runtime from "../../runtime"; import * as types from "../index"; export class Text extends SqliteValue { @@ -24,189 +23,251 @@ export class Text extends SqliteValue { declare deserialize: (raw: string) => string; abs(): types.Real { - return funcCall("abs", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("abs", [this, ...__rest], __rt) as types.Real; } avg(): types.Real { - return funcCall("avg", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("avg", [this, ...__rest], __rt) as types.Real; } char(): types.Text { - return funcCall("char", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("char", [this, ...__rest], __rt) as types.Text; } - concat(arg0: types.Text): types.Text>> { - return funcCall("concat", [this, arg0], types.Text) as types.Text>>; + concat | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("concat", [this, ...__rest], __rt) as types.Text>>; } count(): types.Integer { - return funcCall("count", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("count", [this, ...__rest], __rt) as types.Integer; } firstValue(): types.Text { - return funcCall("first_value", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("first_value", [this, ...__rest], __rt) as types.Text; } format(): types.Text { - return funcCall("format", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("format", [this, ...__rest], __rt) as types.Text; } fts5Insttoken(): types.Text { - return funcCall("fts5_insttoken", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("fts5_insttoken", [this, ...__rest], __rt) as types.Text; } - fts5Locale(arg0: types.Text): types.Blob>> { - return funcCall("fts5_locale", [this, arg0], types.Blob) as types.Blob>>; + fts5Locale | string>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("fts5_locale", [this, ...__rest], __rt) as types.Blob>>; } geopolyGroupBbox(): types.Blob { - return funcCall("geopoly_group_bbox", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("geopoly_group_bbox", [this, ...__rest], __rt) as types.Blob; } - glob(arg0: types.Text): types.Integer>> { - return funcCall("glob", [this, arg0], types.Integer) as types.Integer>>; + glob | string>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("glob", [this, ...__rest], __rt) as types.Integer>>; } groupConcat(): types.Text { - return funcCall("group_concat", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("group_concat", [this, ...__rest], __rt) as types.Text; } hex(): types.Text { - return funcCall("hex", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("hex", [this, ...__rest], __rt) as types.Text; } - ifnull(arg0: types.Text): types.Text>> { - return funcCall("ifnull", [this, arg0], types.Text) as types.Text>>; + ifnull | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("ifnull", [this, ...__rest], __rt) as types.Text>>; } - instr(arg0: types.Text): types.Integer>> { - return funcCall("instr", [this, arg0], types.Integer) as types.Integer>>; + instr | string>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("instr", [this, ...__rest], __rt) as types.Integer>>; } jsonArray(): types.Text { - return funcCall("json_array", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array", [this, ...__rest], __rt) as types.Text; } jsonbArray(): types.Blob { - return funcCall("jsonb_array", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array", [this, ...__rest], __rt) as types.Blob; } jsonbGroupArray(): types.Blob { - return funcCall("jsonb_group_array", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_group_array", [this, ...__rest], __rt) as types.Blob; } - jsonbGroupObject(arg0: types.Text): types.Blob>> { - return funcCall("jsonb_group_object", [this, arg0], types.Blob) as types.Blob>>; + jsonbGroupObject | string>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("jsonb_group_object", [this, ...__rest], __rt) as types.Blob>>; } - jsonbObject(arg0: types.Text): types.Blob>> { - return funcCall("jsonb_object", [this, arg0], types.Blob) as types.Blob>>; + jsonbObject | string>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("jsonb_object", [this, ...__rest], __rt) as types.Blob>>; } jsonErrorPosition(): types.Integer { - return funcCall("json_error_position", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_error_position", [this, ...__rest], __rt) as types.Integer; } jsonGroupArray(): types.Text { - return funcCall("json_group_array", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_group_array", [this, ...__rest], __rt) as types.Text; } - jsonGroupObject(arg0: types.Text): types.Text>> { - return funcCall("json_group_object", [this, arg0], types.Text) as types.Text>>; + jsonGroupObject | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("json_group_object", [this, ...__rest], __rt) as types.Text>>; } - jsonObject(arg0: types.Text): types.Text>> { - return funcCall("json_object", [this, arg0], types.Text) as types.Text>>; + jsonObject | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("json_object", [this, ...__rest], __rt) as types.Text>>; } jsonQuote(): types.Text { - return funcCall("json_quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_quote", [this, ...__rest], __rt) as types.Text; } jsonValid(): types.Integer { - return funcCall("json_valid", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_valid", [this, ...__rest], __rt) as types.Integer; } - lag(arg0: types.Text): types.Text>> { - return funcCall("lag", [this, arg0], types.Text) as types.Text>>; + lag | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("lag", [this, ...__rest], __rt) as types.Text>>; } lastValue(): types.Text { - return funcCall("last_value", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("last_value", [this, ...__rest], __rt) as types.Text; } - lead(arg0: types.Text): types.Text>> { - return funcCall("lead", [this, arg0], types.Text) as types.Text>>; + lead | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("lead", [this, ...__rest], __rt) as types.Text>>; } length(): types.Integer { - return funcCall("length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("length", [this, ...__rest], __rt) as types.Integer; } - like(arg0: types.Text): types.Integer>> { - return funcCall("like", [this, arg0], types.Integer) as types.Integer>>; + like | string>(arg0: M0): types.Integer>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Integer]]); + return runtime.funcCall("like", [this, ...__rest], __rt) as types.Integer>>; } likely(): types.Text { - return funcCall("likely", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("likely", [this, ...__rest], __rt) as types.Text; } lower(): types.Text { - return funcCall("lower", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("lower", [this, ...__rest], __rt) as types.Text; } ltrim(): types.Text { - return funcCall("ltrim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("ltrim", [this, ...__rest], __rt) as types.Text; } max(): types.Text { - return funcCall("max", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("max", [this, ...__rest], __rt) as types.Text; } min(): types.Text { - return funcCall("min", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("min", [this, ...__rest], __rt) as types.Text; } octetLength(): types.Integer { - return funcCall("octet_length", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("octet_length", [this, ...__rest], __rt) as types.Integer; } printf(): types.Text { - return funcCall("printf", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("printf", [this, ...__rest], __rt) as types.Text; } quote(): types.Text { - return funcCall("quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("quote", [this, ...__rest], __rt) as types.Text; } randomblob(): types.Blob { - return funcCall("randomblob", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("randomblob", [this, ...__rest], __rt) as types.Blob; } - replace(arg0: types.Text, arg1: types.Text): types.Text | NullOf>> { - return funcCall("replace", [this, arg0, arg1], types.Text) as types.Text | NullOf>>; + replace | string, M1 extends types.Text | string>(arg0: M0, arg1: M1): types.Text | runtime.NullOf>> { + const [__rt, ...__rest] = runtime.match([arg0, arg1], [[[{ type: types.Text, allowPrimitive: true }, { type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("replace", [this, ...__rest], __rt) as types.Text | runtime.NullOf>>; } round(): types.Real { - return funcCall("round", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("round", [this, ...__rest], __rt) as types.Real; } rtrim(): types.Text { - return funcCall("rtrim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("rtrim", [this, ...__rest], __rt) as types.Text; } soundex(): types.Text { - return funcCall("soundex", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("soundex", [this, ...__rest], __rt) as types.Text; } sqliteCompileoptionGet(): types.Text { - return funcCall("sqlite_compileoption_get", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("sqlite_compileoption_get", [this, ...__rest], __rt) as types.Text; } sqliteCompileoptionUsed(): types.Integer { - return funcCall("sqlite_compileoption_used", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sqlite_compileoption_used", [this, ...__rest], __rt) as types.Integer; } strftime(): types.Text { - return funcCall("strftime", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("strftime", [this, ...__rest], __rt) as types.Text; } - stringAgg(arg0: types.Text): types.Text>> { - return funcCall("string_agg", [this, arg0], types.Text) as types.Text>>; + stringAgg | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("string_agg", [this, ...__rest], __rt) as types.Text>>; } - substr(arg0: types.Text): types.Text>> { - return funcCall("substr", [this, arg0], types.Text) as types.Text>>; + substr | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("substr", [this, ...__rest], __rt) as types.Text>>; } - substring(arg0: types.Text): types.Text>> { - return funcCall("substring", [this, arg0], types.Text) as types.Text>>; + substring | string>(arg0: M0): types.Text>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Text]]); + return runtime.funcCall("substring", [this, ...__rest], __rt) as types.Text>>; } subtype(): types.Integer { - return funcCall("subtype", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("subtype", [this, ...__rest], __rt) as types.Integer; } sum(): types.Real { - return funcCall("sum", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sum", [this, ...__rest], __rt) as types.Real; } total(): types.Real { - return funcCall("total", [this], types.Real) as types.Real; + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("total", [this, ...__rest], __rt) as types.Real; } trim(): types.Text { - return funcCall("trim", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("trim", [this, ...__rest], __rt) as types.Text; } typeof(): types.Text { - return funcCall("typeof", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("typeof", [this, ...__rest], __rt) as types.Text; } - unhex(arg0: types.Text): types.Blob>> { - return funcCall("unhex", [this, arg0], types.Blob) as types.Blob>>; + unhex | string>(arg0: M0): types.Blob>> { + const [__rt, ...__rest] = runtime.match([arg0], [[[{ type: types.Text, allowPrimitive: true }], types.Blob]]); + return runtime.funcCall("unhex", [this, ...__rest], __rt) as types.Blob>>; } unicode(): types.Integer { - return funcCall("unicode", [this], types.Integer) as types.Integer; + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unicode", [this, ...__rest], __rt) as types.Integer; } unistr(): types.Text { - return funcCall("unistr", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr", [this, ...__rest], __rt) as types.Text; } unistrQuote(): types.Text { - return funcCall("unistr_quote", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr_quote", [this, ...__rest], __rt) as types.Text; } unlikely(): types.Text { - return funcCall("unlikely", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unlikely", [this, ...__rest], __rt) as types.Text; } upper(): types.Text { - return funcCall("upper", [this], types.Text) as types.Text; + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("upper", [this, ...__rest], __rt) as types.Text; } zeroblob(): types.Blob { - return funcCall("zeroblob", [this], types.Blob) as types.Blob; + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("zeroblob", [this, ...__rest], __rt) as types.Blob; } } diff --git a/src/types/sqlite/smoke.test.ts b/src/types/sqlite/smoke.test.ts index 97359e0..3b43f32 100644 --- a/src/types/sqlite/smoke.test.ts +++ b/src/types/sqlite/smoke.test.ts @@ -88,6 +88,20 @@ test(".in() rejects when no literal matches", async () => { expect(r.rows[0]!["v"]).toBe("0"); }); +test("codegen'd Integer method accepts a JS-native primitive arg", async () => { + // atan2 takes a second Integer arg — the emit shape allows a + // number primitive alongside the typed Integer via runtime.match. + const expr = Integer.from(1).atan2(1); + const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); + expect(parseFloat(r.rows[0]!["v"]!)).toBeCloseTo(Math.PI / 4, 5); +}); + +test("codegen'd method rejects the wrong JS primitive type at runtime", async () => { + // atan2 doesn't accept a string primitive — runtime.match throws. + expect(() => Integer.from(1).atan2("nope" as unknown as number)) + .toThrow(/No matching overload/); +}); + test("placeholder emission uses ? not $N", async () => { // Integer.from(5) wraps in a TypedParam; compile should emit `?`. const expr = Integer.from(5); From 663ca36be7aa546b135a128382a9fab39d067bf4 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:51:18 -0700 Subject: [PATCH 25/33] =?UTF-8?q?docs(issues):=20revert=20ISSUES.md=20#16?= =?UTF-8?q?=20=E2=80=94=20provenance=20work=20shipped?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cross-database provenance concern is now live in the code (Ident/Func/Op/Cast/Srf tagging, sql.ident removed from public helper, provenance-enforcement test suite). No open follow-up worth carrying in the issues doc — instance-scoped typed-value factories are a speculative nice-to-have, not an active gap. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/ISSUES.md | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/docs/ISSUES.md b/docs/ISSUES.md index 09c9c43..0ce78eb 100644 --- a/docs/ISSUES.md +++ b/docs/ISSUES.md @@ -95,49 +95,3 @@ 14. ~~**`.live()` subscriptions**~~ — done (PR #72). Predicate extraction, reverse-index bus, MVCC-snapshot-aware re-iteration. - -16. ~~**Cross-database provenance for typed values (RPC security).**~~ - Shipped. The provenance refactor lands the check at the naming layer: - - - `CompileContext = { database: DatabaseRef }`. `Database` implements - `DatabaseRef` (id: symbol, dialect). Drivers no longer see the Sql - tree — `Database.#exec()` compiles first with its own ctx. - - `Ident` carries an optional `database`. Emitted by `Table.bind()` - / `TableBase.ident()` (both propagate the database from `db.Table`), - by `reAlias()` (inherits from the source Table), and by every - internal mutation-builder call site. At compile time, `Ident.bind(ctx)` - throws if `this.database.id !== ctx.database.id`. - - `Func` / `Op` / `UnaryOp` / `Cast` / `Srf` all carry an optional - `dialect`. `runtime.funcCall` / `runtime.opCall` pass - `type.dialect.name` automatically, so every codegen'd method (both - PG and SQLite) emits a properly-tagged node. `bind(ctx)` throws on - dialect mismatch. - - Static `Table("users")` still exists as the escape hatch (untagged - Idents). Only `db.Table(name)` produces provenance-checked Idents. - Server-authored raw templates and DDL run untagged. - - `.where(true)` no longer constructs a dialect-specific `Bool` — - it's a `matchAll` flag; a real predicate always takes precedence. - - Catches: - - Cross-dialect: PG-tagged Idents/Funcs used in SQLite context throw - at compile with a clear provenance message. - - Cross-tenant: two Database instances have distinct Symbol ids; a - value built for tenant A used in tenant B's context throws. - - Not caught: same-Database cross-session (per-principal `db.scope()` - still owns that boundary). - - Not caught by design (escape hatches): - - Raw `sql\`SELECT * FROM users\`` interpolation of identifiers via - `sql.raw(...)` — server-authored, trusted. Documented as unsafe - for @expose'd code paths. - - Related follow-ups still open: - - Instance-scoped `db.Int4.from(5)` typed-value factories (currently - typed values from `Int4.from(5)` are untagged; only their embedded - Idents get provenance via Table). - - ~~Database/Connection split~~ — done. `new Database({ dialect })` is the - immutable metadata handle at module load; `db.attach(driver)` returns - a runtime `Connection`. Multiple attaches allowed. Builders' - `.execute(conn)` verifies conn.database matches, then compiles with - the tagged ctx. From e5634a47eeedd162d1189dc83a529e85a6d9b21d Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 16:52:52 -0700 Subject: [PATCH 26/33] =?UTF-8?q?refactor:=20drop=20SharedBool=20alias=20?= =?UTF-8?q?=E2=80=94=20PG=20Bool=20import=20is=20gone,=20no=20collision?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `Bool as SharedBool` rename in delete/update/query was needed back when both PG's concrete `Bool` class and the shared `Bool` interface were imported side by side. Since the `.where(true)` refactor removed the PG Bool import from the builders, the alias is redundant. 573 tests + 6 examples green. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/builder/delete.ts | 10 +++++----- src/builder/query.ts | 46 +++++++++++++++++++++---------------------- src/builder/update.ts | 10 +++++----- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/builder/delete.ts b/src/builder/delete.ts index 418a4fa..beaac3a 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -1,6 +1,6 @@ import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; -import { isBool, type Bool as SharedBool } from "../types/bool"; +import { isBool, type Bool } from "../types/bool"; import type { RowType, RowTypeToTsType } from "./query"; import { combinePredicates, compileSelectList, isRowType, mergeReturning, reAlias } from "./query"; import type { TableBase } from "../table"; @@ -12,7 +12,7 @@ type Namespace = { [K in Name]: T }; type DeleteOpts = { instance: T; - where?: (ns: Namespace) => SharedBool; + where?: (ns: Namespace) => Bool; matchAll?: boolean; returning?: (ns: Namespace) => R; }; @@ -24,7 +24,7 @@ type FinalizedDeleteOpts | undefined; + where: Bool | undefined; matchAll: boolean; returning?: R; }; @@ -65,8 +65,8 @@ export class DeleteBuilder>(isBool))])) - where(fn: ((ns: Namespace) => SharedBool) | true): DeleteBuilder { + @expose(z.union([z.literal(true), fn.returns(z.custom>(isBool))])) + where(fn: ((ns: Namespace) => Bool) | true): DeleteBuilder { if (fn === true) { return new DeleteBuilder({ ...this.#opts, matchAll: true }); } diff --git a/src/builder/query.ts b/src/builder/query.ts index 16ec9d8..7ed0b1e 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -8,7 +8,7 @@ import { Anyarray, Record } from "../types/postgres"; // Dialect-agnostic base for shape/predicate/instanceof checks — accepts // PG's Any or SQLite's SqliteValue uniformly. import { SqlValue } from "../types/any"; -import { isBool, type Bool as SharedBool } from "../types/bool"; +import { isBool, type Bool } from "../types/bool"; import { type TsTypeOf, type Nullable, type AggregateRow, meta } from "../types/runtime"; import { fn, expose } from "../exoeval/tool"; import { isTableClass, TableBase } from "../table"; @@ -162,10 +162,10 @@ const isFromable = (obj: unknown): obj is Fromable => { // The concrete Bool has `.and()`; the shared marker interface does not // (see src/types/bool.ts — omitted for variance reasons). Cast through // `any` for chaining; the runtime call succeeds on the concrete class. -type Chainable = { and(other: SharedBool): SharedBool }; +type Chainable = { and(other: Bool): Bool }; export const combinePredicates = ( - left: ((ns: N) => SharedBool) | undefined, - right: (ns: N) => SharedBool, + left: ((ns: N) => Bool) | undefined, + right: (ns: N) => Bool, ) => { if (!left) { return right; @@ -175,7 +175,7 @@ export const combinePredicates = ( // Bool-valued predicate combine (used by UPDATE/DELETE where the predicate // has already been evaluated against the single-table namespace). -export const combineBoolPredicates = (left: SharedBool | undefined, right: SharedBool): SharedBool => +export const combineBoolPredicates = (left: Bool | undefined, right: Bool): Bool => left ? (left as unknown as Chainable).and(right) : right; // Compose two RETURNING callbacks into one that returns their merged @@ -218,15 +218,15 @@ export type QueryBuilderOptions O; - where?: (ns: N) => SharedBool; + where?: (ns: N) => Bool; groupBy?: (ns: N) => GB; - having?: (ns: N) => SharedBool; + having?: (ns: N) => Bool; orderBy?: (ns: N) => OrderByEntry[]; tables: [ { type: "from"; source: Fromable }, ...{ source: Fromable; - on: (ns: N) => SharedBool; + on: (ns: N) => Bool; type: "join" | "leftJoin"; }[], ]; @@ -260,8 +260,8 @@ export class QueryBuilder< } // Multiple `where` calls are combined with AND - @expose(fn.returns(z.custom>(isBool))) - where(where: (n: N) => SharedBool): QueryBuilder { + @expose(fn.returns(z.custom>(isBool))) + where(where: (n: N) => Bool): QueryBuilder { return new QueryBuilder({ ...this.opts, where: combinePredicates(this.opts.where, where), @@ -287,14 +287,14 @@ export class QueryBuilder< // the concrete subclass type (`Owners`, `Pets`, …). join( from: T, - on: (ns: N & { [K in T["tsAlias"]]: InstanceType }) => SharedBool, + on: (ns: N & { [K in T["tsAlias"]]: InstanceType }) => Bool, ): QueryBuilder }, O, GB>; join( from: Fromable, - on: (ns: N & { [k in A]: R }) => SharedBool, + on: (ns: N & { [k in A]: R }) => Bool, ): QueryBuilder; - @expose(z.custom(isFromable), fn.returns(z.custom>(isBool))) - join(from: Fromable, on: (ns: any) => SharedBool): any { + @expose(z.custom(isFromable), fn.returns(z.custom>(isBool))) + join(from: Fromable, on: (ns: any) => Bool): any { this.#assertNotInNamespace(from.tsAlias); return new QueryBuilder({ ...this.opts, @@ -304,14 +304,14 @@ export class QueryBuilder< leftJoin( from: T, - on: (ns: N & { [K in T["tsAlias"]]: RowTypeToNullable> }) => SharedBool, + on: (ns: N & { [K in T["tsAlias"]]: RowTypeToNullable> }) => Bool, ): QueryBuilder> }, O, GB>; leftJoin( from: Fromable, - onFn: (ns: N & { [k in A]: RowTypeToNullable }) => SharedBool, + onFn: (ns: N & { [k in A]: RowTypeToNullable }) => Bool, ): QueryBuilder }, O, GB>; - @expose(z.custom(isFromable), fn.returns(z.custom>(isBool))) - leftJoin(from: Fromable, onFn: (ns: any) => SharedBool): any { + @expose(z.custom(isFromable), fn.returns(z.custom>(isBool))) + leftJoin(from: Fromable, onFn: (ns: any) => Bool): any { this.#assertNotInNamespace(from.tsAlias); return new QueryBuilder({ ...this.opts, @@ -344,8 +344,8 @@ export class QueryBuilder< } // Multiple `having` calls are combined with AND - @expose(fn.returns(z.custom>(isBool))) - having(having: (n: N) => SharedBool): QueryBuilder { + @expose(fn.returns(z.custom>(isBool))) + having(having: (n: N) => Bool): QueryBuilder { return new QueryBuilder({ ...this.opts, having: combinePredicates(this.opts.having, having), @@ -555,15 +555,15 @@ export class QueryBuilder< type AppliedOpts = { select: RowType; - where?: SharedBool | undefined; + where?: Bool | undefined; groupBy?: SqlValue[] | undefined; - having?: SharedBool | undefined; + having?: Bool | undefined; orderBy?: OrderByEntry[] | undefined; tables: [ { type: "from"; source: Fromable; alias: Alias }, ...{ source: Fromable; - on: SharedBool; + on: Bool; type: "join" | "leftJoin"; alias: Alias; }[], diff --git a/src/builder/update.ts b/src/builder/update.ts index e5d431b..ab55cb5 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -1,6 +1,6 @@ import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; -import { isBool, type Bool as SharedBool } from "../types/bool"; +import { isBool, type Bool as Bool } from "../types/bool"; import type { SetRow } from "../types/runtime"; import { isSetRow } from "../types/runtime"; import { meta } from "../types/runtime"; @@ -16,7 +16,7 @@ type Namespace = { [K in Name]: T }; type UpdateOpts = { instance: T; - where?: (ns: Namespace) => SharedBool; + where?: (ns: Namespace) => Bool; // Explicit opt-in for "match every row" — set by `.where(true)`. // Separate from `where` so bind() can emit no WHERE clause (rather than // constructing a dialect-specific `TRUE` Bool). @@ -32,7 +32,7 @@ type FinalizedUpdateOpts | undefined; + where: Bool | undefined; matchAll: boolean; setRow: SetRow; returning?: R; @@ -93,8 +93,8 @@ export class UpdateBuilder>(isBool))])) - where(fn: ((ns: Namespace) => SharedBool) | true): UpdateBuilder { + @expose(z.union([z.literal(true), fn.returns(z.custom>(isBool))])) + where(fn: ((ns: Namespace) => Bool) | true): UpdateBuilder { if (fn === true) { return new UpdateBuilder({ ...this.#opts, matchAll: true }); } From d413b2c06645b3730163c367513befc8a795186f Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Wed, 1 Jul 2026 17:06:14 -0700 Subject: [PATCH 27/33] refactor(builder): drop pgCtx fallback + isTableClass probe in debug() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QueryBuilder.debug() had a bespoke "first table's database, else pgCtx" probe — now it just calls compile(this), since FinalizedQuery.children() already surfaces TableRefs and walkForDatabase can pick up the tagged Ident from there. Insert/Update/DeleteBuilder.debug() can't rely on the tree walk (their Idents are created lazily inside Finalized*.bind() and aren't exposed via children()), so they pass ctx explicitly from instance.constructor.database. That field is always set for db.Table-defined tables; the only untagged tables (TypegresLiveEvents) are library-internal and never reach debug(). bind() on Insert/Update/DeleteBuilder still takes ctx and threads it to the transformer's returned Sql — Sql.bind's abstract signature requires it, and dropping it would break the ternary's inferred type. --- src/builder/delete.ts | 12 +++++++++--- src/builder/insert.ts | 12 +++++++++--- src/builder/query.ts | 14 ++++++-------- src/builder/update.ts | 11 ++++++++--- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/builder/delete.ts b/src/builder/delete.ts index beaac3a..1408466 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -1,4 +1,4 @@ -import { Sql, sql, Alias, compile, pgCtx, type CompileContext } from "./sql"; +import { Sql, sql, Alias, compile, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; import { isBool, type Bool } from "../types/bool"; import type { RowType, RowTypeToTsType } from "./query"; @@ -116,6 +116,8 @@ export class DeleteBuilder Date: Thu, 2 Jul 2026 16:45:15 -0700 Subject: [PATCH 28/33] refactor: TableBase.database required + drop pgCtx/sqliteCtx sentinels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tables are always scoped to a Database — a table without one is nonsensical. Enforce it: - `TableBase.database` is now a required `DatabaseRef` (was optional). - `Table(name, opts, database)` factory requires `database`. - `TypegresLiveEvents` no longer extends `Table` — it doesn't use the builder API (no .from() / .insert() / etc.), only static utilities (`tableName`, `createTableSql`, `makeTransformer`). Rewriting it as a plain class lets us tighten TableBase without inventing a fake Database for the shadow-events table. Sentinel DatabaseRefs are gone: - `pgCtx` / `sqliteCtx` exports and the `walkForDatabase` auto-detect fallback in `compile()` are removed. `compile(root, ctx)` now requires ctx. - `QueryBuilder` carries `database` in its options, threaded from `Table.from` / `db.from` / `db.values` at construction (spread through every chained builder). `QueryBuilder.debug()` uses it directly. - Insert/Update/DeleteBuilder `debug()` methods drop the `!` on `constructor.database` since the field is now required. - Test files construct a real `Database` for their compile ctx instead of importing sentinels; test-helpers throws when a ctx can't be resolved rather than falling back to pgCtx. bind(ctx) on the builders is unchanged: ctx comes from the OUTER compile — deriving it from the builder's own table would defeat the provenance check for cross-database mixing. --- src/builder/delete.ts | 8 +---- src/builder/insert.ts | 8 +---- src/builder/query.test.ts | 6 +++- src/builder/query.ts | 9 ++++-- src/builder/sql.test.ts | 7 ++++- src/builder/sql.ts | 51 +------------------------------- src/builder/update.ts | 7 +---- src/database.ts | 2 ++ src/live/events.ts | 26 +++++++--------- src/table.ts | 25 +++++++--------- src/test-helpers.ts | 8 +++-- src/types/match.test.ts | 5 +++- src/types/postgres/index.test.ts | 4 ++- src/types/sqlite/smoke.test.ts | 4 +-- 14 files changed, 60 insertions(+), 110 deletions(-) diff --git a/src/builder/delete.ts b/src/builder/delete.ts index 1408466..b305b63 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -116,8 +116,6 @@ export class DeleteBuilder[]> = { + // Provenance handle — the Database this query is scoped to. Threaded + // from `Table.from` / `db.from` / `db.values` at construction and + // spread through every chained builder. Used at compile-entry + // (debug/execute) to synthesize the outer ctx. + database: DatabaseRef; // Preferred name only. The QueryBuilder ctor creates its own fresh Alias // identity from this string, so every builder instance in a chain — and // each reuse — registers independently. @@ -545,7 +550,7 @@ export class QueryBuilder< @expose() debug(): this { - const compiled = compile(this); + const compiled = compile(this, { database: this.opts.database }); console.log("Debugging query:", { sql: compiled.text, parameters: compiled.values }); return this; } diff --git a/src/builder/sql.test.ts b/src/builder/sql.test.ts index 6f1296b..135807b 100644 --- a/src/builder/sql.test.ts +++ b/src/builder/sql.test.ts @@ -1,9 +1,14 @@ import { test, expect } from "vitest"; -import { sql, compile, pgCtx, sqliteCtx, Ident } from "./sql"; +import { sql, compile, Ident } from "./sql"; +import { Database } from "../database"; // Test-only shim: these unit tests exercise SQL emission without a real // Database. Untagged Idents (constructed via the library-internal `new // Ident(name)` path) still pass through — a wrapper for readability. const $ident = (name: string) => new Ident(name); +const pgDb = new Database({ dialect: "postgres" }); +const sqliteDb = new Database({ dialect: "sqlite" }); +const pgCtx = { database: pgDb }; +const sqliteCtx = { database: sqliteDb }; test("param compiles with pg style", () => { const q = sql`SELECT ${1}, ${2}`; diff --git a/src/builder/sql.ts b/src/builder/sql.ts index 40e5025..1913b82 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -22,17 +22,6 @@ export interface DatabaseRef { // local, raw templates, escape hatch) pass through unchecked. export type CompileContext = { database: DatabaseRef }; -// Sentinel DatabaseRefs for compile-only paths (debug print, unit -// tests of SQL emission) where no real Database is present. Any -// Database-tagged node will mismatch and throw — tests that construct -// tagged nodes should build their own ctx from a real db. -export const pgCtx: CompileContext = { - database: { id: Symbol("pgCtx-sentinel"), dialect: "postgres" }, -}; -export const sqliteCtx: CompileContext = { - database: { id: Symbol("sqliteCtx-sentinel"), dialect: "sqlite" }, -}; - // --- Root --- // Every SQL node extends Sql. bind() produces a single BoundSql — one of @@ -297,45 +286,7 @@ const quoteIdent = (name: string): string => `"${name.replace(/"/g, '""')}"`; // frames stash the previous scope to restore on pop. type Frame = { iter: Iterator; prevScope?: Scope }; -// Walk a Sql tree and return the first tagged Ident's database, or a -// synthetic DatabaseRef from the first dialect-tagged Func/Op/Cast/Srf -// node's dialect if no tagged Ident is present. Used by `compile()` -// when the caller doesn't supply an explicit ctx — the tree usually -// carries enough provenance to derive its own compile context. -const walkForDatabase = (root: Sql): DatabaseRef | undefined => { - const stack: Sql[] = [root]; - let dialectOnly: DialectName | undefined; - while (stack.length) { - const n = stack.pop()!; - if (n instanceof Ident && n.database) { return n.database; } - if (dialectOnly === undefined) { - if (n instanceof Func && n.dialect) { dialectOnly = n.dialect; } - else if (n instanceof Op && n.dialect) { dialectOnly = n.dialect; } - else if (n instanceof UnaryOp && n.dialect) { dialectOnly = n.dialect; } - else if (n instanceof Cast && n.dialect) { dialectOnly = n.dialect; } - else if (n instanceof TypedParam && n.dialect) { dialectOnly = n.dialect; } - } - for (const c of n.children()) { stack.push(c); } - } - if (dialectOnly) { - return { id: Symbol("compile-inferred"), dialect: dialectOnly, name: "compile-inferred" }; - } - return undefined; -}; - -export const compile = (root: Sql, ctx?: CompileContext): CompiledSql => { - // Auto-detect ctx from the tree when the caller omits it. Fully - // untagged trees (raw templates with no typed values, no Idents) - // fall back to the `pgCtx` sentinel — matches the pre-refactor - // default behavior for hand-authored templates. - const resolvedCtx: CompileContext = ctx ?? (() => { - const database = walkForDatabase(root); - return database ? { database } : pgCtx; - })(); - return compileWithCtx(root, resolvedCtx); -}; - -const compileWithCtx = (root: Sql, ctx: CompileContext): CompiledSql => { +export const compile = (root: Sql, ctx: CompileContext): CompiledSql => { const values: unknown[] = []; const out: string[] = []; let scope = new Scope(); diff --git a/src/builder/update.ts b/src/builder/update.ts index f229abf..fd50a95 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -176,12 +176,7 @@ export class UpdateBuilder implements DatabaseRef { from: Fromable, ): QueryBuilder<{ [K in A]: R }, R, []> { return new QueryBuilder({ + database: this, tsAlias: from.tsAlias, tables: [{ type: "from", source: from }], }); @@ -101,6 +102,7 @@ export class Database implements DatabaseRef { ): QueryBuilder<{ values: R }, R, []> { const vals = new Values(vals0, ...valsRest); return new QueryBuilder<{ values: R }, R, []>({ + database: this, tsAlias: "values", tables: [{ type: "from", source: vals }], }); diff --git a/src/live/events.ts b/src/live/events.ts index 3debfbf..5f757dd 100644 --- a/src/live/events.ts +++ b/src/live/events.ts @@ -1,5 +1,5 @@ -import { Any, Int8, Jsonb, Text, Timestamptz, Xid8 } from "../types/postgres"; -import { Table, type QueryTransformer } from "../table"; +import { Any, Jsonb } from "../types/postgres"; +import type { QueryTransformer } from "../table"; import { sql, Ident, type Sql } from "../builder/sql"; import type { InsertBuilder } from "../builder/insert"; import type { DeleteBuilder } from "../builder/delete"; @@ -10,20 +10,14 @@ import { EVENTS_TABLE_NAME, eventsTableSqlStatements } from "./events-ddl"; // Shadow table that captures every mutation against a "live"-enabled table. // `makeTransformer` returns the per-op hook other tables opt in to: -// class Foos extends Table("foos", { transformer: TypegresLiveEvents.makeTransformer() }) -// The events class itself carries no transformer (would recurse). -export class TypegresLiveEvents extends Table(EVENTS_TABLE_NAME) { - private id = (Int8<1>).column({ nonNull: true, generated: true }); - private xid = (Xid8<1>).column({ nonNull: true }); - private table = (Text<1>).column({ nonNull: true }); - private before = (Jsonb<0 | 1>).column(); - private after = (Jsonb<0 | 1>).column(); - private inserted_at = (Timestamptz<1>).column({ nonNull: true }); - - // The DDL itself lives in `./events-ddl.ts` so it can be imported - // without dragging the full Table → builder cycle through. Re- - // exported here for backwards compatibility with consumers that - // already call `TypegresLiveEvents.createTableSql{,Statements}`. +// class Foos extends db.Table("foos", { transformer: TypegresLiveEvents.makeTransformer() }) +// Not a Table subclass — it doesn't use the Table builder API (no +// .from() / .insert() / etc.), so it doesn't need a Database provenance +// tag. Its role is just to hold the shadow-table's name + DDL and to +// emit raw SQL that INSERTs into it from user-mutation transformers. +export class TypegresLiveEvents { + static readonly tableName = EVENTS_TABLE_NAME; + static createTableSql(): Sql { return sql.join(eventsTableSqlStatements(), sql`; `); } diff --git a/src/table.ts b/src/table.ts index d4c9ae8..6e3bab4 100644 --- a/src/table.ts +++ b/src/table.ts @@ -40,12 +40,11 @@ export type TableOptions = { export abstract class TableBase { static readonly tableName: string; static readonly tsAlias: string; - // Provenance handle set by `db.Table(name)`. Untagged (`undefined`) - // when the class was constructed via the static `Table(name)` factory - // — those emit unattributed Idents (escape hatch). db-scoped tables - // propagate their database to every ident they emit; compile-time - // provenance check enforces same-db at bind time. - static readonly database: DatabaseRef | undefined = undefined; + // Provenance handle set by `db.Table(name)`. Propagated to every + // Ident this table emits; the compile-time provenance check + // enforces same-db at bind time. Non-optional — tables are always + // scoped to a Database. + static readonly database: DatabaseRef; // Mutation builders on this table run this at bind() time and on each // raw result row before deserialization. Default none. static readonly transformer: QueryTransformer | undefined = undefined; @@ -72,10 +71,8 @@ export abstract class TableBase { return new Ident(this.tableName, this.database); } - // Convenience: emit a database-tagged Ident from this table for use in - // column-name construction (used by reAlias, mutation builders' column - // lists, etc.). Falls back to an untagged Ident if the table wasn't - // constructed via db.Table. + // Emit a database-tagged Ident from this table for use in column-name + // construction (used by reAlias, mutation builders' column lists, etc.). static ident(this: typeof TableBase, name: string): Ident { return new Ident(name, this.database); } @@ -87,6 +84,7 @@ export abstract class TableBase { InstanceType, [] >({ + database: this.database, tsAlias: this.tsAlias, tables: [{ type: "from", source: this as unknown as Fromable }], }); @@ -176,8 +174,8 @@ TableBase satisfies Fromable; // `contextOf()` return type are pinned to `Principal`. export const Table = ( name: Name, - opts: TableOptions = {}, - database?: DatabaseRef, + opts: TableOptions, + database: DatabaseRef, ) => { // Named class via computed-key shim — shows up as `name` in stack traces. const obj = { @@ -189,8 +187,7 @@ export const Table = ( // Default value remains `undefined` until `scope()` overrides via // subclass; the type narrowing is purely compile-time. static override readonly context: C = undefined as C; - // Provenance handle from db.Table(); undefined for static Table(). - static override readonly database: DatabaseRef | undefined = database; + static override readonly database = database; }, }; type Obj = typeof obj; diff --git a/src/test-helpers.ts b/src/test-helpers.ts index 9ad7523..883b580 100644 --- a/src/test-helpers.ts +++ b/src/test-helpers.ts @@ -86,9 +86,13 @@ export const expectSqlEqual = (actual: Sql, expected: Sql, database?: DatabaseRe // 1. explicit caller-supplied `database` // 2. any tagged Ident found in the actual tree (auto-detect) // 3. suite-wide `db` (setupDb tests) - // 4. pgCtx sentinel (unit tests before setupDb) const resolved = database ?? findDatabase(actual) ?? db; - const ctx = resolved ? { database: resolved } : undefined; + if (!resolved) { + throw new Error( + "expectSqlEqual: could not resolve a Database — pass `database` explicitly, tag the tree, or call setupDb().", + ); + } + const ctx = { database: resolved }; const a = compile(actual, ctx); const e = compile(expected, ctx); expect(normalize(a.text)).toEqual(normalize(e.text)); diff --git a/src/types/match.test.ts b/src/types/match.test.ts index 037d9a8..8215c78 100644 --- a/src/types/match.test.ts +++ b/src/types/match.test.ts @@ -1,6 +1,9 @@ import { test, expect } from "vitest"; import { Int4, Int8, Text, Bool } from "./postgres"; -import { compile, pgCtx } from "../builder/sql"; +import { compile } from "../builder/sql"; +import { Database } from "../database"; + +const pgCtx = { database: new Database({ dialect: "postgres" }) }; // --- match via operators/functions --- diff --git a/src/types/postgres/index.test.ts b/src/types/postgres/index.test.ts index d7cb23e..e8bc34f 100644 --- a/src/types/postgres/index.test.ts +++ b/src/types/postgres/index.test.ts @@ -3,13 +3,15 @@ import type { meta } from "../runtime"; import type { StrictNull, MaybeNull, NullOf, TsTypeOf } from "../runtime"; import type { Any, Float8, Anyrange, Anymultirange } from "./index"; import { Int4, Text, Bool, Int8, Record, Anyarray } from "./index"; -import { compile, pgCtx } from "../../builder/sql"; +import { compile } from "../../builder/sql"; import { sql } from "../../builder/sql"; import { PgDriver } from "../../driver"; import { requireDatabaseUrl } from "../../pg"; import type { Connection } from "../../database"; import { Database } from "../../database"; +const pgCtx = { database: new Database({ dialect: "postgres" }) }; + let exec: Connection; beforeAll(async () => { diff --git a/src/types/sqlite/smoke.test.ts b/src/types/sqlite/smoke.test.ts index 3b43f32..b992f4f 100644 --- a/src/types/sqlite/smoke.test.ts +++ b/src/types/sqlite/smoke.test.ts @@ -12,7 +12,7 @@ import { test, expect, beforeAll, afterAll } from "vitest"; import { SqliteDriver } from "../../driver"; import type { Connection } from "../../database"; import { Database } from "../../database"; -import { compile, sql, sqliteCtx } from "../../builder/sql"; +import { compile, sql } from "../../builder/sql"; import { Integer, Text } from "./index"; let driver: SqliteDriver; @@ -108,7 +108,7 @@ test("placeholder emission uses ? not $N", async () => { const r = await conn.execute(sql`SELECT ${expr.toSql()} as v`); expect(r.rows[0]!["v"]).toBe("5"); // Direct compile probe — belt-and-suspenders. - const compiled = compile(expr.toSql(), sqliteCtx); + const compiled = compile(expr.toSql(), { database: db }); expect(compiled.text).toContain("?"); expect(compiled.text).not.toContain("$"); }); From a55ae0cc8ae915493b1b3bc1ab1de69b4e8520c0 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Thu, 2 Jul 2026 16:48:38 -0700 Subject: [PATCH 29/33] refactor(sql): paramForDialect helper + comment cleanup - Extract `paramForDialect(dialect, position)` from compile()'s inline ternary. Exhaustive switch on DialectName forces a compile-time update when a new dialect is added. - Rewrite the sql.ident-absence comment as a positive statement about the current design (why schema idents must carry a DatabaseRef) instead of referencing the removed helper. - Add AGENTS.md rule: comments describe present code, not deleted code. --- AGENTS.md | 17 +++++++++++++++++ src/builder/sql.ts | 24 ++++++++++++++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index d669ebe..32b661d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,3 +17,20 @@ Conventions that aren't lint-enforced. If you're writing code in this repo, foll ``` Using the typegres `Record` class as a type (e.g. `Record` as a return of `scalar()`) is fine — that's the intended use of the exported class. + +## Comments describe present code, not deleted code + +- Don't leave comments that reference something you removed ("X removed", "no longer supports Y", "used to do Z"). They rot as history moves on and confuse readers who don't have the deleted code in mind. The commit message and git history are where that context lives. + + If a comment needs to explain the *absence* of an obvious thing (e.g. no `sql.ident` helper), phrase it as a positive statement about the current design and why: + + ```ts + // Don't: + // Untagged Ident construction removed. Callers who need a schema- + // referencing identifier go through `db.scopedIdent(name)`. + + // Do: + // No `sql.ident` helper: schema-referencing identifiers must carry + // a DatabaseRef for the compile-time provenance check, so callers + // go through `db.scopedIdent(name)`. + ``` diff --git a/src/builder/sql.ts b/src/builder/sql.ts index 1913b82..2724e28 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -281,6 +281,20 @@ export class Unbound extends Sql { const quoteIdent = (name: string): string => `"${name.replace(/"/g, '""')}"`; +// Placeholder syntax per dialect. Exhaustive over `DialectName` — if a +// new dialect is added, TS's `never` check on the fallback branch +// forces a compile-time update here rather than a silent misfire. +const paramForDialect = (dialect: DialectName, position: number): string => { + switch (dialect) { + case "postgres": return `$${position}`; + case "sqlite": return "?"; + default: { + const _exhaustive: never = dialect; + return _exhaustive; + } + } +}; + // Walk the Sql tree with a stack of iterators. Each frame is either // a single-node iterator or a Join's interleaved parts iterator. WithScope // frames stash the previous scope to restore on pop. @@ -307,7 +321,7 @@ export const compile = (root: Sql, ctx: CompileContext): CompiledSql => { out.push(quoteIdent(atom.name)); } else if (atom instanceof Param) { values.push(atom.value); - out.push(ctx.database.dialect === "postgres" ? `$${values.length}` : "?"); + out.push(paramForDialect(ctx.database.dialect, values.length)); } else if (atom instanceof Alias) { const resolved = scope.resolve(atom); if (!resolved) { @@ -370,9 +384,11 @@ function _sql(strings: TemplateStringsArray, ...exprs: unknown[]): BoundSql { _sql.param = (value: unknown): BoundSql => new Param(value); // Provided for clients, not to be used internally (internal code should use literal templates instead of `raw`.) _sql.raw = (s: string): BoundSql => new Raw(s); -// Untagged Ident construction removed. Callers who need a schema- -// referencing identifier go through `db.scopedIdent(name)`; the Ident -// class itself is exported but requires a DatabaseRef. +// No `sql.ident` helper: schema-referencing identifiers must carry a +// DatabaseRef for the compile-time provenance check, so callers go +// through `db.scopedIdent(name)`. The `Ident` class is still exported +// for library-internal callers that need to construct untagged +// identifiers (CTE aliases, output column labels) inline. _sql.column = (table: Alias, name: Ident): Sql => new Column(table, name); _sql.unbound = (): Sql => new Unbound(); _sql.withScope = (aliases: readonly Alias[], child: Sql): BoundSql => new WithScope(aliases, child); From b3af5a6860d102f4ee9f43e4b57efe753ce31de4 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Thu, 2 Jul 2026 16:52:07 -0700 Subject: [PATCH 30/33] refactor(live/bus): tag EVENTS_TABLE Ident with the bus's database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bus's #poll query referenced the events table via an untagged Ident — the last remaining place a schema-referencing Ident was constructed without provenance in the query path. Store the Connection's Database on the Bus and thread it through the Ident, so the provenance check covers this path too. DDL emission in events-ddl.ts still uses untagged Idents; that's schema-setup code that runs once at boot and never mixes across databases, but can be tightened next if we want zero untagged schema idents anywhere. --- src/live/bus.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/live/bus.ts b/src/live/bus.ts index 3c06d0d..877307d 100644 --- a/src/live/bus.ts +++ b/src/live/bus.ts @@ -1,5 +1,5 @@ import type { Connection } from "../database"; -import { sql, Ident } from "../builder/sql"; +import { sql, Ident, type DatabaseRef } from "../builder/sql"; import { type Cursor, parseSnapshot, visible } from "./snapshot"; import type { PredicateSet } from "./extractor"; @@ -106,6 +106,7 @@ export class Bus { #oncePolled: (() => void)[] = []; readonly #intervalMs: number; readonly #windowSize: number; + readonly #database: DatabaseRef; constructor( private conn: Connection, @@ -113,6 +114,7 @@ export class Bus { ) { this.#intervalMs = opts.intervalMs ?? 100; this.#windowSize = opts.windowSize ?? 10_000; + this.#database = conn.database; } // Capture the initial snapshot and start the polling loop. Must be @@ -301,7 +303,7 @@ export class Bus { // `::pg_snapshot`. const r = await this.conn.execute(sql` SELECT xid::text AS xid, "table", before::text AS before, after::text AS after - FROM ${new Ident(EVENTS_TABLE)} + FROM ${new Ident(EVENTS_TABLE, this.#database)} WHERE xid >= pg_snapshot_xmin(${sql.param(cursorToText(prev))}::pg_snapshot) AND pg_visible_in_snapshot(xid, ${sql.param(cursorToText(cur))}::pg_snapshot) AND NOT pg_visible_in_snapshot(xid, ${sql.param(cursorToText(prev))}::pg_snapshot) From 474756b0f7592ac2a7c04d0d4ca07e6188ca6c96 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Thu, 2 Jul 2026 16:56:28 -0700 Subject: [PATCH 31/33] refactor(live): tag DDL + transformer schema Idents with database MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The last untagged schema Idents in the codebase — the events-table DDL and the live-mutation transformer's INSERT-into-events wrap — now carry the emitting Database as provenance. - `eventsTableSqlStatements(database)` and `TypegresLiveEvents.createTable{Sql,SqlStatements}(database)` take the target DatabaseRef; callers (`Connection.installLiveEvents`, live test helper) already have one at the call site. - Insert/Update/DeleteBuilder expose a `database` getter so the live-events transformer can pull the target Database off the builder it wraps. - events.ts `wrapInsertOrDelete` / `wrapUpdate` / `eventsInsertCte` thread `database` and tag every schema-referencing Ident (events shadow table, user table, columns, ctid). CTE/RETURNING alias Idents stay untagged — they're query-local names, not schema references. --- src/builder/delete.ts | 4 ++++ src/builder/insert.ts | 4 ++++ src/builder/update.ts | 4 ++++ src/database.ts | 2 +- src/live/events-ddl.ts | 8 ++++---- src/live/events.ts | 33 ++++++++++++++++++++------------- src/live/test-helpers.ts | 2 +- 7 files changed, 38 insertions(+), 19 deletions(-) diff --git a/src/builder/delete.ts b/src/builder/delete.ts index b305b63..69f3ad0 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -63,6 +63,10 @@ export class DeleteBuilder>(isBool))])) diff --git a/src/builder/insert.ts b/src/builder/insert.ts index 1988ce8..7371df6 100644 --- a/src/builder/insert.ts +++ b/src/builder/insert.ts @@ -68,6 +68,10 @@ export class InsertBuilder((v) => isRowType(v)))) returning(fn: (ns: Namespace) => R2): InsertBuilder { return new InsertBuilder({ ...this.#opts, returning: fn }); diff --git a/src/builder/update.ts b/src/builder/update.ts index fd50a95..f65e67d 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -90,6 +90,10 @@ export class UpdateBuilder { #bus: Bus | undefined; async installLiveEvents(): Promise { - for (const stmt of eventsTableSqlStatements()) { + for (const stmt of eventsTableSqlStatements(this.database)) { const { text, values } = compile(stmt, { database: this.database }); await this.driver.execute(text, values); } diff --git a/src/live/events-ddl.ts b/src/live/events-ddl.ts index 8a4b052..710c575 100644 --- a/src/live/events-ddl.ts +++ b/src/live/events-ddl.ts @@ -4,14 +4,14 @@ // insert → database) — that cycle bit us at the chunk boundary // when vite bundled the site (TDZ during dynamic import). -import { sql, Ident, type Sql } from "../builder/sql"; +import { sql, Ident, type Sql, type DatabaseRef } from "../builder/sql"; export const EVENTS_TABLE_NAME = "_typegres_live_events"; -export const eventsTableSqlStatements = (): Sql[] => { +export const eventsTableSqlStatements = (database: DatabaseRef): Sql[] => { return [ sql` - CREATE TABLE IF NOT EXISTS ${new Ident(EVENTS_TABLE_NAME)} ( + CREATE TABLE IF NOT EXISTS ${new Ident(EVENTS_TABLE_NAME, database)} ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, xid xid8 NOT NULL, -- before/after are jsonb objects keyed by column name with @@ -27,6 +27,6 @@ export const eventsTableSqlStatements = (): Sql[] => { inserted_at timestamptz NOT NULL DEFAULT clock_timestamp() ) `, - sql`CREATE INDEX IF NOT EXISTS ${new Ident(`${EVENTS_TABLE_NAME}_xid_idx`)} ON ${new Ident(EVENTS_TABLE_NAME)} (xid)`, + sql`CREATE INDEX IF NOT EXISTS ${new Ident(`${EVENTS_TABLE_NAME}_xid_idx`, database)} ON ${new Ident(EVENTS_TABLE_NAME, database)} (xid)`, ]; }; diff --git a/src/live/events.ts b/src/live/events.ts index 5f757dd..0c195ba 100644 --- a/src/live/events.ts +++ b/src/live/events.ts @@ -1,6 +1,6 @@ import { Any, Jsonb } from "../types/postgres"; import type { QueryTransformer } from "../table"; -import { sql, Ident, type Sql } from "../builder/sql"; +import { sql, Ident, type Sql, type DatabaseRef } from "../builder/sql"; import type { InsertBuilder } from "../builder/insert"; import type { DeleteBuilder } from "../builder/delete"; import type { UpdateBuilder} from "../builder/update"; @@ -18,11 +18,11 @@ import { EVENTS_TABLE_NAME, eventsTableSqlStatements } from "./events-ddl"; export class TypegresLiveEvents { static readonly tableName = EVENTS_TABLE_NAME; - static createTableSql(): Sql { - return sql.join(eventsTableSqlStatements(), sql`; `); + static createTableSql(database: DatabaseRef): Sql { + return sql.join(eventsTableSqlStatements(database), sql`; `); } - static createTableSqlStatements(): Sql[] { - return eventsTableSqlStatements(); + static createTableSqlStatements(database: DatabaseRef): Sql[] { + return eventsTableSqlStatements(database); } static makeTransformer(): QueryTransformer { @@ -48,6 +48,11 @@ const buildLiveJsonb = ( return sql`jsonb_build_object(${sql.join(args)})`; }; +// The events shadow table lives on the same Database as the user table +// being mutated. Tag every schema-referencing Ident with it so provenance +// flows through the transformer's rewrite. CTE / RETURNING alias Idents +// stay untagged — they're query-local names, not schema references. + // returningMerge callback that adds `__typegres_live_` projecting // every column at its post-image (default for INSERT/DELETE, and UPDATE's // after). The matching pre-image variant for UPDATE is built inline below. @@ -79,8 +84,8 @@ const T_LIVE_AFTER = "__typegres_live_after"; // `INSERT INTO _typegres_live_events (xid, "table", before, after) SELECT ... FROM __typegres_cte`. // Used by both the insert/delete and update wraps. -const eventsInsertCte = (tableName: string, before: Sql, after: Sql): Sql => - sql`INSERT INTO ${new Ident(TypegresLiveEvents.tableName)} (${new Ident("xid")}, ${new Ident("table")}, ${new Ident("before")}, ${new Ident("after")}) SELECT pg_current_xact_id(), ${sql.param(tableName)}::text, ${before}, ${after} FROM ${new Ident(T_CTE)}`; +const eventsInsertCte = (tableName: string, before: Sql, after: Sql, database: DatabaseRef): Sql => + sql`INSERT INTO ${new Ident(TypegresLiveEvents.tableName, database)} (${new Ident("xid", database)}, ${new Ident("table", database)}, ${new Ident("before", database)}, ${new Ident("after", database)}) SELECT pg_current_xact_id(), ${sql.param(tableName)}::text, ${before}, ${after} FROM ${new Ident(T_CTE)}`; // Wrap an INSERT or DELETE in the events-emitting CTE chain. The two ops // are mirror images — INSERT captures the post-image as `after`, DELETE @@ -95,6 +100,7 @@ const wrapInsertOrDelete = ( side: "before" | "after", ): Sql => { const tableName = builder.tableName; + const database = builder.database; const liveKey = side === "before" ? T_LIVE_BEFORE : T_LIVE_AFTER; // returningMerge() has the same shape on both InsertBuilder and @@ -106,7 +112,7 @@ const wrapInsertOrDelete = ( const beforeRef = side === "before" ? new Ident(liveKey) : sql`NULL::jsonb`; const afterRef = side === "after" ? new Ident(liveKey) : sql`NULL::jsonb`; - const events = eventsInsertCte(tableName, beforeRef, afterRef); + const events = eventsInsertCte(tableName, beforeRef, afterRef, database); const projection = userReturningProjection(innerFinalized.opts.returning ?? {}, liveKey); return sql`WITH ${new Ident(T_CTE)} AS (${innerFinalized}), ${new Ident(T_EVENTS)} AS (${events}) SELECT ${projection} FROM ${new Ident(T_CTE)}`; }; @@ -132,6 +138,7 @@ const wrapInsertOrDelete = ( // we capture both images in one statement. const wrapUpdate = (builder: UpdateBuilder): Sql => { const tableName = builder.tableName; + const database = builder.database; // Add both __typegres_live_before and __typegres_live_after to RETURNING. // After uses the post-update namespace refs (same as INSERT/DELETE); the @@ -141,7 +148,7 @@ const wrapUpdate = (builder: UpdateBuilder): Sql => { const tableInstance = (ns as { [k: string]: object })[tableName] as { [c: string]: Any }; return { [T_LIVE_BEFORE]: Jsonb.from( - buildLiveJsonb(tableInstance, (c) => sql`${new Ident(T_BEFORE)}.${new Ident(c)}::text`), + buildLiveJsonb(tableInstance, (c) => sql`${new Ident(T_BEFORE)}.${new Ident(c, database)}::text`), ), [T_LIVE_AFTER]: Jsonb.from(buildLiveJsonb(tableInstance)), }; @@ -158,11 +165,11 @@ const wrapUpdate = (builder: UpdateBuilder): Sql => { // before-CTE `FOR UPDATE` snapshot, so emit `WHERE TRUE` explicitly // — always PG here since live is PG-only. const whereClause = where ? where.toSql() : sql`TRUE`; - const beforeCte = sql`SELECT *, ctid FROM ${new Ident(tableName)} AS ${alias} WHERE ${whereClause} FOR UPDATE`; - const ctidJoin = sql`${sql.column(alias, new Ident("ctid"))} = ${new Ident(T_BEFORE)}.${new Ident("ctid")}`; - const updateCte = sql`UPDATE ${new Ident(tableName)} AS ${alias} SET ${sql.join(compileSetClauses(instance, setRow))} FROM ${new Ident(T_BEFORE)} WHERE ${ctidJoin} RETURNING ${compileSelectList(returning)}`; + const beforeCte = sql`SELECT *, ctid FROM ${new Ident(tableName, database)} AS ${alias} WHERE ${whereClause} FOR UPDATE`; + const ctidJoin = sql`${sql.column(alias, new Ident("ctid", database))} = ${new Ident(T_BEFORE)}.${new Ident("ctid", database)}`; + const updateCte = sql`UPDATE ${new Ident(tableName, database)} AS ${alias} SET ${sql.join(compileSetClauses(instance, setRow))} FROM ${new Ident(T_BEFORE)} WHERE ${ctidJoin} RETURNING ${compileSelectList(returning)}`; - const events = eventsInsertCte(tableName, new Ident(T_LIVE_BEFORE), new Ident(T_LIVE_AFTER)); + const events = eventsInsertCte(tableName, new Ident(T_LIVE_BEFORE), new Ident(T_LIVE_AFTER), database); const projection = userReturningProjection(returning ?? {}, T_LIVE_BEFORE, T_LIVE_AFTER); return sql.withScope( diff --git a/src/live/test-helpers.ts b/src/live/test-helpers.ts index 3f2d6de..efd5481 100644 --- a/src/live/test-helpers.ts +++ b/src/live/test-helpers.ts @@ -8,7 +8,7 @@ import { TypegresLiveEvents } from "./events"; // starts clean — no per-test boilerplate. export const setupLiveEvents = (): void => { beforeAll(async () => { - await conn.execute(TypegresLiveEvents.createTableSql()); + await conn.execute(TypegresLiveEvents.createTableSql(conn.database)); }); afterEach(async () => { await conn.execute(sql`TRUNCATE _typegres_live_events`); From 7dab4273dd245e638130807be8484058c45b7a33 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Thu, 2 Jul 2026 17:00:12 -0700 Subject: [PATCH 32/33] refactor: use database.scopedIdent for library-internal tagged Idents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `scopedIdent(name)` to the DatabaseRef interface (Database already implements it). Sweep library-internal `new Ident(name, database)` call sites — events-ddl, bus, events transformer, Table.bind/ident, Func.bind, Srf.bind — to go through the interface method instead. Untagged Idents (CTE aliases, output column labels, reAlias for non- Table rows via db.values) still use `new Ident(name)` — there's no database to route through. --- src/builder/sql.ts | 7 ++++++- src/live/bus.ts | 4 ++-- src/live/events-ddl.ts | 6 +++--- src/live/events.ts | 10 +++++----- src/table.ts | 7 +++---- src/types/runtime.ts | 4 ++-- 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/builder/sql.ts b/src/builder/sql.ts index 2724e28..b13bd94 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -14,6 +14,11 @@ export interface DatabaseRef { readonly id: symbol; readonly dialect: DialectName; readonly name?: string; + // Provenance-tagged identifier factory. Library-internal callers use + // this instead of `new Ident(name, ref)` for readability and to keep + // the tagged-ident construction path uniform with the public + // `Database.scopedIdent`. + scopedIdent(name: string): Ident; } // Threaded through bind() and compile(). `database` supplies dialect @@ -200,7 +205,7 @@ export class Func extends Sql { ) { super(); } bind(ctx: CompileContext): BoundSql { checkDialect(`Func '${this.name}'`, this.dialect, ctx); - return sql`${new Ident(this.name, ctx.database)}(${sql.join(this.args)})`; + return sql`${ctx.database.scopedIdent(this.name)}(${sql.join(this.args)})`; } override children(): readonly Sql[] { return this.args; } } diff --git a/src/live/bus.ts b/src/live/bus.ts index 877307d..bec335e 100644 --- a/src/live/bus.ts +++ b/src/live/bus.ts @@ -1,5 +1,5 @@ import type { Connection } from "../database"; -import { sql, Ident, type DatabaseRef } from "../builder/sql"; +import { sql, type DatabaseRef } from "../builder/sql"; import { type Cursor, parseSnapshot, visible } from "./snapshot"; import type { PredicateSet } from "./extractor"; @@ -303,7 +303,7 @@ export class Bus { // `::pg_snapshot`. const r = await this.conn.execute(sql` SELECT xid::text AS xid, "table", before::text AS before, after::text AS after - FROM ${new Ident(EVENTS_TABLE, this.#database)} + FROM ${this.#database.scopedIdent(EVENTS_TABLE)} WHERE xid >= pg_snapshot_xmin(${sql.param(cursorToText(prev))}::pg_snapshot) AND pg_visible_in_snapshot(xid, ${sql.param(cursorToText(cur))}::pg_snapshot) AND NOT pg_visible_in_snapshot(xid, ${sql.param(cursorToText(prev))}::pg_snapshot) diff --git a/src/live/events-ddl.ts b/src/live/events-ddl.ts index 710c575..7873736 100644 --- a/src/live/events-ddl.ts +++ b/src/live/events-ddl.ts @@ -4,14 +4,14 @@ // insert → database) — that cycle bit us at the chunk boundary // when vite bundled the site (TDZ during dynamic import). -import { sql, Ident, type Sql, type DatabaseRef } from "../builder/sql"; +import { sql, type Sql, type DatabaseRef } from "../builder/sql"; export const EVENTS_TABLE_NAME = "_typegres_live_events"; export const eventsTableSqlStatements = (database: DatabaseRef): Sql[] => { return [ sql` - CREATE TABLE IF NOT EXISTS ${new Ident(EVENTS_TABLE_NAME, database)} ( + CREATE TABLE IF NOT EXISTS ${database.scopedIdent(EVENTS_TABLE_NAME)} ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, xid xid8 NOT NULL, -- before/after are jsonb objects keyed by column name with @@ -27,6 +27,6 @@ export const eventsTableSqlStatements = (database: DatabaseRef): Sql[] => { inserted_at timestamptz NOT NULL DEFAULT clock_timestamp() ) `, - sql`CREATE INDEX IF NOT EXISTS ${new Ident(`${EVENTS_TABLE_NAME}_xid_idx`, database)} ON ${new Ident(EVENTS_TABLE_NAME, database)} (xid)`, + sql`CREATE INDEX IF NOT EXISTS ${database.scopedIdent(`${EVENTS_TABLE_NAME}_xid_idx`)} ON ${database.scopedIdent(EVENTS_TABLE_NAME)} (xid)`, ]; }; diff --git a/src/live/events.ts b/src/live/events.ts index 0c195ba..c7c2701 100644 --- a/src/live/events.ts +++ b/src/live/events.ts @@ -85,7 +85,7 @@ const T_LIVE_AFTER = "__typegres_live_after"; // `INSERT INTO _typegres_live_events (xid, "table", before, after) SELECT ... FROM __typegres_cte`. // Used by both the insert/delete and update wraps. const eventsInsertCte = (tableName: string, before: Sql, after: Sql, database: DatabaseRef): Sql => - sql`INSERT INTO ${new Ident(TypegresLiveEvents.tableName, database)} (${new Ident("xid", database)}, ${new Ident("table", database)}, ${new Ident("before", database)}, ${new Ident("after", database)}) SELECT pg_current_xact_id(), ${sql.param(tableName)}::text, ${before}, ${after} FROM ${new Ident(T_CTE)}`; + sql`INSERT INTO ${database.scopedIdent(TypegresLiveEvents.tableName)} (${database.scopedIdent("xid")}, ${database.scopedIdent("table")}, ${database.scopedIdent("before")}, ${database.scopedIdent("after")}) SELECT pg_current_xact_id(), ${sql.param(tableName)}::text, ${before}, ${after} FROM ${new Ident(T_CTE)}`; // Wrap an INSERT or DELETE in the events-emitting CTE chain. The two ops // are mirror images — INSERT captures the post-image as `after`, DELETE @@ -148,7 +148,7 @@ const wrapUpdate = (builder: UpdateBuilder): Sql => { const tableInstance = (ns as { [k: string]: object })[tableName] as { [c: string]: Any }; return { [T_LIVE_BEFORE]: Jsonb.from( - buildLiveJsonb(tableInstance, (c) => sql`${new Ident(T_BEFORE)}.${new Ident(c, database)}::text`), + buildLiveJsonb(tableInstance, (c) => sql`${new Ident(T_BEFORE)}.${database.scopedIdent(c)}::text`), ), [T_LIVE_AFTER]: Jsonb.from(buildLiveJsonb(tableInstance)), }; @@ -165,9 +165,9 @@ const wrapUpdate = (builder: UpdateBuilder): Sql => { // before-CTE `FOR UPDATE` snapshot, so emit `WHERE TRUE` explicitly // — always PG here since live is PG-only. const whereClause = where ? where.toSql() : sql`TRUE`; - const beforeCte = sql`SELECT *, ctid FROM ${new Ident(tableName, database)} AS ${alias} WHERE ${whereClause} FOR UPDATE`; - const ctidJoin = sql`${sql.column(alias, new Ident("ctid", database))} = ${new Ident(T_BEFORE)}.${new Ident("ctid", database)}`; - const updateCte = sql`UPDATE ${new Ident(tableName, database)} AS ${alias} SET ${sql.join(compileSetClauses(instance, setRow))} FROM ${new Ident(T_BEFORE)} WHERE ${ctidJoin} RETURNING ${compileSelectList(returning)}`; + const beforeCte = sql`SELECT *, ctid FROM ${database.scopedIdent(tableName)} AS ${alias} WHERE ${whereClause} FOR UPDATE`; + const ctidJoin = sql`${sql.column(alias, database.scopedIdent("ctid"))} = ${new Ident(T_BEFORE)}.${database.scopedIdent("ctid")}`; + const updateCte = sql`UPDATE ${database.scopedIdent(tableName)} AS ${alias} SET ${sql.join(compileSetClauses(instance, setRow))} FROM ${new Ident(T_BEFORE)} WHERE ${ctidJoin} RETURNING ${compileSelectList(returning)}`; const events = eventsInsertCte(tableName, new Ident(T_LIVE_BEFORE), new Ident(T_LIVE_AFTER), database); const projection = userReturningProjection(returning ?? {}, T_LIVE_BEFORE, T_LIVE_AFTER); diff --git a/src/table.ts b/src/table.ts index 6e3bab4..6aac788 100644 --- a/src/table.ts +++ b/src/table.ts @@ -1,5 +1,4 @@ -import { Ident } from "./builder/sql"; -import type { BoundSql, DatabaseRef, Sql } from "./builder/sql"; +import type { BoundSql, DatabaseRef, Ident, Sql } from "./builder/sql"; import type { Fromable} from "./builder/query"; import { QueryBuilder } from "./builder/query"; import { DeleteBuilder } from "./builder/delete"; @@ -68,13 +67,13 @@ export abstract class TableBase { } static bind(this: typeof TableBase): BoundSql { - return new Ident(this.tableName, this.database); + return this.database.scopedIdent(this.tableName); } // Emit a database-tagged Ident from this table for use in column-name // construction (used by reAlias, mutation builders' column lists, etc.). static ident(this: typeof TableBase, name: string): Ident { - return new Ident(name, this.database); + return this.database.scopedIdent(name); } // Entry point for query builders: e.g., `Users.from()` diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 53f7471..ad58a38 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -1,7 +1,7 @@ export type { Sql } from "../builder/sql"; export { sql } from "../builder/sql"; import type { BoundSql, Raw, CompileContext } from "../builder/sql"; -import { Func, Ident, Op, Sql, sql } from "../builder/sql"; +import { Func, Op, Sql, sql } from "../builder/sql"; import type { Any } from "./postgres"; // Shared base for type-level utilities (NullOf, TsTypeOf, Aggregate). // Extracting an N from a typed value works uniformly across dialects @@ -215,7 +215,7 @@ export class Srf }, A extends string> extend `Srf '${this.#name}' constructed for dialect '${this.#dialect}' but compiled against '${ctx.database.dialect}'.`, ); } - return sql`${new Ident(this.#name, ctx.database)}(${this.#argsSql})`; + return sql`${ctx.database.scopedIdent(this.#name)}(${this.#argsSql})`; } // Expose the args fragment so generic tree walkers (extractor, linting, From d5dbe079e3952dac547353addf1b4e0f446e5ec4 Mon Sep 17 00:00:00 2001 From: Ryan Rasti Date: Thu, 2 Jul 2026 17:22:23 -0700 Subject: [PATCH 33/33] refactor: replace deserialize registry with per-class overrides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Origin/main's `typeRegistry` (later split into per-dialect registries) was a legacy of pre-per-class codegen — a central map of typname → {tsType, deserialize} that the base SqlValue looked up at runtime. Now that codegen emits real classes and there's already an `overrides/` hook next to `generated/`, the registry is unnecessary indirection. Move deserialize onto the class where it belongs. Changes: - `SqlValue.deserialize`: identity default typed as `unknown` so overrides can freely narrow the return type. - `SqlValue.primitiveTs`: static string ("string" default) — the JS `typeof` accepted by serialize/match. Was `getTypeDef(...).tsType`. - Concrete overrides for the non-string types: PG: Bool, Int2, Int4, Float4, Float8, Oid SQLite: Bool, Integer, Real Each sets `static primitiveTs` + `override deserialize(...)` in one place — parser + return type + primitive check colocated. - Codegen still emits `declare deserialize: (raw) => ${tsType}` on concrete classes WITHOUT an override, so `TsTypeOf>` narrows to `string`. Classes with overrides get no `declare` — the override's real return type is the source of truth. - `runtime.match` reads `m.type.primitiveTs` directly. - `DialectName` moves from the deleted `deserialize.ts` to a new one-line `src/types/dialect.ts`. All consumers (`driver.ts`, `database.ts`, `builder/sql.ts`, `types/any.ts`) rebind their imports. - SQLite codegen: `updateBarrel` re-exports from `overrides/.ts` when the file exists (matches how PG's `generateIndex` does it); `emitClassFile` receives the overrides root so the "declare or not" decision uses the same source of truth. Deletions: three deserialize.ts files and every side-effect import of them (`overrides/any.ts`, `sqlite/base.ts`). --- src/builder/sql.ts | 2 +- src/database.ts | 2 +- src/driver.ts | 2 +- src/types/any.ts | 22 ++++++++---- src/types/deserialize.ts | 35 -------------------- src/types/dialect.ts | 6 ++++ src/types/postgres/deserialize.ts | 25 -------------- src/types/postgres/generate.ts | 40 ++++++++++++++-------- src/types/postgres/generated/float4.ts | 11 +++--- src/types/postgres/generated/float8.ts | 11 +++--- src/types/postgres/generated/int2.ts | 11 +++--- src/types/postgres/generated/int4.ts | 11 +++--- src/types/postgres/generated/oid.ts | 11 +++--- src/types/postgres/index.ts | 10 +++--- src/types/postgres/overrides/any.ts | 5 --- src/types/postgres/overrides/bool.ts | 6 ++-- src/types/postgres/overrides/float4.ts | 8 +++++ src/types/postgres/overrides/float8.ts | 6 ++++ src/types/postgres/overrides/int2.ts | 6 ++++ src/types/postgres/overrides/int4.ts | 6 ++++ src/types/postgres/overrides/oid.ts | 6 ++++ src/types/runtime.ts | 4 +-- src/types/sqlite/base.ts | 2 -- src/types/sqlite/deserialize.ts | 35 -------------------- src/types/sqlite/functions.json | 2 +- src/types/sqlite/generate.ts | 46 ++++++++++++++++++++------ src/types/sqlite/generated/bool.ts | 7 ++-- src/types/sqlite/generated/integer.ts | 1 - src/types/sqlite/generated/real.ts | 1 - src/types/sqlite/index.ts | 6 ++-- src/types/sqlite/overrides/bool.ts | 8 +++++ src/types/sqlite/overrides/integer.ts | 9 +++++ src/types/sqlite/overrides/real.ts | 6 ++++ 33 files changed, 184 insertions(+), 185 deletions(-) delete mode 100644 src/types/deserialize.ts create mode 100644 src/types/dialect.ts delete mode 100644 src/types/postgres/deserialize.ts create mode 100644 src/types/postgres/overrides/float4.ts create mode 100644 src/types/postgres/overrides/float8.ts create mode 100644 src/types/postgres/overrides/int2.ts create mode 100644 src/types/postgres/overrides/int4.ts create mode 100644 src/types/postgres/overrides/oid.ts delete mode 100644 src/types/sqlite/deserialize.ts create mode 100644 src/types/sqlite/overrides/bool.ts create mode 100644 src/types/sqlite/overrides/integer.ts create mode 100644 src/types/sqlite/overrides/real.ts diff --git a/src/builder/sql.ts b/src/builder/sql.ts index b13bd94..61199ad 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -1,5 +1,5 @@ import type { Connection } from "../database"; -import type { DialectName } from "../types/deserialize"; +import type { DialectName } from "../types/dialect"; export type CompiledSql = { text: string; values: unknown[] }; diff --git a/src/database.ts b/src/database.ts index bd3834b..fea6327 100644 --- a/src/database.ts +++ b/src/database.ts @@ -13,7 +13,7 @@ import { Bus, type Subscription, type BusOptions } from "./live/bus"; import { eventsTableSqlStatements } from "./live/events-ddl"; import { runLiveIteration } from "./live/extractor"; import { parseSnapshot } from "./live/snapshot"; -import type { DialectName } from "./types/deserialize"; +import type { DialectName } from "./types/dialect"; export type TransactionIsolation = "read committed" | "repeatable read" | "serializable"; export type TransactionOptions = { diff --git a/src/driver.ts b/src/driver.ts index 19fd4fb..683f496 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -1,4 +1,4 @@ -import type { DialectName } from "./types/deserialize"; +import type { DialectName } from "./types/dialect"; import type pg from "pg"; import type BetterSqlite3 from "better-sqlite3"; diff --git a/src/types/any.ts b/src/types/any.ts index cbf6936..294c122 100644 --- a/src/types/any.ts +++ b/src/types/any.ts @@ -20,7 +20,7 @@ // concrete-type chain. import { Cast, Column, Param, sql, Sql, TypedParam, Unbound } from "../builder/sql"; import { isPlainData } from "../util"; -import { getTypeDef, type DialectName } from "./deserialize"; +import type { DialectName } from "./dialect"; import { meta } from "./meta"; import type { BoolClass } from "./bool"; import type { NullOf } from "./runtime"; @@ -61,10 +61,20 @@ export class SqlValue { static __typname: Sql; static __typnameText: string; - deserialize(raw: string): unknown { - const cls = this.constructor as typeof SqlValue; - return getTypeDef(cls.dialect.name, cls.__typnameText).deserialize(raw); - } + // The JS-primitive `typeof` this class accepts via serialize() — used + // by match() when `allowPrimitive` is set. Defaults to `"string"` since + // PG wire format hands everything back as strings; concrete overrides + // set this to `"number"` / `"boolean"` (int4, bool, ...). + static primitiveTs: string = "string"; + + // Default: identity. Overrides on the ~6 non-string typed classes + // (Bool → boolean, Int2/Int4/Oid → parseInt, Float4/Float8 → parseFloat) + // return the parsed value. Return-typed as `unknown` here so subclass + // overrides are free to narrow to any concrete type without a TS + // covariance error. Identity-typed classes (Text, Bytea, ...) get a + // `declare deserialize: (raw) => string` marker from codegen so + // `TsTypeOf>` still resolves to `string`. + deserialize(raw: string): unknown { return raw; } // Returns the underlying Sql node for embedding in other expressions toSql(): Sql { @@ -135,7 +145,7 @@ export class SqlValue { // Used by match() for runtime overload dispatch. static serialize(v: unknown): SqlValue { if (v instanceof this) { return v; } - const expected = getTypeDef(this.dialect.name, this.__typnameText).tsType; + const expected = this.primitiveTs; if (typeof v === expected) { return this.from(v); } throw new Error( `${this.__typnameText}.serialize: expected a ${this.__typnameText} instance or ${expected} primitive, got ${typeof v} (${String(v).slice(0, 60)}).`, diff --git a/src/types/deserialize.ts b/src/types/deserialize.ts deleted file mode 100644 index 95b9360..0000000 --- a/src/types/deserialize.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Dialect-aware registry: pg typname / sqlite typname → TS type + deserializer. -// Each dialect's package registers its own table via registerDialect(). -// Types not listed default to: tsType = "string", deserialize = identity. -// -// This module only knows about the *name* of a dialect ("postgres" | -// "sqlite"). The richer `Dialect` object with class references -// (SqlValue root, Bool class) lives in `./any.ts` — the two are -// intentionally separated so driver / compile-context code can talk -// about dialects without pulling in the type system. - -export interface TypeDef { - tsType: string; - deserialize: (raw: string) => unknown; -} - -export type DialectName = "postgres" | "sqlite"; - -const identity = (raw: string): string => raw; - -export const defaultTypeDef: TypeDef = { - tsType: "string", - deserialize: identity, -}; - -const registries = new Map(); - -export const registerDialect = ( - dialect: DialectName, - reg: { [key: string]: TypeDef }, -): void => { - registries.set(dialect, reg); -}; - -export const getTypeDef = (dialect: DialectName, typname: string): TypeDef => - registries.get(dialect)?.[typname] ?? defaultTypeDef; diff --git a/src/types/dialect.ts b/src/types/dialect.ts new file mode 100644 index 0000000..3ec6161 --- /dev/null +++ b/src/types/dialect.ts @@ -0,0 +1,6 @@ +// The set of SQL dialects typegres knows about. Threaded through +// CompileContext / Driver / Dialect descriptor as the authoritative +// dialect tag. Extend this union to register a new dialect — every +// switch on `DialectName` becomes an exhaustiveness error until the +// new case is handled. +export type DialectName = "postgres" | "sqlite"; diff --git a/src/types/postgres/deserialize.ts b/src/types/postgres/deserialize.ts deleted file mode 100644 index 02b8b94..0000000 --- a/src/types/postgres/deserialize.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Postgres-side wire-format deserializers. -// -// int8 / bytea sit at "string" rather than bigint / Uint8Array on purpose: -// the RPC wire format is JSON, and bigint/Uint8Array don't survive JSON -// round-tripping. Keeping deserialize as identity here means the wire is -// JSON-clean by default. Users who want bigint arithmetic can `BigInt(s)` -// themselves; bytea stays as pg's hex string (`\xDEADBEEF`). A richer -// wire codec (bigint, bytes, dates as sentinels) is a v0.2 item — see -// ISSUES.md. -import { registerDialect, type TypeDef } from "../deserialize.ts"; - -const parseBoolean = (raw: string): boolean => raw === "t"; -const parseInt32 = (raw: string): number => parseInt(raw, 10); -// parseFloat handles NaN, Infinity, -Infinity natively - -export const postgresRegistry: { [key: string]: TypeDef } = { - bool: { tsType: "boolean", deserialize: parseBoolean }, - int2: { tsType: "number", deserialize: parseInt32 }, - int4: { tsType: "number", deserialize: parseInt32 }, - float4: { tsType: "number", deserialize: parseFloat }, - float8: { tsType: "number", deserialize: parseFloat }, - oid: { tsType: "number", deserialize: parseInt32 }, -}; - -registerDialect("postgres", postgresRegistry); diff --git a/src/types/postgres/generate.ts b/src/types/postgres/generate.ts index 6d37408..fa1f410 100644 --- a/src/types/postgres/generate.ts +++ b/src/types/postgres/generate.ts @@ -4,8 +4,6 @@ import * as fs from "node:fs"; import * as path from "node:path"; import { pathToFileURL } from "node:url"; import { requireDatabaseUrl } from "../../pg.ts"; -import { getTypeDef } from "../deserialize.ts"; -import "./deserialize.ts"; import { introspect, groupByFirstArg, @@ -23,8 +21,24 @@ const GENERATED_DIR = outDirFlag >= 0 const OVERRIDES_DIR = path.resolve(import.meta.dirname, "overrides"); const TYPES_INDEX = path.resolve(import.meta.dirname, "index.ts"); -const tsPrimitiveFor = (typname: string): string => - getTypeDef("postgres", typname).tsType; +// TS-primitive `typeof` accepted by each pg type via allowPrimitive. The +// concrete override files (overrides/int4.ts, overrides/bool.ts, ...) +// set `static primitiveTs` to the same value — this map only exists +// so codegen can build `M0 extends Cls | number` in method arg +// constraints and disambiguate primitive-sig-colliding overloads. Add +// an entry here when adding a matching overrides/.ts; everything +// unlisted defaults to "string" (identity). +const primitiveTsFor = (typname: string): string => { + switch (typname) { + case "bool": return "boolean"; + case "int2": + case "int4": + case "float4": + case "float8": + case "oid": return "number"; + default: return "string"; + } +}; // Types that get a generic > parameter const GENERIC_TYPES = new Set([ @@ -264,9 +278,12 @@ const generateTypeFile = ( if (pgType.typname === "any") { // Handled by override — no-op here } else if (!EXTENDS_MAP[pgType.typname]) { - // Concrete type — narrow [meta] and deserialize return type - // If override exists, reference via types.Cls (barrel namespace) so [meta] points to the override - const tsType = tsPrimitiveFor(pgType.typname); + // Concrete type — narrow [meta]. For classes with no hand-written + // override under overrides/, emit a `declare deserialize` return-type + // marker so `TsTypeOf>` narrows (SqlValue.deserialize returns + // `unknown`). For classes with an override, the override provides + // both the runtime parser AND the narrower return type — codegen + // skips the declare to avoid a contradictory signature. const cls = pgType.className; const ref = overrideNames.has(pgType.typname) ? `types.${cls}` : cls; // Subclass [meta] redeclarations replace the parent's — repeat __raw @@ -282,11 +299,8 @@ const generateTypeFile = ( lines.push(` };`); lines.push(` static __typname = runtime.sql\`${pgType.typname}\`;`); lines.push(` static __typnameText = "${pgType.typname}";`); - // Only narrow the deserialize return type if there's no override — the - // override is the source of truth (e.g. Record widens to - // RowTypeToTsType, which isn't expressible here). if (!overrideNames.has(pgType.typname)) { - lines.push(` declare deserialize: (raw: string) => ${tsType};`); + lines.push(` declare deserialize: (raw: string) => ${primitiveTsFor(pgType.typname)};`); } } else { // any* hierarchy type — inherits [meta] from parent, no re-declaration needed @@ -310,7 +324,7 @@ const generateTypeFile = ( return `M${i} extends ${constraint}`; } return allowPrimitive - ? `M${i} extends ${constraint} | ${tsPrimitiveFor(t.typname)}` + ? `M${i} extends ${constraint} | ${primitiveTsFor(t.typname)}` : `M${i} extends ${constraint}`; }; @@ -382,7 +396,7 @@ const generateTypeFile = ( f.argTypes.slice(1) .map((oid) => { const t = typeMap.get(oid); - return t ? tsPrimitiveFor(t.typname) : ""; + return t ? primitiveTsFor(t.typname) : ""; }) .join("|"); diff --git a/src/types/postgres/generated/float4.ts b/src/types/postgres/generated/float4.ts index 31fcafd..07707dd 100644 --- a/src/types/postgres/generated/float4.ts +++ b/src/types/postgres/generated/float4.ts @@ -6,17 +6,16 @@ import * as types from "../index"; export class Float4 extends Anynonarray { declare [runtime.meta]: { - __class: typeof Float4; + __class: typeof types.Float4; __raw: runtime.Sql; __nullability: N; - __nullable: Float4<0 | 1>; - __nonNullable: Float4<1>; - __aggregate: Float4; - __any: Float4; + __nullable: types.Float4<0 | 1>; + __nonNullable: types.Float4<1>; + __aggregate: types.Float4; + __any: types.Float4; }; static __typname = runtime.sql`float4`; static __typnameText = "float4"; - declare deserialize: (raw: string) => number; @expose.unchecked() abs(): types.Float4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float4]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() diff --git a/src/types/postgres/generated/float8.ts b/src/types/postgres/generated/float8.ts index 2465744..17bb939 100644 --- a/src/types/postgres/generated/float8.ts +++ b/src/types/postgres/generated/float8.ts @@ -6,17 +6,16 @@ import * as types from "../index"; export class Float8 extends Anynonarray { declare [runtime.meta]: { - __class: typeof Float8; + __class: typeof types.Float8; __raw: runtime.Sql; __nullability: N; - __nullable: Float8<0 | 1>; - __nonNullable: Float8<1>; - __aggregate: Float8; - __any: Float8; + __nullable: types.Float8<0 | 1>; + __nonNullable: types.Float8<1>; + __aggregate: types.Float8; + __any: types.Float8; }; static __typname = runtime.sql`float8`; static __typnameText = "float8"; - declare deserialize: (raw: string) => number; @expose.unchecked() abs(): types.Float8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Float8]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() diff --git a/src/types/postgres/generated/int2.ts b/src/types/postgres/generated/int2.ts index bcec918..3cf79d9 100644 --- a/src/types/postgres/generated/int2.ts +++ b/src/types/postgres/generated/int2.ts @@ -6,17 +6,16 @@ import * as types from "../index"; export class Int2 extends Anynonarray { declare [runtime.meta]: { - __class: typeof Int2; + __class: typeof types.Int2; __raw: runtime.Sql; __nullability: N; - __nullable: Int2<0 | 1>; - __nonNullable: Int2<1>; - __aggregate: Int2; - __any: Int2; + __nullable: types.Int2<0 | 1>; + __nonNullable: types.Int2<1>; + __aggregate: types.Int2; + __any: types.Int2; }; static __typname = runtime.sql`int2`; static __typnameText = "int2"; - declare deserialize: (raw: string) => number; @expose.unchecked() abs(): types.Int2 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int2]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() diff --git a/src/types/postgres/generated/int4.ts b/src/types/postgres/generated/int4.ts index 164b2ee..91d97bd 100644 --- a/src/types/postgres/generated/int4.ts +++ b/src/types/postgres/generated/int4.ts @@ -6,17 +6,16 @@ import * as types from "../index"; export class Int4 extends Anynonarray { declare [runtime.meta]: { - __class: typeof Int4; + __class: typeof types.Int4; __raw: runtime.Sql; __nullability: N; - __nullable: Int4<0 | 1>; - __nonNullable: Int4<1>; - __aggregate: Int4; - __any: Int4; + __nullable: types.Int4<0 | 1>; + __nonNullable: types.Int4<1>; + __aggregate: types.Int4; + __any: types.Int4; }; static __typname = runtime.sql`int4`; static __typnameText = "int4"; - declare deserialize: (raw: string) => number; @expose.unchecked() abs(): types.Int4 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int4]]); return runtime.funcCall("abs", [this, ...__rest], __rt) as any; } @expose.unchecked() diff --git a/src/types/postgres/generated/oid.ts b/src/types/postgres/generated/oid.ts index f2cb696..8d46a58 100644 --- a/src/types/postgres/generated/oid.ts +++ b/src/types/postgres/generated/oid.ts @@ -6,17 +6,16 @@ import * as types from "../index"; export class Oid extends Anynonarray { declare [runtime.meta]: { - __class: typeof Oid; + __class: typeof types.Oid; __raw: runtime.Sql; __nullability: N; - __nullable: Oid<0 | 1>; - __nonNullable: Oid<1>; - __aggregate: Oid; - __any: Oid; + __nullable: types.Oid<0 | 1>; + __nonNullable: types.Oid<1>; + __aggregate: types.Oid; + __any: types.Oid; }; static __typname = runtime.sql`oid`; static __typnameText = "oid"; - declare deserialize: (raw: string) => number; @expose.unchecked() int8(): types.Int8 { const [__rt, ...__rest] = runtime.match([], [[[], types.Int8]]); return runtime.funcCall("int8", [this, ...__rest], __rt) as any; } @expose.unchecked() diff --git a/src/types/postgres/index.ts b/src/types/postgres/index.ts index bad725d..656e97a 100644 --- a/src/types/postgres/index.ts +++ b/src/types/postgres/index.ts @@ -22,12 +22,12 @@ export { Cid } from "./generated/cid"; export { Cidr } from "./generated/cidr"; export { Circle } from "./generated/circle"; export { Date } from "./generated/date"; -export { Float4 } from "./generated/float4"; -export { Float8 } from "./generated/float8"; +export { Float4 } from "./overrides/float4"; +export { Float8 } from "./overrides/float8"; export { Gtsvector } from "./generated/gtsvector"; export { Inet } from "./generated/inet"; -export { Int2 } from "./generated/int2"; -export { Int4 } from "./generated/int4"; +export { Int2 } from "./overrides/int2"; +export { Int4 } from "./overrides/int4"; export { Int8 } from "./generated/int8"; export { Interval } from "./generated/interval"; export { Json } from "./generated/json"; @@ -37,7 +37,7 @@ export { Macaddr } from "./generated/macaddr"; export { Macaddr8 } from "./generated/macaddr8"; export { Money } from "./generated/money"; export { Numeric } from "./generated/numeric"; -export { Oid } from "./generated/oid"; +export { Oid } from "./overrides/oid"; export { Path } from "./generated/path"; export { PgBrinBloomSummary } from "./generated/pg_brin_bloom_summary"; export { PgBrinMinmaxMultiSummary } from "./generated/pg_brin_minmax_multi_summary"; diff --git a/src/types/postgres/overrides/any.ts b/src/types/postgres/overrides/any.ts index 256a469..678d511 100644 --- a/src/types/postgres/overrides/any.ts +++ b/src/types/postgres/overrides/any.ts @@ -18,11 +18,6 @@ import * as types from "../index"; import { sql, type Sql } from "../../../builder/sql"; import { expose } from "../../../exoeval/tool"; import { isPlainData } from "../../../util"; -// Side-effect import: registers the PG dialect's deserialize table -// (see ../deserialize.ts). The barrel imports this file, so importing -// any pg type transitively populates the registry before any typed -// value gets constructed. -import "../deserialize"; export class Any extends Generated { // Narrow SqlValue's `[meta].__aggregate: SqlValue` to diff --git a/src/types/postgres/overrides/bool.ts b/src/types/postgres/overrides/bool.ts index d705860..40958be 100644 --- a/src/types/postgres/overrides/bool.ts +++ b/src/types/postgres/overrides/bool.ts @@ -3,10 +3,8 @@ import { boolAnd, boolOr, boolNot } from "../../bool-mixin"; import type { NullOf, StrictNull } from "../../runtime"; export class Bool extends Generated { - // Codegen skips `declare deserialize` when an override exists (the override - // is the source of truth). Declare it here so `TsTypeOf>` narrows to - // `boolean` instead of `unknown`. - declare deserialize: (raw: string) => boolean; + static override primitiveTs = "boolean"; + override deserialize(raw: string): boolean { return raw === "t"; } and>(other: M): Bool>> { return Bool.from(boolAnd(this.toSql(), other)) as any; diff --git a/src/types/postgres/overrides/float4.ts b/src/types/postgres/overrides/float4.ts new file mode 100644 index 0000000..470b028 --- /dev/null +++ b/src/types/postgres/overrides/float4.ts @@ -0,0 +1,8 @@ +import { Float4 as Generated } from "../generated/float4"; + +// parseFloat handles NaN, Infinity, -Infinity natively — same as pg's +// text representation for these edge cases. +export class Float4 extends Generated { + static override primitiveTs = "number"; + override deserialize(raw: string): number { return parseFloat(raw); } +} diff --git a/src/types/postgres/overrides/float8.ts b/src/types/postgres/overrides/float8.ts new file mode 100644 index 0000000..df68d2c --- /dev/null +++ b/src/types/postgres/overrides/float8.ts @@ -0,0 +1,6 @@ +import { Float8 as Generated } from "../generated/float8"; + +export class Float8 extends Generated { + static override primitiveTs = "number"; + override deserialize(raw: string): number { return parseFloat(raw); } +} diff --git a/src/types/postgres/overrides/int2.ts b/src/types/postgres/overrides/int2.ts new file mode 100644 index 0000000..452a00c --- /dev/null +++ b/src/types/postgres/overrides/int2.ts @@ -0,0 +1,6 @@ +import { Int2 as Generated } from "../generated/int2"; + +export class Int2 extends Generated { + static override primitiveTs = "number"; + override deserialize(raw: string): number { return parseInt(raw, 10); } +} diff --git a/src/types/postgres/overrides/int4.ts b/src/types/postgres/overrides/int4.ts new file mode 100644 index 0000000..c8c6148 --- /dev/null +++ b/src/types/postgres/overrides/int4.ts @@ -0,0 +1,6 @@ +import { Int4 as Generated } from "../generated/int4"; + +export class Int4 extends Generated { + static override primitiveTs = "number"; + override deserialize(raw: string): number { return parseInt(raw, 10); } +} diff --git a/src/types/postgres/overrides/oid.ts b/src/types/postgres/overrides/oid.ts new file mode 100644 index 0000000..ce5dee1 --- /dev/null +++ b/src/types/postgres/overrides/oid.ts @@ -0,0 +1,6 @@ +import { Oid as Generated } from "../generated/oid"; + +export class Oid extends Generated { + static override primitiveTs = "number"; + override deserialize(raw: string): number { return parseInt(raw, 10); } +} diff --git a/src/types/runtime.ts b/src/types/runtime.ts index ad58a38..edd6e53 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -7,7 +7,6 @@ import type { Any } from "./postgres"; // Extracting an N from a typed value works uniformly across dialects // because every dialect's root class extends SqlValue. import { SqlValue } from "./any"; -import { getTypeDef } from "./deserialize"; import { isPlainData } from "../util"; import type { RowType } from "../builder/query"; @@ -134,8 +133,7 @@ export const match = (args: unknown[], cases: MatchCase[]): [typeof SqlValue, .. return true; } if (m.allowPrimitive) { - const expected = getTypeDef(m.type.dialect.name, m.type.__typnameText).tsType; - if (typeof arg === expected) { + if (typeof arg === m.type.primitiveTs) { return true; } } diff --git a/src/types/sqlite/base.ts b/src/types/sqlite/base.ts index f6e59bc..f3cb64c 100644 --- a/src/types/sqlite/base.ts +++ b/src/types/sqlite/base.ts @@ -17,8 +17,6 @@ import * as types from "./index"; import { sql, type Sql } from "../../builder/sql"; import { expose } from "../../exoeval/tool"; import { isPlainData } from "../../util"; -// Side-effect import: registers the SQLite dialect's deserialize table. -import "./deserialize"; export class SqliteValue extends SqlValue { declare [meta]: { diff --git a/src/types/sqlite/deserialize.ts b/src/types/sqlite/deserialize.ts deleted file mode 100644 index 604c5de..0000000 --- a/src/types/sqlite/deserialize.ts +++ /dev/null @@ -1,35 +0,0 @@ -// SQLite-side wire-format deserializers. -// -// Unlike PG (where every value comes back as a raw string and needs -// per-type parsing), better-sqlite3 hands us typed JS values directly -// — integers as number (or bigint under safeIntegers), reals as number, -// text as string, blobs as Buffer/Uint8Array. So `deserialize` is -// identity for most types; the registry mainly exists to teach the -// overload matcher what TS primitive each SQLite type accepts. -// -// Bool is a convention: SQLite stores 0/1 as INTEGER. `bool` here is the -// registry key (not a native SQLite storage class); `Bool.__typname` -// still emits `INTEGER` in CAST expressions. -import { registerDialect, type TypeDef } from "../deserialize.ts"; - -const identity = (raw: string): string => raw; -const parseIntFromText = (raw: string): number => parseInt(raw, 10); - -export const sqliteRegistry: { [key: string]: TypeDef } = { - integer: { tsType: "number", deserialize: parseIntFromText }, - real: { tsType: "number", deserialize: parseFloat }, - text: { tsType: "string", deserialize: identity }, - // Blob's TS-primitive slot is a sentinel that `typeof x` never - // returns — so the overload matcher won't wrongly accept arbitrary - // objects (Date, plain records, arrays) as a blob primitive. - // Blob values pass through as Uint8Array/Buffer at the driver - // layer; the deserialize path is unreachable for now. - // - // See ISSUES.md #A1: proper JS-side blob repr (Uint8Array vs Buffer - // vs base64) is still open. When resolved, replace this sentinel - // with a matcher that accepts the chosen representation. - blob: { tsType: "__blob_unsupported__", deserialize: identity }, - bool: { tsType: "boolean", deserialize: (raw) => raw === "1" }, -}; - -registerDialect("sqlite", sqliteRegistry); diff --git a/src/types/sqlite/functions.json b/src/types/sqlite/functions.json index ca0237e..4a08c54 100644 --- a/src/types/sqlite/functions.json +++ b/src/types/sqlite/functions.json @@ -1,6 +1,6 @@ { "sqlite_version": "3.53.2", - "generated_at": "2026-07-01T23:46:51.962Z", + "generated_at": "2026-07-03T00:21:29.958Z", "function_count": 197, "functions": { "->": [ diff --git a/src/types/sqlite/generate.ts b/src/types/sqlite/generate.ts index 3b095d7..43dce76 100644 --- a/src/types/sqlite/generate.ts +++ b/src/types/sqlite/generate.ts @@ -285,9 +285,16 @@ const dedup = (methods: Method[]): Method[] => { return [...seen.values()]; }; +// Whether an override for the given SQLite storage class exists under +// overrides/. Callers pass the override root (typically `src/types/sqlite`) +// so codegen:check with `--out-dir` still checks the committed overrides. +const overrideExistsFor = (overridesRoot: string, ownerType: string): boolean => + fs.existsSync(path.join(overridesRoot, "overrides", `${ownerType}.ts`)); + const emitClassFile = ( ownerType: Exclude, methods: readonly Method[], + overridesRoot: string, ): string => { const className = CLASS_FOR[ownerType]; const argClass = (t: Exclude): string => `types.${CLASS_FOR[t]}`; @@ -314,16 +321,20 @@ const emitClassFile = ( lines.push(" };"); lines.push(` static override __typname = sql\`${ownerType.toUpperCase()}\`;`); lines.push(` static override __typnameText = "${ownerType}";`); - // deserialize's return type feeds `TsTypeOf` in runtime.ts; without - // an explicit signature it falls through to `unknown` and rows come - // back untyped. The tsType strings map to concrete TS types below. - const deserializeTsType: Record, string> = { + // Return-type marker for TsTypeOf. Overrides under overrides/ provide + // the runtime parser AND a narrower return type (integer/real → + // number, bool → boolean). Codegen still emits a `declare` here for + // the classes that don't have an override (text → string, blob → + // Uint8Array) so their rows type correctly. + const declaredTsType: Record, string> = { integer: "number", real: "number", text: "string", blob: "Uint8Array", }; - lines.push(` declare deserialize: (raw: string) => ${deserializeTsType[ownerType]};`); + if (!overrideExistsFor(overridesRoot, ownerType)) { + lines.push(` declare deserialize: (raw: string) => ${declaredTsType[ownerType]};`); + } lines.push(""); // Per-storage-class JS primitive that gets accepted alongside the @@ -373,6 +384,7 @@ const emitClassFile = ( const emitClasses = ( sigs: FunctionSig[], generatedDir: string, + overridesRoot: string, ): void => { const allMethods = sigs.flatMap(methodsFor); const byOwner: Record, Method[]> = { @@ -384,7 +396,7 @@ const emitClasses = ( for (const owner of Object.keys(byOwner) as Exclude[]) { const methods = dedup(byOwner[owner]).sort((a, b) => a.tsName.localeCompare(b.tsName)); - const src = emitClassFile(owner, methods); + const src = emitClassFile(owner, methods, overridesRoot); const out = path.join(generatedDir, `${owner}.ts`); fs.writeFileSync(out, src); console.log(` ${owner}.ts: ${methods.length} methods`); @@ -419,18 +431,32 @@ const main = () => { const generatedDir = path.join(outDir, "generated"); fs.mkdirSync(generatedDir, { recursive: true }); - emitClasses(sigs, generatedDir); + // codegen:check writes to a tmp dir but the committed overrides + // still live under `src/types/sqlite/overrides/`. Point the + // override-detection helper at the source tree so `--out-dir` + // runs see the same override set as a normal codegen run. + const overridesRoot = path.resolve(import.meta.dirname); + emitClasses(sigs, generatedDir, overridesRoot); updateBarrel(path.join(outDir, "index.ts")); }; // Rewrite the [generated-start]...[generated-end] block of index.ts to -// list all classes we just emitted, plus the hand-written Bool. Same -// pattern PG codegen uses for its barrel. +// list all classes we just emitted. Classes that have a hand-written +// override under overrides/.ts are re-exported from there; +// everything else comes straight from generated/. const updateBarrel = (barrelPath: string): void => { const classes = ["Blob", "Bool", "Integer", "Real", "Text"]; + const overridesDir = path.join(path.dirname(barrelPath), "overrides"); + const hasOverride = (c: string): boolean => + fs.existsSync(path.join(overridesDir, `${c.toLowerCase()}.ts`)); const block = "// [generated-start]\n" + - classes.map((c) => `export { ${c} } from "./generated/${c.toLowerCase()}";`).join("\n") + + classes + .map((c) => { + const dir = hasOverride(c) ? "overrides" : "generated"; + return `export { ${c} } from "./${dir}/${c.toLowerCase()}";`; + }) + .join("\n") + "\n// [generated-end]"; const cur = fs.readFileSync(barrelPath, "utf8"); const next = cur.replace( diff --git a/src/types/sqlite/generated/bool.ts b/src/types/sqlite/generated/bool.ts index 2ec4bb7..e795e3a 100644 --- a/src/types/sqlite/generated/bool.ts +++ b/src/types/sqlite/generated/bool.ts @@ -4,8 +4,10 @@ // reference `types.Bool` and the barrel resolves. // // SQLite has no native bool type — the storage class is INTEGER 0/1. -// `__typname = INTEGER` for CAST(...); `__typnameText = "bool"` keys -// into the deserialize registry (which knows 0/1 → boolean). +// `__typname = INTEGER` for CAST(...); `__typnameText = "bool"` is the +// key used for error messages. The `deserialize` + `primitiveTs` +// overrides live in ../overrides/bool.ts alongside the other SQLite +// storage-class overrides. import { SqliteValue } from "../base"; import { boolAnd, boolOr, boolNot } from "../../bool-mixin"; import { sql, type Sql } from "../../../builder/sql"; @@ -24,7 +26,6 @@ export class Bool extends SqliteValue { }; static override __typname = sql`INTEGER`; static override __typnameText = "bool"; - declare deserialize: (raw: string) => boolean; and>(other: M): Bool>> { return Bool.from(boolAnd(this.toSql(), other)) as any; diff --git a/src/types/sqlite/generated/integer.ts b/src/types/sqlite/generated/integer.ts index af36052..515723c 100644 --- a/src/types/sqlite/generated/integer.ts +++ b/src/types/sqlite/generated/integer.ts @@ -20,7 +20,6 @@ export class Integer extends SqliteValue { }; static override __typname = sql`INTEGER`; static override __typnameText = "integer"; - declare deserialize: (raw: string) => number; abs(): types.Integer { const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); diff --git a/src/types/sqlite/generated/real.ts b/src/types/sqlite/generated/real.ts index 29c462e..64efc25 100644 --- a/src/types/sqlite/generated/real.ts +++ b/src/types/sqlite/generated/real.ts @@ -20,7 +20,6 @@ export class Real extends SqliteValue { }; static override __typname = sql`REAL`; static override __typnameText = "real"; - declare deserialize: (raw: string) => number; abs(): types.Real { const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); diff --git a/src/types/sqlite/index.ts b/src/types/sqlite/index.ts index 4ac6c92..6bd2a26 100644 --- a/src/types/sqlite/index.ts +++ b/src/types/sqlite/index.ts @@ -4,8 +4,8 @@ export { SqliteValue } from "./base"; // [generated-start] export { Blob } from "./generated/blob"; -export { Bool } from "./generated/bool"; -export { Integer } from "./generated/integer"; -export { Real } from "./generated/real"; +export { Bool } from "./overrides/bool"; +export { Integer } from "./overrides/integer"; +export { Real } from "./overrides/real"; export { Text } from "./generated/text"; // [generated-end] diff --git a/src/types/sqlite/overrides/bool.ts b/src/types/sqlite/overrides/bool.ts new file mode 100644 index 0000000..07efc3a --- /dev/null +++ b/src/types/sqlite/overrides/bool.ts @@ -0,0 +1,8 @@ +import { Bool as Generated } from "../generated/bool"; + +// SQLite stores booleans as INTEGER 0/1; the driver stringifies them +// to "0" / "1" before hydration. +export class Bool extends Generated { + static override primitiveTs = "boolean"; + override deserialize(raw: string): boolean { return raw === "1"; } +} diff --git a/src/types/sqlite/overrides/integer.ts b/src/types/sqlite/overrides/integer.ts new file mode 100644 index 0000000..72ac66c --- /dev/null +++ b/src/types/sqlite/overrides/integer.ts @@ -0,0 +1,9 @@ +import { Integer as Generated } from "../generated/integer"; + +// better-sqlite3 hands us JS numbers directly; the SqliteDriver stringifies +// them via `String(v)` before hydration (so PG and SQLite share one +// deserialize path). parseInt reverses that stringification. +export class Integer extends Generated { + static override primitiveTs = "number"; + override deserialize(raw: string): number { return parseInt(raw, 10); } +} diff --git a/src/types/sqlite/overrides/real.ts b/src/types/sqlite/overrides/real.ts new file mode 100644 index 0000000..f6cc096 --- /dev/null +++ b/src/types/sqlite/overrides/real.ts @@ -0,0 +1,6 @@ +import { Real as Generated } from "../generated/real"; + +export class Real extends Generated { + static override primitiveTs = "number"; + override deserialize(raw: string): number { return parseFloat(raw); } +}