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/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/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/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/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 474e781..fb3d218 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 && 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", @@ -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/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/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/delete.ts b/src/builder/delete.ts index 75ab646..69f3ad0 100644 --- a/src/builder/delete.ts +++ b/src/builder/delete.ts @@ -1,10 +1,10 @@ -import { Sql, sql, Alias, compile } from "./sql"; +import { Sql, sql, Alias, compile, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; -import { Bool } from "../types"; +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"; -import { Database } from "../database"; +import { Connection } from "../database"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; @@ -13,6 +13,7 @@ type Namespace = { [K in Name]: T }; type DeleteOpts = { instance: T; where?: (ns: Namespace) => Bool; + matchAll?: boolean; returning?: (ns: Namespace) => R; }; @@ -23,7 +24,8 @@ type FinalizedDeleteOpts; + where: Bool | undefined; + matchAll: boolean; returning?: R; }; @@ -36,10 +38,13 @@ export class FinalizedDelete z.instanceof(Bool)))])) + get database() { + return this.#opts.instance.constructor.database; + } + + // Multiple where() calls are combined with AND. .where(true) matches all rows — + // stored as a matchAll flag; bind() emits no WHERE clause. + @expose(z.union([z.literal(true), fn.returns(z.custom>(isBool))])) where(fn: ((ns: Namespace) => Bool) | true): DeleteBuilder { - const wrapped: (ns: Namespace) => Bool = - fn === true ? () => Bool.from(sql`TRUE`) as Bool : 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), }); } @@ -89,46 +100,48 @@ 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 } : {}), }); } - bind(): BoundSql { + bind(ctx: CompileContext): BoundSql { const t = this.#opts.instance.constructor.transformer?.delete; - return (t ? t(this) : this.finalize()).bind(); + return (t ? t(this) : this.finalize()).bind(ctx); } override children() { return [this.finalize()]; } - @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); } - @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() debug(): this { - const compiled = compile(this, "pg"); + const database = this.#opts.instance.constructor.database; + const compiled = compile(this, { database }); console.log("Debugging query:", { sql: compiled.text, parameters: compiled.values }); return this; } 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/insert.ts b/src/builder/insert.ts index d64dc5f..7371df6 100644 --- a/src/builder/insert.ts +++ b/src/builder/insert.ts @@ -1,10 +1,10 @@ -import { Sql, sql, Alias, compile } from "./sql"; +import { Sql, sql, Alias, compile, type CompileContext } from "./sql"; 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 { getColumn } from "../types/overrides/any"; +import { Connection } from "../database"; +import { getColumn } from "../types/any"; import { meta } from "../types/runtime"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; @@ -37,7 +37,8 @@ export class FinalizedInsert 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((v) => isRowType(v)))) returning(fn: (ns: Namespace) => R2): InsertBuilder { return new InsertBuilder({ ...this.#opts, returning: fn }); @@ -106,28 +111,29 @@ 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() debug(): this { - const compiled = compile(this, "pg"); + const database = this.#opts.instance.constructor.database; + const compiled = compile(this, { database }); console.log("Debugging query:", { sql: compiled.text, parameters: compiled.values }); return this; } diff --git a/src/builder/query.test.ts b/src/builder/query.test.ts index 6659b5d..9d71d8c 100644 --- a/src/builder/query.test.ts +++ b/src/builder/query.test.ts @@ -1,22 +1,26 @@ 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 } from "./sql"; -import { setupDb, db } from "../test-helpers"; +import { setupDb, db, conn } from "../test-helpers"; import { expose } from "typegres"; setupDb(); +// `db` is populated inside setupDb's beforeAll — but each `compile(q, pgCtx)` +// call is inside a test body which runs after beforeAll, so this lazy getter +// captures the current value each time. +const pgCtx = { get database() { return db; } }; // --- values() --- test("values with single typed row", async () => { 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 +28,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 +37,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("+"); }); @@ -41,13 +45,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 +60,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 +71,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 +82,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 +90,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 +98,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 +107,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)) ); @@ -113,7 +117,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,13 +131,13 @@ 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"); }); 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 +153,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 }, @@ -178,14 +182,14 @@ 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"); }); 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 +209,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 }, @@ -233,13 +237,13 @@ 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"); }); 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 +252,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 +261,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 +279,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 +301,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 +311,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 +321,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 +332,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 +344,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 +590,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 +601,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 +612,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 +635,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 +649,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 +662,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 +676,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 +687,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 +697,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 +717,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 +728,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 +739,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 +761,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 }, @@ -834,20 +838,24 @@ 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/); + // 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", () => { 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 () => { +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 0a790d0..6f79c5a 100644 --- a/src/builder/query.ts +++ b/src/builder/query.ts @@ -1,8 +1,14 @@ -import type { BoundSql } from "./sql"; -import { sql, Sql, Alias, compile } from "./sql"; -import { Database } from "../database"; -import { Bool } from "../types"; -import { Any, Anyarray, Record } from "../types"; +import type { BoundSql, CompileContext, DatabaseRef } from "./sql"; +import { sql, Sql, Alias, Ident, compile } from "./sql"; +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/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 } 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,9 +19,9 @@ 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)}`] : [], + sql`${v.toSql()} as ${new Ident(k)}`] : [], ), ); }; @@ -24,15 +30,21 @@ 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. + // + // 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 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))), + value: desc.value[meta].__class.from(sql.column(alias, new Ident(key as string, database))), }); } else { Object.defineProperty(out, key, desc); @@ -42,9 +54,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 +74,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 +88,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 +100,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 @@ -124,12 +137,16 @@ 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; 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?: CompileContext): BoundSql; emitColumnNamesWithAlias?: boolean; // default false; if true, emit column names in FROM clause (e.g. VALUES) }; @@ -142,6 +159,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: Bool): Bool }; export const combinePredicates = ( left: ((ns: N) => Bool) | undefined, right: (ns: N) => Bool, @@ -149,13 +170,13 @@ export const combinePredicates = ( 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; + 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,18 +201,23 @@ 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[]> = { + // 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. @@ -216,7 +242,7 @@ export type QueryBuilderOptions[], + GB extends SqlValue[], Card extends Cardinality = "many", > extends Sql { public readonly opts: QueryBuilderOptions; @@ -239,7 +265,7 @@ export class QueryBuilder< } // Multiple `where` calls are combined with AND - @expose(fn.returns(z.lazy(() => z.instanceof(Bool)))) + @expose(fn.returns(z.custom>(isBool))) where(where: (n: N) => Bool): QueryBuilder { return new QueryBuilder({ ...this.opts, @@ -272,7 +298,7 @@ export class QueryBuilder< from: Fromable, on: (ns: N & { [k in A]: R }) => Bool, ): QueryBuilder; - @expose(z.custom(isFromable), fn.returns(z.lazy(() => z.instanceof(Bool)))) + @expose(z.custom(isFromable), fn.returns(z.custom>(isBool))) join(from: Fromable, on: (ns: any) => Bool): any { this.#assertNotInNamespace(from.tsAlias); return new QueryBuilder({ @@ -289,7 +315,7 @@ export class QueryBuilder< from: Fromable, onFn: (ns: N & { [k in A]: RowTypeToNullable }) => Bool, ): QueryBuilder }, O, GB>; - @expose(z.custom(isFromable), fn.returns(z.lazy(() => z.instanceof(Bool)))) + @expose(z.custom(isFromable), fn.returns(z.custom>(isBool))) leftJoin(from: Fromable, onFn: (ns: any) => Bool): any { this.#assertNotInNamespace(from.tsAlias); return new QueryBuilder({ @@ -304,11 +330,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,13 +343,13 @@ 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)))) + @expose(fn.returns(z.custom>(isBool))) having(having: (n: N) => Bool): QueryBuilder { return new QueryBuilder({ ...this.opts, @@ -345,8 +371,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]; @@ -369,42 +395,43 @@ 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; } - // 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 (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"] @@ -412,6 +439,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 ...) @@ -495,8 +531,12 @@ export class QueryBuilder< }); } - bind(): BoundSql { - return this.finalize().bind(); + bind(ctx: CompileContext): BoundSql { + // ctx is threaded to FinalizedQuery.bind → t.source.bind(ctx), + // where Srf sources read `ctx.database` to construct their + // function-name Ident. Insert/Update/Delete builders don't need + // ctx since they don't call source.bind. + return this.finalize().bind(ctx); } children() { @@ -510,7 +550,7 @@ export class QueryBuilder< @expose() debug(): this { - const compiled = compile(this, "pg"); + const compiled = compile(this, { database: this.opts.database }); console.log("Debugging query:", { sql: compiled.text, parameters: compiled.values }); return this; } @@ -519,7 +559,7 @@ export class QueryBuilder< type AppliedOpts = { select: RowType; where?: Bool | undefined; - groupBy?: Any[] | undefined; + groupBy?: SqlValue[] | undefined; having?: Bool | undefined; orderBy?: OrderByEntry[] | undefined; tables: [ @@ -550,19 +590,19 @@ 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); } - bind(): BoundSql { + bind(ctx: 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}(${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}`); @@ -583,7 +623,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/sql.test.ts b/src/builder/sql.test.ts index b5f16f5..135807b 100644 --- a/src/builder/sql.test.ts +++ b/src/builder/sql.test.ts @@ -1,42 +1,51 @@ import { test, expect } from "vitest"; -import { sql, compile } 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}`; - 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: [] }); + 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'); - expect(compile(q, "pg")).toEqual({ text: '"foo""bar"', values: [] }); + 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, "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({ + 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], }); }); 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: [] }); + 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 31f4149..61199ad 100644 --- a/src/builder/sql.ts +++ b/src/builder/sql.ts @@ -1,7 +1,32 @@ -import type { Database } from "../database"; +import type { Connection } from "../database"; +import type { DialectName } from "../types/dialect"; export type CompiledSql = { text: string; values: unknown[] }; +// 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; + // 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 +// (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 }; + // --- Root --- // Every SQL node extends Sql. bind() produces a single BoundSql — one of @@ -12,17 +37,13 @@ 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 - // 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)`. - execute(db: Database): Promise { - return db.execute(this); + // Fluent terminator: `someSql.execute(conn)` === `conn.execute(someSql)`. + execute(conn: Connection): Promise { + return conn.execute(this); } } @@ -80,8 +101,29 @@ export class Raw extends Sql { } export class Ident extends Sql { - constructor(readonly name: string) { super(); } - bind(): BoundSql { return this; } + // 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) { + 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 { @@ -140,28 +182,89 @@ 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`${ctx.database.scopedIdent(this.name)}(${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, + 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). + 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})`; } + 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]; } } @@ -183,12 +286,26 @@ 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. type Frame = { iter: Iterator; prevScope?: Scope }; -export const compile = (root: Sql, style: "pg" | "sqlite" = "pg"): CompiledSql => { +export const compile = (root: Sql, ctx: CompileContext): CompiledSql => { const values: unknown[] = []; const out: string[] = []; let scope = new Scope(); @@ -202,14 +319,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(paramForDialect(ctx.database.dialect, values.length)); } else if (atom instanceof Alias) { const resolved = scope.resolve(atom); if (!resolved) { @@ -272,7 +389,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); -_sql.ident = (name: string): Ident => new Ident(name); +// 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); 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/builder/update.ts b/src/builder/update.ts index cfc0f0d..f65e67d 100644 --- a/src/builder/update.ts +++ b/src/builder/update.ts @@ -1,14 +1,14 @@ -import { Sql, sql, Alias, compile } from "./sql"; +import { Sql, sql, Alias, compile, type CompileContext } from "./sql"; import type { BoundSql } from "./sql"; -import { Bool } from "../types"; +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"; 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 { Connection } from "../database"; +import { SqlValue, getColumn } from "../types/any"; import { fn, expose } from "../exoeval/tool"; import z from "zod"; @@ -17,6 +17,10 @@ type Namespace = { [K in Name]: T }; type UpdateOpts = { instance: T; 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). + matchAll?: boolean; set?: (ns: Namespace) => SetRow; returning?: (ns: Namespace) => R; }; @@ -27,7 +31,9 @@ type FinalizedUpdateOpts; + // undefined + matchAll=true → no WHERE emitted (delete/update all). + where: Bool | undefined; + matchAll: boolean; setRow: SetRow; returning?: R; }; @@ -42,9 +48,15 @@ export class FinalizedUpdate( setRow: SetRow, ): Sql[] => Object.entries(setRow as { [key: string]: unknown }).map(([k, v]) => { - if (v instanceof Any) { - return sql`${sql.ident(k)} = ${v.toSql()}`; + const ident = instance.constructor.ident(k); + if (v instanceof SqlValue) { + 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 { @@ -77,14 +90,21 @@ export class UpdateBuilder z.instanceof(Bool)))])) + get database() { + return this.#opts.instance.constructor.database; + } + + // Multiple where() calls are combined with AND. .where(true) matches all rows + // — sets a flag rather than constructing a dialect-specific `TRUE` predicate, + // so the bind() step emits no WHERE clause on either PG or SQLite. + @expose(z.union([z.literal(true), fn.returns(z.custom>(isBool))])) where(fn: ((ns: Namespace) => Bool) | true): UpdateBuilder { - const wrapped: (ns: Namespace) => Bool = - fn === true ? () => Bool.from(sql`TRUE`) as Bool : 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), }); } @@ -115,7 +135,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) { @@ -126,40 +146,42 @@ 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 } : {}), }); } - bind(): BoundSql { + bind(ctx: CompileContext): BoundSql { const t = this.#opts.instance.constructor.transformer?.update; - return (t ? t(this) : this.finalize()).bind(); + return (t ? t(this) : this.finalize()).bind(ctx); } override children() { return [this.finalize()]; } - @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); } - @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() debug(): this { - const compiled = compile(this, "pg"); + const database = this.#opts.instance.constructor.database; + const compiled = compile(this, { database }); console.log("Debugging query:", { sql: compiled.text, parameters: compiled.values }); return this; } 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/database.test.ts b/src/database.test.ts index 9476883..b39fde0 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 { Int8, Text } from "./types/postgres"; 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 4362954..fea6327 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"; @@ -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/dialect"; export type TransactionIsolation = "read committed" | "repeatable read" | "serializable"; export type TransactionOptions = { @@ -35,29 +36,123 @@ 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 { +export class Database implements DatabaseRef { + 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. 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 + // 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({ + database: this, + 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, []>({ + database: this, + 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. - constructor(private driver: Driver, boundExecute?: ExecuteFn, isolation?: TransactionIsolation) { + constructor( + readonly database: Database, + private driver: Driver, + boundExecute?: ExecuteFn, + isolation?: TransactionIsolation, + ) { if (boundExecute) { this.#boundExecute = boundExecute; } if (isolation) { this.#isolation = isolation; } } + get dialect() { return this.driver.dialect; } + + // 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 { - return (this.#boundExecute ?? this.driver.execute.bind(this.driver))(query); + const { text, values } = compile(query, { database: this.database }); + return (this.#boundExecute ?? this.driver.execute.bind(this.driver))(text, values); } // Overload resolution matches top-to-bottom and stops on the first @@ -91,15 +186,8 @@ export class Database { 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; @@ -122,20 +210,16 @@ export class Database { 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; @@ -144,14 +228,9 @@ export class Database { } 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.`, @@ -167,18 +246,19 @@ 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 Connection(this.database, this.driver, execute, opts?.isolation); + const runSql = async (s: Sql) => { + const { text, values } = compile(s, { database: this.database }); + 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); } @@ -187,69 +267,29 @@ export class Database { }); } - // 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); - // --- 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()) { - await this.driver.execute(stmt); + for (const stmt of eventsTableSqlStatements(this.database)) { + 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.driver, opts); + this.#bus = new Bus(this, opts); await this.#bus.start(); } @@ -259,11 +299,6 @@ export class Database { 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< @@ -275,25 +310,18 @@ export class Database { 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; } @@ -301,8 +329,6 @@ export class Database { } } } 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/driver.ts b/src/driver.ts index 02aafcc..683f496 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -1,14 +1,20 @@ -import type { Sql } from "./builder/sql"; -import { compile } from "./builder/sql"; +import type { DialectName } from "./types/dialect"; 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 }[] }; -export type ExecuteFn = (query: Sql) => Promise; +// 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 +// the result rows. +export type ExecuteFn = (text: string, values: readonly unknown[]) => Promise; export interface Driver { + readonly dialect: DialectName; execute: ExecuteFn; runInSingleConnection(cb: (execute: ExecuteFn) => Promise): Promise; close(): Promise; @@ -21,6 +27,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: DialectName = "postgres"; + static async create( connectionString: string, poolOptions: pg.PoolConfig = {}, @@ -37,18 +45,14 @@ export class PgDriver implements Driver { private constructor(private pool: pg.Pool) {} - async execute(query: Sql): Promise { - const c = compile(query, "pg"); - 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, "pg"); - return client.query(c.text, c.values); - }); + return await cb((text, values) => client.query(text, values as unknown[])); } finally { client.release(); } @@ -73,6 +77,8 @@ type PgliteDb = { }; export class PgliteDriver implements Driver { + readonly dialect: DialectName = "postgres"; + static async create(): Promise { // eslint-disable-next-line no-restricted-syntax -- optional peer, see class comment const { PGlite } = await import("@electric-sql/pglite"); @@ -90,9 +96,8 @@ export class PgliteDriver implements Driver { private parsers: { [key: number]: (v: string) => string }, ) {} - async execute(query: Sql): Promise { - const c = compile(query, "pg"); - 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 { @@ -103,3 +108,100 @@ 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(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. + return this.runOne(stripMatchedOuterParens(text), 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((text, values) => Promise.resolve(this.execute(text, values))); + } + + async close(): Promise { + this.db.close(); + return Promise.resolve(); + } +} + +// 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. + 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/hydrate.test.ts b/src/hydrate.test.ts index 12d84d7..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 { Database, QueryBuilder } from "typegres"; +import { typegres, sql, Int8, Text, Bool, expose } from "typegres"; +import type { Connection, Database, 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; +// 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,14 +41,13 @@ class Todo extends Table("todos") { } beforeAll(async () => { - db = await typegres({ type: "pglite" }); - await db.execute(sql` + 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 +55,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 +70,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 +81,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 +101,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 +117,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 +128,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..f6c3200 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"; +export * from "./types/postgres"; diff --git a/src/live/bus.test.ts b/src/live/bus.test.ts index 67a1774..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 { driver, 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 driver.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 driver.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(driver); + 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(driver); + 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(driver); + 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(driver, { 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(driver); + 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 337e400..bec335e 100644 --- a/src/live/bus.ts +++ b/src/live/bus.ts @@ -1,5 +1,5 @@ -import type { Driver } from "../driver"; -import { sql } from "../builder/sql"; +import type { Connection } from "../database"; +import { sql, type DatabaseRef } from "../builder/sql"; import { type Cursor, parseSnapshot, visible } from "./snapshot"; import type { PredicateSet } from "./extractor"; @@ -106,13 +106,15 @@ export class Bus { #oncePolled: (() => void)[] = []; readonly #intervalMs: number; readonly #windowSize: number; + readonly #database: DatabaseRef; constructor( - private driver: Driver, + private conn: Connection, opts: BusOptions = {}, ) { 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 @@ -284,7 +286,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.conn.execute(sql`SELECT pg_current_snapshot()::text AS s`); return parseSnapshot((r.rows as { s: string }[])[0]!.s); } @@ -299,9 +301,9 @@ 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.conn.execute(sql` SELECT xid::text AS xid, "table", before::text AS before, after::text AS after - FROM ${sql.ident(EVENTS_TABLE)} + 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/db-live.test.ts b/src/live/db-live.test.ts index d16b765..28714b8 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 { Int8, Text } from "../types/postgres"; import { sql } from "../builder/sql"; -import { Table } from "../table"; -import { db, driver, setupDb } from "../test-helpers"; +import { conn, db, setupDb } from "../test-helpers"; import { TypegresLiveEvents } from "./events"; import { setupLiveEvents } from "./test-helpers"; setupDb(); @@ -14,19 +13,19 @@ setupLiveEvents(); 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 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 driver.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 )`); - 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 }); @@ -41,9 +40,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 +50,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 +58,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 +72,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 +87,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 +100,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 +114,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,21 +124,21 @@ 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 conn.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 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 }); } - 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 +150,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 +163,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 +173,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-ddl.ts b/src/live/events-ddl.ts index 0bda699..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, type Sql } from "../builder/sql"; +import { sql, 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 ${sql.ident(EVENTS_TABLE_NAME)} ( + 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 = (): 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 ${database.scopedIdent(`${EVENTS_TABLE_NAME}_xid_idx`)} ON ${database.scopedIdent(EVENTS_TABLE_NAME)} (xid)`, ]; }; diff --git a/src/live/events.test.ts b/src/live/events.test.ts index e91fa0f..8089f0b 100644 --- a/src/live/events.test.ts +++ b/src/live/events.test.ts @@ -1,22 +1,21 @@ import { test, expect, beforeAll, afterEach } from "vitest"; -import { Int8, Text } from "../types"; +import { Int8, Text } from "../types/postgres"; import { sql } from "../builder/sql"; -import { Table } from "../table"; -import { db, 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(); } 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 +25,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 +40,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 +54,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 +74,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 +102,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/events.ts b/src/live/events.ts index cb3db70..c7c2701 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 { Any, Jsonb } from "../types/postgres"; +import type { QueryTransformer } from "../table"; +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"; @@ -10,25 +10,19 @@ 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}`. - static createTableSql(): Sql { - return sql.join(eventsTableSqlStatements(), sql`; `); +// 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(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 { @@ -54,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. @@ -71,7 +70,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 @@ -85,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 ${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)}`; +const eventsInsertCte = (tableName: string, before: Sql, after: Sql, database: DatabaseRef): Sql => + 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 @@ -101,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 @@ -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 events = eventsInsertCte(tableName, beforeRef, afterRef); + 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, database); 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: @@ -138,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 @@ -147,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`${sql.ident(T_BEFORE)}.${sql.ident(c)}::text`), + buildLiveJsonb(tableInstance, (c) => sql`${new Ident(T_BEFORE)}.${database.scopedIdent(c)}::text`), ), [T_LIVE_AFTER]: Jsonb.from(buildLiveJsonb(tableInstance)), }; @@ -159,15 +160,20 @@ 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`; - 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 events = eventsInsertCte(tableName, sql.ident(T_LIVE_BEFORE), sql.ident(T_LIVE_AFTER)); + // `.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 ${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); 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.test.ts b/src/live/extractor.test.ts index 1146d07..e3fbbc5 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 { Int8, Text } from "../types/postgres"; +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/live/extractor.ts b/src/live/extractor.ts index 2626ebf..888ba77 100644 --- a/src/live/extractor.ts +++ b/src/live/extractor.ts @@ -1,6 +1,6 @@ -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 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` `, @@ -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/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/live/test-helpers.ts b/src/live/test-helpers.ts index 3a76e6a..efd5481 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 { 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 driver.execute(TypegresLiveEvents.createTableSql()); + await conn.execute(TypegresLiveEvents.createTableSql(conn.database)); }); afterEach(async () => { - await driver.execute(sql`TRUNCATE _typegres_live_events`); + await conn.execute(sql`TRUNCATE _typegres_live_events`); }); }; diff --git a/src/provenance.test.ts b/src/provenance.test.ts new file mode 100644 index 0000000..9123230 --- /dev/null +++ b/src/provenance.test.ts @@ -0,0 +1,176 @@ +// 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, Ident, Func, Op, UnaryOp, Cast, Raw, Param } from "./builder/sql"; +import { Int4, Text } from "./types/postgres"; +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("`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(); + }); + + 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/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..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 type { Database } 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 @@ -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 @@ -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 }); @@ -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, @@ -196,15 +196,15 @@ 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: 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/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/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/table.ts b/src/table.ts index a4d20f7..6aac788 100644 --- a/src/table.ts +++ b/src/table.ts @@ -1,11 +1,10 @@ -import { sql } from "./builder/sql"; -import type { BoundSql, 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"; import { UpdateBuilder } from "./builder/update"; import { InsertBuilder } from "./builder/insert"; -import { isColumn } from "./types/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; @@ -40,6 +39,11 @@ export type TableOptions = { export abstract class TableBase { static readonly tableName: string; static readonly tsAlias: string; + // 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; @@ -63,7 +67,13 @@ export abstract class TableBase { } static bind(this: typeof TableBase): BoundSql { - return sql.ident(this.tableName); + 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 this.database.scopedIdent(name); } // Entry point for query builders: e.g., `Users.from()` @@ -73,6 +83,7 @@ export abstract class TableBase { InstanceType, [] >({ + database: this.database, tsAlias: this.tsAlias, tables: [{ type: "from", source: this as unknown as Fromable }], }); @@ -143,7 +154,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( @@ -160,7 +171,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 +186,7 @@ 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; + static override readonly database = database; }, }; type Obj = typeof obj; 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/test-helpers.ts b/src/test-helpers.ts index a7484ca..883b580 100644 --- a/src/test-helpers.ts +++ b/src/test-helpers.ts @@ -3,11 +3,13 @@ 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 type { TransactionIsolation } from "./database"; +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; 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 +17,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 ${db.scopedIdent(schema)} CASCADE`); + await conn.execute(sql`CREATE SCHEMA ${db.scopedIdent(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 ${db.scopedIdent(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) => { @@ -61,12 +65,36 @@ 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) + const resolved = database ?? findDatabase(actual) ?? db; + 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)); expect(a.values).toEqual(e.values); }; diff --git a/src/types/overrides/any.ts b/src/types/any.ts similarity index 54% rename from src/types/overrides/any.ts rename to src/types/any.ts index 8a9a2f1..294c122 100644 --- a/src/types/overrides/any.ts +++ b/src/types/any.ts @@ -1,105 +1,104 @@ -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 * as types from "../index"; +// 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 type { DialectName } from "./dialect"; +import { meta } from "./meta"; +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 Any extends Generated { +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 Any; + __class: typeof SqlValue; __raw: Sql; __nullability: N; - __aggregate: Any; + __aggregate: SqlValue; }; - // __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"; - deserialize(raw: string): unknown { - return getTypeDef((this.constructor as typeof Any).__typnameText).deserialize(raw); - } + // 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; + + // 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 { return this[meta].__raw; } - 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>; - } - - // CAST this expression to another pg type, preserving nullability. + // 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( + 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(sql`CAST(${this.toSql()} AS ${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 - // compiles to `(this IN (v1, v2, ...))`; pg's planner rewrites the - // single-value case to `=` itself during planning. SQL forbids - // `IN ()`, so the type signature requires at least one arg. - // - // Return nullability propagates from the LHS and any of the args: - // SQL three-valued logic on `IN` returns NULL when there's no match - // and either `this` or any list element is NULL. - // - // eslint-disable-next-line no-restricted-syntax -- generic vararg signature with `this`-bound type narrowing isn't expressible in zod - @expose.unchecked() - in< - T extends Any, - Vs extends [ - (T extends { [meta]: { __any: infer A } } ? A : Any) | TsTypeOf, - ...((T extends { [meta]: { __any: infer A } } ? A : Any) | TsTypeOf)[], - ], - >( - this: T, - ...vals: Vs - ): types.Bool | NullOf>> { - const wrapped = vals.map((v) => { - if (v instanceof Any) {return v;} - if (!isPlainData(v)) { - const name = (Object.getPrototypeOf(v) as { constructor?: { name?: string } } | null)?.constructor?.name ?? "anonymous"; - throw new TypeError( - `Any.in: cannot accept ${name} instance as a list value. ` + - `Pass a typegres expression or a primitive matching ${(this[meta].__class as typeof Any).__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 unknown as types.Bool | NullOf>>; + return cls.from(new Cast(this.toSql(), cls.__typname, cls.dialect.name)) 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 : Any)>( + coalesce, R extends (T extends { [meta]: { __any: infer A } } ? A : SqlValue)>( this: T, rhs: R, ): 0 extends NullOf @@ -110,8 +109,8 @@ export class Any extends Generated { // 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(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; @@ -119,7 +118,7 @@ export class Any extends Generated { __raw = v; } else { // Reject class instances — they almost always indicate a bug. - // The historical case: passing an Any expression to .from() + // 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, @@ -132,7 +131,7 @@ export class Any extends Generated { `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, { @@ -144,9 +143,9 @@ export class Any extends Generated { // Internal: validate and wrap a TS value into a typed instance. // Used by match() for runtime overload dispatch. - static serialize(v: unknown): Any { + static serialize(v: unknown): SqlValue { if (v instanceof this) { return v; } - const expected = getTypeDef(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)}).`, @@ -154,7 +153,7 @@ export class Any extends Generated { } // Column declaration for Table definitions. The field name doubles as - // the pg column name: + // the column name: // // class Users extends Table("users") { // id = Int8.column({ nonNull: true }); @@ -168,7 +167,7 @@ export class Any extends Generated { // __required is a type-level brand used by InsertRow to distinguish // required vs optional columns. static column< - T extends typeof Any, + T extends typeof SqlValue, Opts extends ColumnOpts = {}, >( this: T, @@ -184,11 +183,11 @@ export class Any extends Generated { } } -// 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; +// 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 @@ -196,10 +195,10 @@ export const isColumn = (v: unknown): v is Any => export const getColumn = ( instance: { constructor: { tableName: string } }, name: string, -): Any => { +): SqlValue => { const col = (instance as { [k: string]: unknown })[name]; const tableName = instance.constructor.tableName; - if (!(col instanceof Any)) { + if (!(col instanceof SqlValue)) { throw new Error( `No column '${name}' on table '${tableName}'. ` + `Declare it as a field: \`${name} = Type.column(...)\`.`, diff --git a/src/types/bool-mixin.ts b/src/types/bool-mixin.ts new file mode 100644 index 0000000..1d2773a --- /dev/null +++ b/src/types/bool-mixin.ts @@ -0,0 +1,15 @@ +// Dialect-agnostic helpers for Bool's and/or/not. Concrete Bool classes +// 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"; + +// `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 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/bool.ts b/src/types/bool.ts new file mode 100644 index 0000000..ccdfa72 --- /dev/null +++ b/src/types/bool.ts @@ -0,0 +1,37 @@ +// 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"; + +// 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. +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/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/deserialize.ts b/src/types/deserialize.ts deleted file mode 100644 index 6d2abe9..0000000 --- a/src/types/deserialize.ts +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -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); - -// 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 } -}; - -export const defaultTypeDef: TypeDef = { - tsType: "string", - deserialize: identity, -}; - -export const getTypeDef = (typname: string): TypeDef => - typeRegistry[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/match.test.ts b/src/types/match.test.ts index 4c3184a..8215c78 100644 --- a/src/types/match.test.ts +++ b/src/types/match.test.ts @@ -1,25 +1,27 @@ import { test, expect } from "vitest"; -import { Int4, Int8, Text, Bool } from "./index"; +import { Int4, Int8, Text, Bool } from "./postgres"; import { compile } from "../builder/sql"; +import { Database } from "../database"; + +const pgCtx = { database: new Database({ dialect: "postgres" }) }; // --- 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", () => { 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", () => { @@ -43,11 +45,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 +63,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/meta.ts b/src/types/meta.ts new file mode 100644 index 0000000..bdb57ac --- /dev/null +++ b/src/types/meta.ts @@ -0,0 +1 @@ +export const meta = Symbol("typegres"); diff --git a/src/types/overrides/bool.ts b/src/types/overrides/bool.ts deleted file mode 100644 index 608d4d0..0000000 --- a/src/types/overrides/bool.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Bool as Generated } from "../generated/bool"; -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 - // is the source of truth). Declare it here so `TsTypeOf>` narrows to - // `boolean` instead of `unknown`. - 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; - } - - 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; - } - - not(): Bool { - return Bool.from(new UnaryOp(sql`NOT`, this.toSql())) as any; - } -} diff --git a/src/types/generate.ts b/src/types/postgres/generate.ts similarity index 89% rename from src/types/generate.ts rename to src/types/postgres/generate.ts index 52168fc..fa1f410 100644 --- a/src/types/generate.ts +++ b/src/types/postgres/generate.ts @@ -3,8 +3,7 @@ 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 { introspect, groupByFirstArg, @@ -22,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(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([ @@ -200,23 +215,30 @@ 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 // 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}";`); @@ -242,7 +264,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 += " {"; @@ -254,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 @@ -272,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 @@ -300,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}`; }; @@ -372,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("|"); @@ -429,16 +453,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 +483,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/generated/aclitem.ts b/src/types/postgres/generated/aclitem.ts similarity index 73% rename from src/types/generated/aclitem.ts rename to src/types/postgres/generated/aclitem.ts index bb9b0eb..7691095 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"; @@ -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/generated/any.ts b/src/types/postgres/generated/any.ts similarity index 59% rename from src/types/generated/any.ts rename to src/types/postgres/generated/any.ts index d5b0233..f5847ba 100644 --- a/src/types/generated/any.ts +++ b/src/types/postgres/generated/any.ts @@ -1,37 +1,38 @@ // 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 { 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.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/generated/anyarray.ts b/src/types/postgres/generated/anyarray.ts similarity index 70% rename from src/types/generated/anyarray.ts rename to src/types/postgres/generated/anyarray.ts index 04bff2f..c6b5fbc 100644 --- a/src/types/generated/anyarray.ts +++ b/src/types/postgres/generated/anyarray.ts @@ -1,74 +1,74 @@ // 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"; 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/generated/anycompatible.ts b/src/types/postgres/generated/anycompatible.ts similarity index 71% rename from src/types/generated/anycompatible.ts rename to src/types/postgres/generated/anycompatible.ts index e23cbb7..8c97e92 100644 --- a/src/types/generated/anycompatible.ts +++ b/src/types/postgres/generated/anycompatible.ts @@ -1,10 +1,10 @@ // 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"; 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/generated/anycompatiblearray.ts b/src/types/postgres/generated/anycompatiblearray.ts similarity index 76% rename from src/types/generated/anycompatiblearray.ts rename to src/types/postgres/generated/anycompatiblearray.ts index 9e4cff8..7c25464 100644 --- a/src/types/generated/anycompatiblearray.ts +++ b/src/types/postgres/generated/anycompatiblearray.ts @@ -1,24 +1,24 @@ // 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"; 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/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 62% rename from src/types/generated/anyelement.ts rename to src/types/postgres/generated/anyelement.ts index b866969..1a4bba4 100644 --- a/src/types/generated/anyelement.ts +++ b/src/types/postgres/generated/anyelement.ts @@ -1,26 +1,26 @@ // 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"; 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/generated/anyenum.ts b/src/types/postgres/generated/anyenum.ts similarity index 68% rename from src/types/generated/anyenum.ts rename to src/types/postgres/generated/anyenum.ts index 6842a9d..f67da9b 100644 --- a/src/types/generated/anyenum.ts +++ b/src/types/postgres/generated/anyenum.ts @@ -1,40 +1,40 @@ // 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"; 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/generated/anymultirange.ts b/src/types/postgres/generated/anymultirange.ts similarity index 73% rename from src/types/generated/anymultirange.ts rename to src/types/postgres/generated/anymultirange.ts index bd870ce..eaca5f4 100644 --- a/src/types/generated/anymultirange.ts +++ b/src/types/postgres/generated/anymultirange.ts @@ -1,135 +1,135 @@ // 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"; 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/generated/anynonarray.ts b/src/types/postgres/generated/anynonarray.ts similarity index 70% rename from src/types/generated/anynonarray.ts rename to src/types/postgres/generated/anynonarray.ts index d3d22b3..c1cda0f 100644 --- a/src/types/generated/anynonarray.ts +++ b/src/types/postgres/generated/anynonarray.ts @@ -1,10 +1,10 @@ // 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"; 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/generated/anyrange.ts b/src/types/postgres/generated/anyrange.ts similarity index 76% rename from src/types/generated/anyrange.ts rename to src/types/postgres/generated/anyrange.ts index f4bc8de..0135444 100644 --- a/src/types/generated/anyrange.ts +++ b/src/types/postgres/generated/anyrange.ts @@ -1,129 +1,129 @@ // 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"; 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/generated/bit.ts b/src/types/postgres/generated/bit.ts similarity index 72% rename from src/types/generated/bit.ts rename to src/types/postgres/generated/bit.ts index 27274ba..f315c46 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"; @@ -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/generated/bool.ts b/src/types/postgres/generated/bool.ts similarity index 62% rename from src/types/generated/bool.ts rename to src/types/postgres/generated/bool.ts index 2c2f508..091c95c 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"; @@ -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/generated/bpchar.ts b/src/types/postgres/generated/bpchar.ts similarity index 63% rename from src/types/generated/bpchar.ts rename to src/types/postgres/generated/bpchar.ts index e2ae856..2362758 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"; @@ -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/generated/bytea.ts b/src/types/postgres/generated/bytea.ts similarity index 68% rename from src/types/generated/bytea.ts rename to src/types/postgres/generated/bytea.ts index 2ad2136..ae8b580 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"; @@ -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/generated/char.ts b/src/types/postgres/generated/char.ts similarity index 67% rename from src/types/generated/char.ts rename to src/types/postgres/generated/char.ts index a4d3389..4a9b267 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"; @@ -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/generated/cid.ts b/src/types/postgres/generated/cid.ts similarity index 70% rename from src/types/generated/cid.ts rename to src/types/postgres/generated/cid.ts index ae564bf..d5cb86d 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"; @@ -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/generated/cidr.ts b/src/types/postgres/generated/cidr.ts similarity index 69% rename from src/types/generated/cidr.ts rename to src/types/postgres/generated/cidr.ts index ea33236..96d5198 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"; @@ -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/generated/circle.ts b/src/types/postgres/generated/circle.ts similarity index 63% rename from src/types/generated/circle.ts rename to src/types/postgres/generated/circle.ts index e367659..02a9178 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"; @@ -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/generated/date.ts b/src/types/postgres/generated/date.ts similarity index 79% rename from src/types/generated/date.ts rename to src/types/postgres/generated/date.ts index fa42021..0774779 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"; @@ -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/generated/float4.ts b/src/types/postgres/generated/float4.ts similarity index 75% rename from src/types/generated/float4.ts rename to src/types/postgres/generated/float4.ts index 1fd8094..07707dd 100644 --- a/src/types/generated/float4.ts +++ b/src/types/postgres/generated/float4.ts @@ -1,142 +1,141 @@ // 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"; 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.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/generated/float8.ts b/src/types/postgres/generated/float8.ts similarity index 70% rename from src/types/generated/float8.ts rename to src/types/postgres/generated/float8.ts index 2c07e1e..17bb939 100644 --- a/src/types/generated/float8.ts +++ b/src/types/postgres/generated/float8.ts @@ -1,274 +1,273 @@ // 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"; 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.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/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 66% rename from src/types/generated/inet.ts rename to src/types/postgres/generated/inet.ts index 93c29ca..cc116c2 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"; @@ -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/generated/int2.ts b/src/types/postgres/generated/int2.ts similarity index 72% rename from src/types/generated/int2.ts rename to src/types/postgres/generated/int2.ts index 562a82f..3cf79d9 100644 --- a/src/types/generated/int2.ts +++ b/src/types/postgres/generated/int2.ts @@ -1,194 +1,193 @@ // 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"; 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.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/generated/int4.ts b/src/types/postgres/generated/int4.ts similarity index 72% rename from src/types/generated/int4.ts rename to src/types/postgres/generated/int4.ts index 6c9b1e5..91d97bd 100644 --- a/src/types/generated/int4.ts +++ b/src/types/postgres/generated/int4.ts @@ -1,234 +1,233 @@ // 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"; 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.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/generated/int8.ts b/src/types/postgres/generated/int8.ts similarity index 73% rename from src/types/generated/int8.ts rename to src/types/postgres/generated/int8.ts index fdccbeb..779534e 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"; @@ -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/generated/interval.ts b/src/types/postgres/generated/interval.ts similarity index 69% rename from src/types/generated/interval.ts rename to src/types/postgres/generated/interval.ts index 171756d..db70112 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"; @@ -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/generated/json.ts b/src/types/postgres/generated/json.ts similarity index 55% rename from src/types/generated/json.ts rename to src/types/postgres/generated/json.ts index 845bedf..5a003b5 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"; @@ -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/generated/jsonb.ts b/src/types/postgres/generated/jsonb.ts similarity index 62% rename from src/types/generated/jsonb.ts rename to src/types/postgres/generated/jsonb.ts index c134c68..549a04d 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"; @@ -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/generated/jsonpath.ts b/src/types/postgres/generated/jsonpath.ts similarity index 76% rename from src/types/generated/jsonpath.ts rename to src/types/postgres/generated/jsonpath.ts index df39a7b..79c65c3 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"; @@ -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/generated/macaddr.ts b/src/types/postgres/generated/macaddr.ts similarity index 63% rename from src/types/generated/macaddr.ts rename to src/types/postgres/generated/macaddr.ts index fcbda16..6966920 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"; @@ -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/generated/macaddr8.ts b/src/types/postgres/generated/macaddr8.ts similarity index 63% rename from src/types/generated/macaddr8.ts rename to src/types/postgres/generated/macaddr8.ts index fee2e17..09a6545 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"; @@ -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/generated/money.ts b/src/types/postgres/generated/money.ts similarity index 71% rename from src/types/generated/money.ts rename to src/types/postgres/generated/money.ts index e7ec15f..93294f2 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"; @@ -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/generated/numeric.ts b/src/types/postgres/generated/numeric.ts similarity index 62% rename from src/types/generated/numeric.ts rename to src/types/postgres/generated/numeric.ts index e54d619..b505ab9 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"; @@ -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/generated/oid.ts b/src/types/postgres/generated/oid.ts similarity index 66% rename from src/types/generated/oid.ts rename to src/types/postgres/generated/oid.ts index b1f7b94..8d46a58 100644 --- a/src/types/generated/oid.ts +++ b/src/types/postgres/generated/oid.ts @@ -1,66 +1,65 @@ // 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"; 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.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/generated/path.ts b/src/types/postgres/generated/path.ts similarity index 63% rename from src/types/generated/path.ts rename to src/types/postgres/generated/path.ts index fee8ebe..0a70560 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"; @@ -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/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 64% rename from src/types/generated/pg_lsn.ts rename to src/types/postgres/generated/pg_lsn.ts index ced07c9..51a6aea 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"; @@ -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/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 55% rename from src/types/generated/pg_snapshot.ts rename to src/types/postgres/generated/pg_snapshot.ts index 8128a3b..6d97929 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"; @@ -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/generated/polygon.ts b/src/types/postgres/generated/polygon.ts similarity index 64% rename from src/types/generated/polygon.ts rename to src/types/postgres/generated/polygon.ts index 8a97947..7b59fd3 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"; @@ -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/generated/record.ts b/src/types/postgres/generated/record.ts similarity index 64% rename from src/types/generated/record.ts rename to src/types/postgres/generated/record.ts index b011d96..9d902aa 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"; @@ -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/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 69% rename from src/types/generated/regclass.ts rename to src/types/postgres/generated/regclass.ts index bf9aac2..bf14c6d 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"; @@ -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/generated/regcollation.ts b/src/types/postgres/generated/regcollation.ts similarity index 76% rename from src/types/generated/regcollation.ts rename to src/types/postgres/generated/regcollation.ts index 0e95132..e9ddb9e 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"; @@ -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/generated/regconfig.ts b/src/types/postgres/generated/regconfig.ts similarity index 81% rename from src/types/generated/regconfig.ts rename to src/types/postgres/generated/regconfig.ts index a668e7c..8151d18 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"; @@ -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/generated/regdictionary.ts b/src/types/postgres/generated/regdictionary.ts similarity index 76% rename from src/types/generated/regdictionary.ts rename to src/types/postgres/generated/regdictionary.ts index e705604..2cec60c 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"; @@ -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/generated/regnamespace.ts b/src/types/postgres/generated/regnamespace.ts similarity index 76% rename from src/types/generated/regnamespace.ts rename to src/types/postgres/generated/regnamespace.ts index f53141b..335a575 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"; @@ -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/generated/regoper.ts b/src/types/postgres/generated/regoper.ts similarity index 76% rename from src/types/generated/regoper.ts rename to src/types/postgres/generated/regoper.ts index ab4d776..38db9f1 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"; @@ -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/generated/regoperator.ts b/src/types/postgres/generated/regoperator.ts similarity index 76% rename from src/types/generated/regoperator.ts rename to src/types/postgres/generated/regoperator.ts index 9479684..b03ec32 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"; @@ -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/generated/regproc.ts b/src/types/postgres/generated/regproc.ts similarity index 76% rename from src/types/generated/regproc.ts rename to src/types/postgres/generated/regproc.ts index 32405f3..7b5d275 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"; @@ -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/generated/regprocedure.ts b/src/types/postgres/generated/regprocedure.ts similarity index 76% rename from src/types/generated/regprocedure.ts rename to src/types/postgres/generated/regprocedure.ts index b33e279..c3ba15a 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"; @@ -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/generated/regrole.ts b/src/types/postgres/generated/regrole.ts similarity index 76% rename from src/types/generated/regrole.ts rename to src/types/postgres/generated/regrole.ts index 58b2a09..00a6a56 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"; @@ -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/generated/regtype.ts b/src/types/postgres/generated/regtype.ts similarity index 76% rename from src/types/generated/regtype.ts rename to src/types/postgres/generated/regtype.ts index beabd3b..f82c0a8 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"; @@ -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/generated/text.ts b/src/types/postgres/generated/text.ts similarity index 76% rename from src/types/generated/text.ts rename to src/types/postgres/generated/text.ts index 443f510..654f890 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"; @@ -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/generated/tid.ts b/src/types/postgres/generated/tid.ts similarity index 70% rename from src/types/generated/tid.ts rename to src/types/postgres/generated/tid.ts index c997fdf..f1cdb97 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"; @@ -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/generated/time.ts b/src/types/postgres/generated/time.ts similarity index 72% rename from src/types/generated/time.ts rename to src/types/postgres/generated/time.ts index 8660319..a94bddf 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"; @@ -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/generated/timestamp.ts b/src/types/postgres/generated/timestamp.ts similarity index 76% rename from src/types/generated/timestamp.ts rename to src/types/postgres/generated/timestamp.ts index ccf1f85..d9e283a 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"; @@ -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/generated/timestamptz.ts b/src/types/postgres/generated/timestamptz.ts similarity index 76% rename from src/types/generated/timestamptz.ts rename to src/types/postgres/generated/timestamptz.ts index 839a4cc..c5bc35c 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"; @@ -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/generated/timetz.ts b/src/types/postgres/generated/timetz.ts similarity index 65% rename from src/types/generated/timetz.ts rename to src/types/postgres/generated/timetz.ts index 351ac0e..2e620af 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"; @@ -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/generated/tsquery.ts b/src/types/postgres/generated/tsquery.ts similarity index 65% rename from src/types/generated/tsquery.ts rename to src/types/postgres/generated/tsquery.ts index c26b237..d1a227e 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"; @@ -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/generated/tsvector.ts b/src/types/postgres/generated/tsvector.ts similarity index 67% rename from src/types/generated/tsvector.ts rename to src/types/postgres/generated/tsvector.ts index 6ec9cfa..e80fc11 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"; @@ -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/generated/txid_snapshot.ts b/src/types/postgres/generated/txid_snapshot.ts similarity index 55% rename from src/types/generated/txid_snapshot.ts rename to src/types/postgres/generated/txid_snapshot.ts index 02953d6..0338858 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"; @@ -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/generated/unknown.ts b/src/types/postgres/generated/unknown.ts similarity index 76% rename from src/types/generated/unknown.ts rename to src/types/postgres/generated/unknown.ts index 506fd08..056cdf8 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"; @@ -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/generated/uuid.ts b/src/types/postgres/generated/uuid.ts similarity index 67% rename from src/types/generated/uuid.ts rename to src/types/postgres/generated/uuid.ts index f7a1807..a34dfb0 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"; @@ -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/generated/varbit.ts b/src/types/postgres/generated/varbit.ts similarity index 65% rename from src/types/generated/varbit.ts rename to src/types/postgres/generated/varbit.ts index c1bd7ca..567ea6b 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"; @@ -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/generated/varchar.ts b/src/types/postgres/generated/varchar.ts similarity index 82% rename from src/types/generated/varchar.ts rename to src/types/postgres/generated/varchar.ts index 5e78452..9605f7e 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"; @@ -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/generated/xid.ts b/src/types/postgres/generated/xid.ts similarity index 82% rename from src/types/generated/xid.ts rename to src/types/postgres/generated/xid.ts index e88e6f3..472625c 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"; @@ -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/generated/xid8.ts b/src/types/postgres/generated/xid8.ts similarity index 67% rename from src/types/generated/xid8.ts rename to src/types/postgres/generated/xid8.ts index 4e64136..12ca133 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"; @@ -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/generated/xml.ts b/src/types/postgres/generated/xml.ts similarity index 70% rename from src/types/generated/xml.ts rename to src/types/postgres/generated/xml.ts index 98142e2..dacc091 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"; @@ -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/index.test.ts b/src/types/postgres/index.test.ts similarity index 92% rename from src/types/index.test.ts rename to src/types/postgres/index.test.ts index 4fd9fbc..e8bc34f 100644 --- a/src/types/index.test.ts +++ b/src/types/postgres/index.test.ts @@ -1,18 +1,23 @@ 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 { Connection } from "../../database"; +import { Database } from "../../database"; -let exec: Driver; +const pgCtx = { database: new Database({ dialect: "postgres" }) }; + +let exec: Connection; beforeAll(async () => { - exec = await PgDriver.create(requireDatabaseUrl(), { max: 1 }); + const driver = await PgDriver.create(requireDatabaseUrl(), { max: 1 }); + const localDb = new Database({ dialect: "postgres" }); + exec = localDb.attach(driver); }); afterAll(async () => { @@ -110,28 +115,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 +145,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]); }); @@ -170,37 +175,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"); }); @@ -208,7 +213,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"); }); @@ -497,7 +502,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 +521,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 +535,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 +551,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)))", @@ -573,28 +578,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"); }); diff --git a/src/types/index.ts b/src/types/postgres/index.ts similarity index 94% rename from src/types/index.ts rename to src/types/postgres/index.ts index bad725d..656e97a 100644 --- a/src/types/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/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/postgres/overrides/any.ts b/src/types/postgres/overrides/any.ts new file mode 100644 index 0000000..678d511 --- /dev/null +++ b/src/types/postgres/overrides/any.ts @@ -0,0 +1,89 @@ +// 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 type { Dialect } from "../../any"; +import { meta } from "../../runtime"; +import type { NullOf, StrictNull, TsTypeOf } from "../../runtime"; +import * as types from "../index"; +import { sql, type Sql } from "../../../builder/sql"; +import { expose } from "../../../exoeval/tool"; +import { isPlainData } from "../../../util"; + +export class Any extends Generated { + // 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; + }; + 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>; + } + + isNotNull(): types.Bool<1> { + return types.Bool.from(sql`(${this.toSql()} IS NOT NULL)`) as types.Bool<1>; + } + + // 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 + // compiles to `(this IN (v1, v2, ...))`; pg's planner rewrites the + // single-value case to `=` itself during planning. SQL forbids + // `IN ()`, so the type signature requires at least one arg. + // + // Return nullability propagates from the LHS and any of the args: + // SQL three-valued logic on `IN` returns NULL when there's no match + // and either `this` or any list element is NULL. + // + // eslint-disable-next-line no-restricted-syntax -- generic vararg signature with `this`-bound type narrowing isn't expressible in zod + @expose.unchecked() + in< + T extends Any, + Vs extends [ + (T extends { [meta]: { __any: infer A } } ? A : Any) | TsTypeOf, + ...((T extends { [meta]: { __any: infer A } } ? A : Any) | TsTypeOf)[], + ], + >( + this: T, + ...vals: Vs + ): types.Bool | NullOf>> { + const wrapped = vals.map((v) => { + if (v instanceof Any) {return v;} + if (!isPlainData(v)) { + const name = (Object.getPrototypeOf(v) as { constructor?: { name?: string } } | null)?.constructor?.name ?? "anonymous"; + throw new TypeError( + `Any.in: cannot accept ${name} instance as a list value. ` + + `Pass a typegres expression or a primitive matching ${(this[meta].__class as typeof Any).__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 unknown as types.Bool | NullOf>>; + } +} + +// 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/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/postgres/overrides/bool.ts b/src/types/postgres/overrides/bool.ts new file mode 100644 index 0000000..40958be --- /dev/null +++ b/src/types/postgres/overrides/bool.ts @@ -0,0 +1,20 @@ +import { Bool as Generated } from "../generated/bool"; +import { boolAnd, boolOr, boolNot } from "../../bool-mixin"; +import type { NullOf, StrictNull } from "../../runtime"; + +export class Bool extends Generated { + 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; + } + + or>(other: M): Bool>> { + return Bool.from(boolOr(this.toSql(), other)) as any; + } + + not(): Bool { + return Bool.from(boolNot(this.toSql())) 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/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 diff --git a/src/types/runtime.ts b/src/types/runtime.ts index 6188c45..edd6e53 100644 --- a/src/types/runtime.ts +++ b/src/types/runtime.ts @@ -1,16 +1,20 @@ export type { Sql } from "../builder/sql"; export { sql } from "../builder/sql"; -import type { BoundSql, Raw } from "../builder/sql"; +import type { BoundSql, Raw, CompileContext } from "../builder/sql"; import { Func, Op, Sql, sql } from "../builder/sql"; -import * as types from "./index"; -import type { Any } from "./index"; -import { getTypeDef } from "./deserialize"; +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 { SqlValue } from "./any"; 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 +22,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 +38,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 +50,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()) @@ -96,10 +101,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), ); }; @@ -112,12 +118,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]; @@ -125,8 +133,7 @@ export const match = (args: unknown[], cases: MatchCase[]): [typeof Any, ...unkn return true; } if (m.allowPrimitive) { - const expected = getTypeDef(m.type.__typnameText).tsType; - if (typeof arg === expected) { + if (typeof arg === m.type.primitiveTs) { return true; } } @@ -145,38 +152,50 @@ 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); }; -// Expression node builders — construct real typed instances via constructor(Sql) -export const PgFunc = (name: string, args: unknown[], type: typeof Any) => { - return type.from(new Func(name, args.map(argToSql))); +// 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. +// +// `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 PgOp = (op: Raw, args: [unknown, unknown], type: typeof Any) => { - return type.from(new Op(op, argToSql(args[0]), argToSql(args[1]))); +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)); }; // 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][]; + #columns: [string, typeof SqlValue][]; #argsSql: Sql; - constructor(name: A, args: unknown[], columns: [string, typeof Any][]) { + #dialect: string | undefined; + constructor(name: A, args: unknown[], columns: [string, typeof SqlValue][]) { 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 @@ -188,8 +207,13 @@ export class PgSrf }, A extends string> exte } // 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`${ctx.database.scopedIdent(this.#name)}(${this.#argsSql})`; } // Expose the args fragment so generic tree walkers (extractor, linting, diff --git a/src/types/sqlite/base.ts b/src/types/sqlite/base.ts new file mode 100644 index 0000000..f3cb64c --- /dev/null +++ b/src/types/sqlite/base.ts @@ -0,0 +1,70 @@ +// 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"; +import { expose } from "../../exoeval/tool"; +import { isPlainData } from "../../util"; + +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>; + } + + // 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; + } +} diff --git a/src/types/sqlite/functions.json b/src/types/sqlite/functions.json new file mode 100644 index 0000000..4a08c54 --- /dev/null +++ b/src/types/sqlite/functions.json @@ -0,0 +1,19931 @@ +{ + "sqlite_version": "3.53.2", + "generated_at": "2026-07-03T00:21:29.958Z", + "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..43dce76 --- /dev/null +++ b/src/types/sqlite/generate.ts @@ -0,0 +1,469 @@ +// 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()]; +}; + +// 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]}`; + const lines: string[] = []; + lines.push("// Auto-generated by src/types/sqlite/generate.ts — do not edit."); + 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 * as runtime 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}";`); + // 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", + }; + if (!overrideExistsFor(overridesRoot, ownerType)) { + lines.push(` declare deserialize: (raw: string) => ${declaredTsType[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); + 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("}"); + lines.push(""); + return lines.join("\n"); +}; + +const emitClasses = ( + sigs: FunctionSig[], + generatedDir: string, + overridesRoot: 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, overridesRoot); + 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 }); + // 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. 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) => { + 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( + /\/\/ \[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..7f9209c --- /dev/null +++ b/src/types/sqlite/generated/blob.ts @@ -0,0 +1,329 @@ +// Auto-generated by src/types/sqlite/generate.ts — do not edit. +// 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 * as runtime 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"; + declare deserialize: (raw: string) => Uint8Array; + + abs(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("abs", [this, ...__rest], __rt) as types.Real; + } + avg(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("avg", [this, ...__rest], __rt) as types.Real; + } + char(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("char", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("count", [this, ...__rest], __rt) as types.Integer; + } + firstValue(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("first_value", [this, ...__rest], __rt) as types.Blob; + } + format(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("format", [this, ...__rest], __rt) as types.Text; + } + fts5Insttoken(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("fts5_insttoken", [this, ...__rest], __rt) 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: 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("group_concat", [this, ...__rest], __rt) as types.Text; + } + hex(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("hex", [this, ...__rest], __rt) as types.Text; + } + 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: 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json", [this, ...__rest], __rt) as types.Text; + } + jsonArray(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array", [this, ...__rest], __rt) as types.Text; + } + jsonArrayInsert(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array_insert", [this, ...__rest], __rt) as types.Text; + } + jsonArrayLength(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_array_length", [this, ...__rest], __rt) as types.Integer; + } + jsonb(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb", [this, ...__rest], __rt) as types.Blob; + } + jsonbArray(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array", [this, ...__rest], __rt) as types.Blob; + } + jsonbArrayInsert(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array_insert", [this, ...__rest], __rt) as types.Blob; + } + jsonbGroupArray(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_group_array", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_insert", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_remove", [this, ...__rest], __rt) as types.Blob; + } + jsonbReplace(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_replace", [this, ...__rest], __rt) as types.Blob; + } + jsonbSet(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_set", [this, ...__rest], __rt) as types.Blob; + } + jsonErrorPosition(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_error_position", [this, ...__rest], __rt) as types.Integer; + } + jsonGroupArray(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_group_array", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_insert", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_pretty", [this, ...__rest], __rt) as types.Text; + } + jsonQuote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_quote", [this, ...__rest], __rt) as types.Text; + } + jsonRemove(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_remove", [this, ...__rest], __rt) as types.Text; + } + jsonReplace(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_replace", [this, ...__rest], __rt) as types.Text; + } + jsonSet(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_set", [this, ...__rest], __rt) as types.Text; + } + jsonType(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_type", [this, ...__rest], __rt) as types.Text; + } + jsonValid(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_valid", [this, ...__rest], __rt) as types.Integer; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("last_value", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("length", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("likely", [this, ...__rest], __rt) as types.Blob; + } + lower(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("lower", [this, ...__rest], __rt) as types.Text; + } + ltrim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("ltrim", [this, ...__rest], __rt) as types.Text; + } + max(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("max", [this, ...__rest], __rt) as types.Blob; + } + min(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("min", [this, ...__rest], __rt) as types.Blob; + } + octetLength(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("octet_length", [this, ...__rest], __rt) as types.Integer; + } + printf(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("printf", [this, ...__rest], __rt) as types.Text; + } + quote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("quote", [this, ...__rest], __rt) as types.Text; + } + randomblob(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("randomblob", [this, ...__rest], __rt) as types.Blob; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("round", [this, ...__rest], __rt) as types.Real; + } + rtrim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("rtrim", [this, ...__rest], __rt) as types.Text; + } + soundex(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("soundex", [this, ...__rest], __rt) as types.Text; + } + sqliteCompileoptionGet(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("sqlite_compileoption_get", [this, ...__rest], __rt) as types.Text; + } + sqliteCompileoptionUsed(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sqlite_compileoption_used", [this, ...__rest], __rt) as types.Integer; + } + strftime(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("strftime", [this, ...__rest], __rt) 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: 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: 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("subtype", [this, ...__rest], __rt) as types.Integer; + } + sum(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sum", [this, ...__rest], __rt) as types.Real; + } + total(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("total", [this, ...__rest], __rt) as types.Real; + } + trim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("trim", [this, ...__rest], __rt) as types.Text; + } + typeof(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("typeof", [this, ...__rest], __rt) as types.Text; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unicode", [this, ...__rest], __rt) as types.Integer; + } + unistr(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr", [this, ...__rest], __rt) as types.Text; + } + unistrQuote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr_quote", [this, ...__rest], __rt) as types.Text; + } + unlikely(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("unlikely", [this, ...__rest], __rt) as types.Blob; + } + upper(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("upper", [this, ...__rest], __rt) as types.Text; + } + zeroblob(): 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/bool.ts b/src/types/sqlite/generated/bool.ts new file mode 100644 index 0000000..e795e3a --- /dev/null +++ b/src/types/sqlite/generated/bool.ts @@ -0,0 +1,41 @@ +// 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"` 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"; +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"; + + and>(other: M): Bool>> { + return Bool.from(boolAnd(this.toSql(), other)) as any; + } + + or>(other: M): Bool>> { + return Bool.from(boolOr(this.toSql(), other)) 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..515723c --- /dev/null +++ b/src/types/sqlite/generated/integer.ts @@ -0,0 +1,488 @@ +// Auto-generated by src/types/sqlite/generate.ts — do not edit. +// 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 * as runtime 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("abs", [this, ...__rest], __rt) as types.Integer; + } + acos(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("acos", [this, ...__rest], __rt) as types.Real; + } + acosh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("acosh", [this, ...__rest], __rt) as types.Real; + } + asin(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("asin", [this, ...__rest], __rt) as types.Real; + } + asinh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("asinh", [this, ...__rest], __rt) as types.Real; + } + atan(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("atan", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("atanh", [this, ...__rest], __rt) as types.Real; + } + avg(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("avg", [this, ...__rest], __rt) as types.Real; + } + ceil(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("ceil", [this, ...__rest], __rt) as types.Integer; + } + ceiling(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("ceiling", [this, ...__rest], __rt) as types.Integer; + } + char(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("char", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("cos", [this, ...__rest], __rt) as types.Real; + } + cosh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("cosh", [this, ...__rest], __rt) as types.Real; + } + count(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("count", [this, ...__rest], __rt) as types.Integer; + } + date(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("date", [this, ...__rest], __rt) as types.Text; + } + datetime(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("datetime", [this, ...__rest], __rt) as types.Text; + } + degrees(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("degrees", [this, ...__rest], __rt) as types.Real; + } + exp(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("exp", [this, ...__rest], __rt) as types.Real; + } + firstValue(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("first_value", [this, ...__rest], __rt) as types.Integer; + } + floor(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("floor", [this, ...__rest], __rt) as types.Integer; + } + format(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("format", [this, ...__rest], __rt) as types.Text; + } + fts5Insttoken(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("fts5_insttoken", [this, ...__rest], __rt) as types.Integer; + } + 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("group_concat", [this, ...__rest], __rt) as types.Text; + } + hex(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("hex", [this, ...__rest], __rt) as types.Text; + } + 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json", [this, ...__rest], __rt) as types.Text; + } + jsonArray(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array", [this, ...__rest], __rt) as types.Text; + } + jsonArrayInsert(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array_insert", [this, ...__rest], __rt) as types.Text; + } + jsonArrayLength(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_array_length", [this, ...__rest], __rt) as types.Integer; + } + jsonb(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb", [this, ...__rest], __rt) as types.Blob; + } + jsonbArray(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array", [this, ...__rest], __rt) as types.Blob; + } + jsonbArrayInsert(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array_insert", [this, ...__rest], __rt) as types.Blob; + } + jsonbGroupArray(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_group_array", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_insert", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_remove", [this, ...__rest], __rt) as types.Blob; + } + jsonbReplace(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_replace", [this, ...__rest], __rt) as types.Blob; + } + jsonbSet(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_set", [this, ...__rest], __rt) as types.Blob; + } + jsonErrorPosition(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_error_position", [this, ...__rest], __rt) as types.Integer; + } + jsonGroupArray(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_group_array", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_insert", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_pretty", [this, ...__rest], __rt) as types.Text; + } + jsonQuote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_quote", [this, ...__rest], __rt) as types.Text; + } + jsonRemove(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_remove", [this, ...__rest], __rt) as types.Text; + } + jsonReplace(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_replace", [this, ...__rest], __rt) as types.Text; + } + jsonSet(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_set", [this, ...__rest], __rt) as types.Text; + } + jsonType(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_type", [this, ...__rest], __rt) as types.Text; + } + jsonValid(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_valid", [this, ...__rest], __rt) as types.Integer; + } + julianday(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("julianday", [this, ...__rest], __rt) as types.Real; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("last_value", [this, ...__rest], __rt) as types.Integer; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("length", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("likely", [this, ...__rest], __rt) as types.Integer; + } + ln(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("ln", [this, ...__rest], __rt) as types.Real; + } + log(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log", [this, ...__rest], __rt) as types.Real; + } + log10(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log10", [this, ...__rest], __rt) as types.Real; + } + log2(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log2", [this, ...__rest], __rt) as types.Real; + } + lower(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("lower", [this, ...__rest], __rt) as types.Text; + } + ltrim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("ltrim", [this, ...__rest], __rt) as types.Text; + } + max(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("max", [this, ...__rest], __rt) as types.Integer; + } + median(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("median", [this, ...__rest], __rt) as types.Real; + } + min(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("min", [this, ...__rest], __rt) as types.Integer; + } + 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("ntile", [this, ...__rest], __rt) as types.Integer; + } + octetLength(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("octet_length", [this, ...__rest], __rt) as types.Integer; + } + 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 | 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 | 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 | 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("printf", [this, ...__rest], __rt) as types.Text; + } + quote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("quote", [this, ...__rest], __rt) as types.Text; + } + radians(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("radians", [this, ...__rest], __rt) as types.Real; + } + randomblob(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("randomblob", [this, ...__rest], __rt) as types.Blob; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("round", [this, ...__rest], __rt) as types.Real; + } + rtrim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("rtrim", [this, ...__rest], __rt) as types.Text; + } + sign(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sign", [this, ...__rest], __rt) as types.Integer; + } + sin(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sin", [this, ...__rest], __rt) as types.Real; + } + sinh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sinh", [this, ...__rest], __rt) as types.Real; + } + soundex(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("soundex", [this, ...__rest], __rt) as types.Text; + } + sqliteCompileoptionGet(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("sqlite_compileoption_get", [this, ...__rest], __rt) as types.Text; + } + sqliteCompileoptionUsed(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sqlite_compileoption_used", [this, ...__rest], __rt) as types.Integer; + } + sqrt(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sqrt", [this, ...__rest], __rt) as types.Real; + } + strftime(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("strftime", [this, ...__rest], __rt) 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 | 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("subtype", [this, ...__rest], __rt) as types.Integer; + } + sum(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sum", [this, ...__rest], __rt) as types.Integer; + } + tan(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("tan", [this, ...__rest], __rt) as types.Real; + } + tanh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("tanh", [this, ...__rest], __rt) as types.Real; + } + time(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("time", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("total", [this, ...__rest], __rt) as types.Real; + } + trim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("trim", [this, ...__rest], __rt) as types.Text; + } + trunc(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("trunc", [this, ...__rest], __rt) as types.Integer; + } + typeof(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("typeof", [this, ...__rest], __rt) as types.Text; + } + unicode(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unicode", [this, ...__rest], __rt) as types.Integer; + } + unistr(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr", [this, ...__rest], __rt) as types.Text; + } + unistrQuote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr_quote", [this, ...__rest], __rt) as types.Text; + } + unixepoch(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unixepoch", [this, ...__rest], __rt) as types.Integer; + } + unlikely(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unlikely", [this, ...__rest], __rt) as types.Integer; + } + upper(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("upper", [this, ...__rest], __rt) as types.Text; + } + zeroblob(): 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 new file mode 100644 index 0000000..64efc25 --- /dev/null +++ b/src/types/sqlite/generated/real.ts @@ -0,0 +1,464 @@ +// Auto-generated by src/types/sqlite/generate.ts — do not edit. +// 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 * as runtime 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("abs", [this, ...__rest], __rt) as types.Real; + } + acosh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("acosh", [this, ...__rest], __rt) as types.Real; + } + asinh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("asinh", [this, ...__rest], __rt) as types.Real; + } + atan(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("atan", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("avg", [this, ...__rest], __rt) as types.Real; + } + ceil(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("ceil", [this, ...__rest], __rt) as types.Real; + } + ceiling(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("ceiling", [this, ...__rest], __rt) as types.Real; + } + char(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("char", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("cos", [this, ...__rest], __rt) as types.Real; + } + cosh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("cosh", [this, ...__rest], __rt) as types.Real; + } + count(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("count", [this, ...__rest], __rt) as types.Integer; + } + date(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("date", [this, ...__rest], __rt) as types.Text; + } + datetime(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("datetime", [this, ...__rest], __rt) as types.Text; + } + degrees(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("degrees", [this, ...__rest], __rt) as types.Real; + } + exp(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("exp", [this, ...__rest], __rt) as types.Real; + } + firstValue(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("first_value", [this, ...__rest], __rt) as types.Real; + } + floor(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("floor", [this, ...__rest], __rt) as types.Real; + } + format(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("format", [this, ...__rest], __rt) as types.Text; + } + fts5Insttoken(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("fts5_insttoken", [this, ...__rest], __rt) as types.Real; + } + 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("group_concat", [this, ...__rest], __rt) as types.Text; + } + hex(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("hex", [this, ...__rest], __rt) as types.Text; + } + 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json", [this, ...__rest], __rt) as types.Text; + } + jsonArray(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array", [this, ...__rest], __rt) as types.Text; + } + jsonArrayInsert(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array_insert", [this, ...__rest], __rt) as types.Text; + } + jsonArrayLength(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_array_length", [this, ...__rest], __rt) as types.Integer; + } + jsonb(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb", [this, ...__rest], __rt) as types.Blob; + } + jsonbArray(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array", [this, ...__rest], __rt) as types.Blob; + } + jsonbArrayInsert(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array_insert", [this, ...__rest], __rt) as types.Blob; + } + jsonbGroupArray(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_group_array", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_insert", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_remove", [this, ...__rest], __rt) as types.Blob; + } + jsonbReplace(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_replace", [this, ...__rest], __rt) as types.Blob; + } + jsonbSet(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_set", [this, ...__rest], __rt) as types.Blob; + } + jsonErrorPosition(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_error_position", [this, ...__rest], __rt) as types.Integer; + } + jsonGroupArray(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_group_array", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_insert", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_pretty", [this, ...__rest], __rt) as types.Text; + } + jsonQuote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_quote", [this, ...__rest], __rt) as types.Text; + } + jsonRemove(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_remove", [this, ...__rest], __rt) as types.Text; + } + jsonReplace(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_replace", [this, ...__rest], __rt) as types.Text; + } + jsonSet(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_set", [this, ...__rest], __rt) as types.Text; + } + jsonType(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_type", [this, ...__rest], __rt) as types.Text; + } + jsonValid(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_valid", [this, ...__rest], __rt) as types.Integer; + } + julianday(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("julianday", [this, ...__rest], __rt) as types.Real; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("last_value", [this, ...__rest], __rt) as types.Real; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("length", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("likely", [this, ...__rest], __rt) as types.Real; + } + ln(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("ln", [this, ...__rest], __rt) as types.Real; + } + log(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log", [this, ...__rest], __rt) as types.Real; + } + log10(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log10", [this, ...__rest], __rt) as types.Real; + } + log2(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("log2", [this, ...__rest], __rt) as types.Real; + } + lower(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("lower", [this, ...__rest], __rt) as types.Text; + } + ltrim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("ltrim", [this, ...__rest], __rt) as types.Text; + } + max(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("max", [this, ...__rest], __rt) as types.Real; + } + median(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("median", [this, ...__rest], __rt) as types.Real; + } + min(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("min", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("ntile", [this, ...__rest], __rt) as types.Integer; + } + octetLength(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("octet_length", [this, ...__rest], __rt) as types.Integer; + } + 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 | 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("printf", [this, ...__rest], __rt) as types.Text; + } + quote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("quote", [this, ...__rest], __rt) as types.Text; + } + radians(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("radians", [this, ...__rest], __rt) as types.Real; + } + randomblob(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("randomblob", [this, ...__rest], __rt) as types.Blob; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("round", [this, ...__rest], __rt) as types.Real; + } + rtrim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("rtrim", [this, ...__rest], __rt) as types.Text; + } + sign(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sign", [this, ...__rest], __rt) as types.Integer; + } + sin(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sin", [this, ...__rest], __rt) as types.Real; + } + sinh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sinh", [this, ...__rest], __rt) as types.Real; + } + soundex(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("soundex", [this, ...__rest], __rt) as types.Text; + } + sqliteCompileoptionGet(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("sqlite_compileoption_get", [this, ...__rest], __rt) as types.Text; + } + sqliteCompileoptionUsed(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sqlite_compileoption_used", [this, ...__rest], __rt) as types.Integer; + } + sqrt(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sqrt", [this, ...__rest], __rt) as types.Real; + } + strftime(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("strftime", [this, ...__rest], __rt) 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 | 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("subtype", [this, ...__rest], __rt) as types.Integer; + } + sum(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sum", [this, ...__rest], __rt) as types.Real; + } + tan(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("tan", [this, ...__rest], __rt) as types.Real; + } + tanh(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("tanh", [this, ...__rest], __rt) as types.Real; + } + time(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("time", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("total", [this, ...__rest], __rt) as types.Real; + } + trim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("trim", [this, ...__rest], __rt) as types.Text; + } + trunc(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("trunc", [this, ...__rest], __rt) as types.Real; + } + typeof(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("typeof", [this, ...__rest], __rt) as types.Text; + } + unicode(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unicode", [this, ...__rest], __rt) as types.Integer; + } + unistr(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr", [this, ...__rest], __rt) as types.Text; + } + unistrQuote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr_quote", [this, ...__rest], __rt) as types.Text; + } + unixepoch(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unixepoch", [this, ...__rest], __rt) as types.Integer; + } + unlikely(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("unlikely", [this, ...__rest], __rt) as types.Real; + } + upper(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("upper", [this, ...__rest], __rt) as types.Text; + } + zeroblob(): 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 new file mode 100644 index 0000000..20e5460 --- /dev/null +++ b/src/types/sqlite/generated/text.ts @@ -0,0 +1,273 @@ +// Auto-generated by src/types/sqlite/generate.ts — do not edit. +// 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 * as runtime 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"; + declare deserialize: (raw: string) => string; + + abs(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("abs", [this, ...__rest], __rt) as types.Real; + } + avg(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("avg", [this, ...__rest], __rt) as types.Real; + } + char(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("char", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("count", [this, ...__rest], __rt) as types.Integer; + } + firstValue(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("first_value", [this, ...__rest], __rt) as types.Text; + } + format(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("format", [this, ...__rest], __rt) as types.Text; + } + fts5Insttoken(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("fts5_insttoken", [this, ...__rest], __rt) as types.Text; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("geopoly_group_bbox", [this, ...__rest], __rt) as types.Blob; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("group_concat", [this, ...__rest], __rt) as types.Text; + } + hex(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("hex", [this, ...__rest], __rt) 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_array", [this, ...__rest], __rt) as types.Text; + } + jsonbArray(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_array", [this, ...__rest], __rt) as types.Blob; + } + jsonbGroupArray(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("jsonb_group_array", [this, ...__rest], __rt) 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_error_position", [this, ...__rest], __rt) as types.Integer; + } + jsonGroupArray(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_group_array", [this, ...__rest], __rt) 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("json_quote", [this, ...__rest], __rt) as types.Text; + } + jsonValid(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("json_valid", [this, ...__rest], __rt) as types.Integer; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("last_value", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("length", [this, ...__rest], __rt) 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("likely", [this, ...__rest], __rt) as types.Text; + } + lower(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("lower", [this, ...__rest], __rt) as types.Text; + } + ltrim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("ltrim", [this, ...__rest], __rt) as types.Text; + } + max(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("max", [this, ...__rest], __rt) as types.Text; + } + min(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("min", [this, ...__rest], __rt) as types.Text; + } + octetLength(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("octet_length", [this, ...__rest], __rt) as types.Integer; + } + printf(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("printf", [this, ...__rest], __rt) as types.Text; + } + quote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("quote", [this, ...__rest], __rt) as types.Text; + } + randomblob(): types.Blob { + const [__rt, ...__rest] = runtime.match([], [[[], types.Blob]]); + return runtime.funcCall("randomblob", [this, ...__rest], __rt) as types.Blob; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("round", [this, ...__rest], __rt) as types.Real; + } + rtrim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("rtrim", [this, ...__rest], __rt) as types.Text; + } + soundex(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("soundex", [this, ...__rest], __rt) as types.Text; + } + sqliteCompileoptionGet(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("sqlite_compileoption_get", [this, ...__rest], __rt) as types.Text; + } + sqliteCompileoptionUsed(): types.Integer { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("sqlite_compileoption_used", [this, ...__rest], __rt) as types.Integer; + } + strftime(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("strftime", [this, ...__rest], __rt) 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 | 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 | 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("subtype", [this, ...__rest], __rt) as types.Integer; + } + sum(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("sum", [this, ...__rest], __rt) as types.Real; + } + total(): types.Real { + const [__rt, ...__rest] = runtime.match([], [[[], types.Real]]); + return runtime.funcCall("total", [this, ...__rest], __rt) as types.Real; + } + trim(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("trim", [this, ...__rest], __rt) as types.Text; + } + typeof(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("typeof", [this, ...__rest], __rt) as types.Text; + } + 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 { + const [__rt, ...__rest] = runtime.match([], [[[], types.Integer]]); + return runtime.funcCall("unicode", [this, ...__rest], __rt) as types.Integer; + } + unistr(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr", [this, ...__rest], __rt) as types.Text; + } + unistrQuote(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unistr_quote", [this, ...__rest], __rt) as types.Text; + } + unlikely(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("unlikely", [this, ...__rest], __rt) as types.Text; + } + upper(): types.Text { + const [__rt, ...__rest] = runtime.match([], [[[], types.Text]]); + return runtime.funcCall("upper", [this, ...__rest], __rt) as types.Text; + } + zeroblob(): 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/index.ts b/src/types/sqlite/index.ts new file mode 100644 index 0000000..6bd2a26 --- /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 "./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); } +} diff --git a/src/types/sqlite/smoke.test.ts b/src/types/sqlite/smoke.test.ts new file mode 100644 index 0000000..b992f4f --- /dev/null +++ b/src/types/sqlite/smoke.test.ts @@ -0,0 +1,114 @@ +// 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 type { Connection } from "../../database"; +import { Database } from "../../database"; +import { compile, sql } 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({ dialect: "sqlite" }); + conn = db.attach(driver); +}); + +afterAll(async () => { + await conn.close(); +}); + +test("Integer.abs on a negative literal", async () => { + const expr = Integer.from(-5).abs(); + 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 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 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 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 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 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 + 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 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 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 conn.execute(sql`SELECT ${expr.toSql()} as v`); + 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); + 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(), { database: db }); + expect(compiled.text).toContain("?"); + expect(compiled.text).not.toContain("$"); +}); diff --git a/src/types/sqlite/table.test.ts b/src/types/sqlite/table.test.ts new file mode 100644 index 0000000..375fe38 --- /dev/null +++ b/src/types/sqlite/table.test.ts @@ -0,0 +1,144 @@ +// 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. +// +// 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"; +import { sql } from "../../builder/sql"; +import { expose } from "../../exoeval/tool"; +import { Integer, Text } from "./index"; + +const db = new Database({ dialect: "sqlite" }); + +class Users extends db.Table("users") { + @expose() + id = Integer.column({ nonNull: true }); + @expose() + name = Text.column({ nonNull: true }); +} + +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); + await conn.execute(sql`CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL)`); +}); + +afterAll(async () => { + await conn.close(); +}); + +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 () => { + 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 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 .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("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 () => { + 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 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); + }); +}); 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) {