From c28ae11ed7dfcabe33889a93f1162dd54ed66a76 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Wed, 26 Apr 2023 09:08:22 -0400 Subject: [PATCH 1/6] wip Benchmarks --- packages/benchmarks/package.json | 44 + .../project-fixture/dbschema/default.esdl | 5 + .../dbschema/edgeql-js/__spec__.ts | 153 + .../dbschema/edgeql-js/cardinality.ts | 357 ++ .../dbschema/edgeql-js/cast.ts | 56 + .../dbschema/edgeql-js/castMaps.ts | 740 +++ .../dbschema/edgeql-js/casting.ts | 164 + .../dbschema/edgeql-js/collections.ts | 366 ++ .../dbschema/edgeql-js/config.json | 2 + .../dbschema/edgeql-js/detached.ts | 24 + .../dbschema/edgeql-js/external.ts | 33 + .../project-fixture/dbschema/edgeql-js/for.ts | 60 + .../dbschema/edgeql-js/funcops.ts | 461 ++ .../dbschema/edgeql-js/globals.ts | 30 + .../dbschema/edgeql-js/group.ts | 349 ++ .../dbschema/edgeql-js/hydrate.ts | 286 ++ .../dbschema/edgeql-js/imports.ts | 7 + .../dbschema/edgeql-js/index.ts | 50 + .../dbschema/edgeql-js/insert.ts | 301 ++ .../dbschema/edgeql-js/json.ts | 93 + .../dbschema/edgeql-js/literal.ts | 58 + .../dbschema/edgeql-js/modules/cal.ts | 478 ++ .../dbschema/edgeql-js/modules/cfg.ts | 212 + .../dbschema/edgeql-js/modules/default.ts | 27 + .../dbschema/edgeql-js/modules/math.ts | 493 ++ .../dbschema/edgeql-js/modules/schema.ts | 972 ++++ .../dbschema/edgeql-js/modules/std.ts | 4493 +++++++++++++++++ .../dbschema/edgeql-js/modules/sys.ts | 223 + .../dbschema/edgeql-js/operators.ts | 4289 ++++++++++++++++ .../dbschema/edgeql-js/params.ts | 151 + .../dbschema/edgeql-js/path.ts | 477 ++ .../dbschema/edgeql-js/query.ts | 63 + .../dbschema/edgeql-js/range.ts | 202 + .../dbschema/edgeql-js/reflection.ts | 11 + .../dbschema/edgeql-js/select.ts | 1221 +++++ .../project-fixture/dbschema/edgeql-js/set.ts | 222 + .../dbschema/edgeql-js/setImpl.ts | 114 + .../dbschema/edgeql-js/syntax.ts | 24 + .../dbschema/edgeql-js/toEdgeQL.ts | 1669 ++++++ .../dbschema/edgeql-js/typesystem.ts | 791 +++ .../dbschema/edgeql-js/update.ts | 134 + .../dbschema/edgeql-js/with.ts | 65 + .../project-fixture/dbschema/futures.esdl | 4 + .../dbschema/migrations/00001.edgeql | 8 + .../benchmarks/project-fixture/edgedb.toml | 2 + packages/benchmarks/project-fixture/index.ts | 9 + .../benchmarks/project-fixture/package.json | 9 + .../benchmarks/project-fixture/tsconfig.json | 109 + packages/benchmarks/project-fixture/yarn.lock | 117 + packages/benchmarks/src/index.ts | 88 + packages/benchmarks/src/server-fixture.ts | 135 + packages/benchmarks/tsconfig.json | 109 + packages/generate/src/syntax/with.ts | 2 +- yarn.lock | 295 +- 54 files changed, 20844 insertions(+), 13 deletions(-) create mode 100644 packages/benchmarks/package.json create mode 100644 packages/benchmarks/project-fixture/dbschema/default.esdl create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/__spec__.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/cardinality.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/cast.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/castMaps.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/casting.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/collections.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/config.json create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/detached.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/external.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/for.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/funcops.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/globals.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/group.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/hydrate.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/imports.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/index.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/insert.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/json.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/literal.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/cal.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/cfg.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/default.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/math.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/schema.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/std.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/sys.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/operators.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/params.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/path.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/query.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/range.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/reflection.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/select.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/set.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/setImpl.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/syntax.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/toEdgeQL.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/typesystem.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/update.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/edgeql-js/with.ts create mode 100644 packages/benchmarks/project-fixture/dbschema/futures.esdl create mode 100644 packages/benchmarks/project-fixture/dbschema/migrations/00001.edgeql create mode 100644 packages/benchmarks/project-fixture/edgedb.toml create mode 100644 packages/benchmarks/project-fixture/index.ts create mode 100644 packages/benchmarks/project-fixture/package.json create mode 100644 packages/benchmarks/project-fixture/tsconfig.json create mode 100644 packages/benchmarks/project-fixture/yarn.lock create mode 100644 packages/benchmarks/src/index.ts create mode 100644 packages/benchmarks/src/server-fixture.ts create mode 100644 packages/benchmarks/tsconfig.json diff --git a/packages/benchmarks/package.json b/packages/benchmarks/package.json new file mode 100644 index 000000000..bf0db0769 --- /dev/null +++ b/packages/benchmarks/package.json @@ -0,0 +1,44 @@ +{ + "name": "edgedb-benchmarks", + "version": "1.0.0", + "description": "Benchmarks for EdgeDB JavaScript client libraries", + "homepage": "https://edgedb.com/docs", + "author": "EdgeDB ", + "engines": { + "node": ">= 16.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/edgedb/edgedb-js.git" + }, + "main": "./dist/index.node.js", + "types": "./dist/index.node.d.ts", + "license": "Apache-2.0", + "sideEffects": false, + "files": [ + "/dist" + ], + "devDependencies": { + "@types/jest": "^29.5.1", + "benny": "^3.7.1", + "jest": "29.5.0", + "ts-jest": "29.1.0", + "tsx": "3.12.6", + "typescript": "^5.0" + }, + "scripts": { + "benchmark": "tsx src/benchmark.ts" + }, + "bugs": { + "url": "https://github.com/edgedb/edgedb-js/issues" + }, + "keywords": [], + "dependencies": { + "tinybench": "^2.5.0", + "ts-node": "^10.9.1", + "ts48": "npm:typescript@4.8.4", + "ts49": "npm:typescript@4.9.5", + "ts50": "npm:typescript@5.0.4", + "ts51": "npm:typescript@5.1.3" + } +} diff --git a/packages/benchmarks/project-fixture/dbschema/default.esdl b/packages/benchmarks/project-fixture/dbschema/default.esdl new file mode 100644 index 000000000..4fa0fcff2 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/default.esdl @@ -0,0 +1,5 @@ +module default { + type Person { + required name: str; + } +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/__spec__.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/__spec__.ts new file mode 100644 index 000000000..1a82b4bff --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/__spec__.ts @@ -0,0 +1,153 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "./reflection"; +const spec: $.introspect.Types = new $.StrictMap(); + +spec.set("00000000-0000-0000-0000-000000000002", {"id":"00000000-0000-0000-0000-000000000002","name":"anytuple","is_abstract":false,"kind":"unknown","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("00000000-0000-0000-0000-000000000001", {"id":"00000000-0000-0000-0000-000000000001","name":"anytype","is_abstract":false,"kind":"unknown","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", {"id":"f289fc54-00ce-11ee-b5b3-51abe3fbfdf9","name":"array","is_abstract":true,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-000000000001","tuple_elements":[],"range_element_id":null} as any); +spec.set("fd2299a0-00ce-11ee-99a8-13f657817dd3", {"id":"fd2299a0-00ce-11ee-99a8-13f657817dd3","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-000000000112","tuple_elements":[],"range_element_id":null} as any); +spec.set("fd1d7376-00ce-11ee-b763-413434491d30", {"id":"fd1d7376-00ce-11ee-b763-413434491d30","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-00000000010c","tuple_elements":[],"range_element_id":null} as any); +spec.set("fd1bc2d8-00ce-11ee-8b70-7dd6dc2c48b6", {"id":"fd1bc2d8-00ce-11ee-8b70-7dd6dc2c48b6","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-00000000010b","tuple_elements":[],"range_element_id":null} as any); +spec.set("fd1f277a-00ce-11ee-b99d-b53ad971bf10", {"id":"fd1f277a-00ce-11ee-b99d-b53ad971bf10","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-00000000010d","tuple_elements":[],"range_element_id":null} as any); +spec.set("fd20d958-00ce-11ee-8cac-8b65221a1976", {"id":"fd20d958-00ce-11ee-8cac-8b65221a1976","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-000000000111","tuple_elements":[],"range_element_id":null} as any); +spec.set("f6ef4a92-00ce-11ee-b375-fb226577936b", {"id":"f6ef4a92-00ce-11ee-b375-fb226577936b","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-000000000103","tuple_elements":[],"range_element_id":null} as any); +spec.set("f585e418-00ce-11ee-aa52-9d374bf47278", {"id":"f585e418-00ce-11ee-aa52-9d374bf47278","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-00000000010f","tuple_elements":[],"range_element_id":null} as any); +spec.set("f4f119e6-00ce-11ee-9a0b-934fb014cd5d", {"id":"f4f119e6-00ce-11ee-9a0b-934fb014cd5d","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-000000000101","tuple_elements":[],"range_element_id":null} as any); +spec.set("fd3e37e6-00ce-11ee-93ba-3b7113c38bd6", {"id":"fd3e37e6-00ce-11ee-93ba-3b7113c38bd6","name":"array","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"00000000-0000-0000-0000-000000000100","tuple_elements":[],"range_element_id":null} as any); +spec.set("f7e66fc0-00ce-11ee-9385-1954848a8bab", {"id":"f7e66fc0-00ce-11ee-9385-1954848a8bab","name":"array>","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"f7e66be2-00ce-11ee-8901-5f871cb0f151","tuple_elements":[],"range_element_id":null} as any); +spec.set("ffc786e8-00ce-11ee-a2ef-f151b51d5b24", {"id":"ffc786e8-00ce-11ee-a2ef-f151b51d5b24","name":"array>>>","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"ffc7827e-00ce-11ee-a95a-874dc4b9f11e","tuple_elements":[],"range_element_id":null} as any); +spec.set("fe8548c4-00ce-11ee-bf32-77406c5fb8ba", {"id":"fe8548c4-00ce-11ee-bf32-77406c5fb8ba","name":"array>>","is_abstract":false,"kind":"array","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":"fd3e3bb0-00ce-11ee-b14d-a782523a6a93","tuple_elements":[],"range_element_id":null} as any); +spec.set("f26a91ac-00ce-11ee-8346-9f9517d63e40", {"id":"f26a91ac-00ce-11ee-8346-9f9517d63e40","name":"std::anyscalar","is_abstract":true,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("00000000-0000-0000-0000-000000000112", {"id":"00000000-0000-0000-0000-000000000112","name":"cal::date_duration","is_abstract":false,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26a91ac-00ce-11ee-8346-9f9517d63e40"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f26af408-00ce-11ee-af2f-d38fb8cba865", {"id":"f26af408-00ce-11ee-af2f-d38fb8cba865","name":"std::anypoint","is_abstract":true,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26a91ac-00ce-11ee-8346-9f9517d63e40"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f26b5718-00ce-11ee-973c-0f6d05c08e81", {"id":"f26b5718-00ce-11ee-973c-0f6d05c08e81","name":"std::anydiscrete","is_abstract":true,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26af408-00ce-11ee-af2f-d38fb8cba865"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("00000000-0000-0000-0000-00000000010c", {"id":"00000000-0000-0000-0000-00000000010c","name":"cal::local_date","is_abstract":false,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26b5718-00ce-11ee-973c-0f6d05c08e81"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f26bb6c2-00ce-11ee-811a-c73c92c5a247", {"id":"f26bb6c2-00ce-11ee-811a-c73c92c5a247","name":"std::anycontiguous","is_abstract":true,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26af408-00ce-11ee-af2f-d38fb8cba865"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("00000000-0000-0000-0000-00000000010b", {"id":"00000000-0000-0000-0000-00000000010b","name":"cal::local_datetime","is_abstract":false,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26bb6c2-00ce-11ee-811a-c73c92c5a247"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("00000000-0000-0000-0000-00000000010d", {"id":"00000000-0000-0000-0000-00000000010d","name":"cal::local_time","is_abstract":false,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26a91ac-00ce-11ee-8346-9f9517d63e40"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("00000000-0000-0000-0000-000000000111", {"id":"00000000-0000-0000-0000-000000000111","name":"cal::relative_duration","is_abstract":false,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26a91ac-00ce-11ee-8346-9f9517d63e40"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", {"id":"f65a09aa-00ce-11ee-a1aa-7f3b419ffb71","name":"std::BaseObject","is_abstract":true,"kind":"object","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[{"card":"One","name":"__type__","target_id":"f8b292a8-00ce-11ee-ae22-e1500e4da23e","kind":"link","is_exclusive":false,"is_computed":false,"is_readonly":true,"has_default":false,"pointers":[]},{"card":"One","name":"id","target_id":"00000000-0000-0000-0000-000000000100","kind":"property","is_exclusive":true,"is_computed":false,"is_readonly":true,"has_default":true,"pointers":[]}],"exclusives":[{"id":{"card":"One","name":"id","target_id":"00000000-0000-0000-0000-000000000100","kind":"property","is_exclusive":true,"is_computed":false,"is_readonly":true,"has_default":true,"pointers":[]}}],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("fb5344b2-00ce-11ee-8e62-adfdb0bddd8d", {"id":"fb5344b2-00ce-11ee-8e62-adfdb0bddd8d","name":"cfg::ConfigObject","is_abstract":true,"kind":"object","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f65a09aa-00ce-11ee-a1aa-7f3b419ffb71"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("fb7cf4ba-00ce-11ee-96c8-af50a9862c3e", {"id":"fb7cf4ba-00ce-11ee-96c8-af50a9862c3e","name":"cfg::AbstractConfig","is_abstract":true,"kind":"object","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"fb5344b2-00ce-11ee-8e62-adfdb0bddd8d"}],"union_of":[],"intersection_of":[],"pointers":[{"card":"Many","name":"auth","target_id":"fb711fd2-00ce-11ee-8d6e-f3dd08f2109f","kind":"link","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"AtMostOne","name":"force_database_error","target_id":"00000000-0000-0000-0000-000000000101","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"One","name":"session_idle_timeout","target_id":"00000000-0000-0000-0000-00000000010e","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"One","name":"session_idle_transaction_timeout","target_id":"00000000-0000-0000-0000-00000000010e","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"One","name":"query_execution_timeout","target_id":"00000000-0000-0000-0000-00000000010e","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"One","name":"listen_port","target_id":"00000000-0000-0000-0000-000000000103","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"Many","name":"listen_addresses","target_id":"00000000-0000-0000-0000-000000000101","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"AtMostOne","name":"allow_dml_in_functions","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"AtMostOne","name":"allow_bare_ddl","target_id":"fb527712-00ce-11ee-a2b5-5938a2344e0b","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"AtMostOne","name":"apply_access_policies","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"AtMostOne","name":"allow_user_specified_id","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"AtMostOne","name":"shared_buffers","target_id":"00000000-0000-0000-0000-000000000130","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"AtMostOne","name":"query_work_mem","target_id":"00000000-0000-0000-0000-000000000130","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"AtMostOne","name":"effective_cache_size","target_id":"00000000-0000-0000-0000-000000000130","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"AtMostOne","name":"effective_io_concurrency","target_id":"00000000-0000-0000-0000-000000000105","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"AtMostOne","name":"default_statistics_target","target_id":"00000000-0000-0000-0000-000000000105","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"One","name":"_pg_prepared_statement_cache_size","target_id":"00000000-0000-0000-0000-000000000103","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]}],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f272ea46-00ce-11ee-a0b1-2545abfede14", {"id":"f272ea46-00ce-11ee-a0b1-2545abfede14","name":"std::anyenum","is_abstract":true,"kind":"scalar","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f26a91ac-00ce-11ee-8346-9f9517d63e40"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("fb527712-00ce-11ee-a2b5-5938a2344e0b", {"id":"fb527712-00ce-11ee-a2b5-5938a2344e0b","name":"cfg::AllowBareDDL","is_abstract":false,"kind":"scalar","enum_values":["AlwaysAllow","NeverAllow"],"is_seq":false,"material_id":null,"bases":[{"id":"f272ea46-00ce-11ee-a0b1-2545abfede14"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("fb711fd2-00ce-11ee-8d6e-f3dd08f2109f", {"id":"fb711fd2-00ce-11ee-8d6e-f3dd08f2109f","name":"cfg::Auth","is_abstract":false,"kind":"object","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"fb5344b2-00ce-11ee-8e62-adfdb0bddd8d"}],"union_of":[],"intersection_of":[],"pointers":[{"card":"AtMostOne","name":"method","target_id":"fb589282-00ce-11ee-9b69-cf30cb8c4098","kind":"link","is_exclusive":true,"is_computed":false,"is_readonly":true,"has_default":false,"pointers":[]},{"card":"One","name":"priority","target_id":"00000000-0000-0000-0000-000000000105","kind":"property","is_exclusive":true,"is_computed":false,"is_readonly":true,"has_default":false,"pointers":[]},{"card":"Many","name":"user","target_id":"00000000-0000-0000-0000-000000000101","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":true,"has_default":true,"pointers":[]},{"card":"AtMostOne","name":"comment","target_id":"00000000-0000-0000-0000-000000000101","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":true,"has_default":false,"pointers":[]}],"exclusives":[{"priority":{"card":"One","name":"priority","target_id":"00000000-0000-0000-0000-000000000105","kind":"property","is_exclusive":true,"is_computed":false,"is_readonly":true,"has_default":false,"pointers":[]}},{"method":{"card":"AtMostOne","name":"method","target_id":"fb589282-00ce-11ee-9b69-cf30cb8c4098","kind":"link","is_exclusive":true,"is_computed":false,"is_readonly":true,"has_default":false,"pointers":[]}}],"backlinks":[{"card":"Many","name":"","is_abstract":false,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"00000000-0000-0000-0000-00000000010c"} as any); +spec.set("fd31fd82-00ce-11ee-9af0-41d37e070021", {"id":"fd31fd82-00ce-11ee-9af0-41d37e070021","name":"range","is_abstract":false,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"00000000-0000-0000-0000-00000000010b"} as any); +spec.set("f588212e-00ce-11ee-ac49-0dcbbf3b26ff", {"id":"f588212e-00ce-11ee-ac49-0dcbbf3b26ff","name":"range","is_abstract":true,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"f26af408-00ce-11ee-af2f-d38fb8cba865"} as any); +spec.set("f6208ce8-00ce-11ee-8be1-d5f03cecbcf6", {"id":"f6208ce8-00ce-11ee-8be1-d5f03cecbcf6","name":"range","is_abstract":false,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"00000000-0000-0000-0000-00000000010a"} as any); +spec.set("f61f12b4-00ce-11ee-9255-77c974b57987", {"id":"f61f12b4-00ce-11ee-9255-77c974b57987","name":"range","is_abstract":false,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"00000000-0000-0000-0000-000000000108"} as any); +spec.set("f61c1514-00ce-11ee-b758-2ba0294a9d4f", {"id":"f61c1514-00ce-11ee-b758-2ba0294a9d4f","name":"range","is_abstract":false,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"00000000-0000-0000-0000-0000000001ff"} as any); +spec.set("f61d9498-00ce-11ee-bf51-ab3d54bc8377", {"id":"f61d9498-00ce-11ee-bf51-ab3d54bc8377","name":"range","is_abstract":false,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"00000000-0000-0000-0000-0000000001ff"} as any); +spec.set("f6174f20-00ce-11ee-a153-9b9f22def034", {"id":"f6174f20-00ce-11ee-a153-9b9f22def034","name":"range","is_abstract":false,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"00000000-0000-0000-0000-0000000001ff"} as any); +spec.set("f619b030-00ce-11ee-9d90-51e116555ee0", {"id":"f619b030-00ce-11ee-9d90-51e116555ee0","name":"range","is_abstract":false,"kind":"range","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":"00000000-0000-0000-0000-0000000001ff"} as any); +spec.set("f6a088d0-00ce-11ee-bea4-f59ec342125c", {"id":"f6a088d0-00ce-11ee-bea4-f59ec342125c","name":"schema::AccessKind","is_abstract":false,"kind":"scalar","enum_values":["Select","UpdateRead","UpdateWrite","Delete","Insert"],"is_seq":false,"material_id":null,"bases":[{"id":"f272ea46-00ce-11ee-a0b1-2545abfede14"}],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f6a2efd0-00ce-11ee-bcd6-8fb1bad207a0", {"id":"f6a2efd0-00ce-11ee-bcd6-8fb1bad207a0","name":"schema::Object","is_abstract":true,"kind":"object","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f65a09aa-00ce-11ee-a1aa-7f3b419ffb71"}],"union_of":[],"intersection_of":[],"pointers":[{"card":"One","name":"name","target_id":"00000000-0000-0000-0000-000000000101","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"One","name":"internal","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"One","name":"builtin","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"AtMostOne","name":"computed_fields","target_id":"f4f119e6-00ce-11ee-9a0b-934fb014cd5d","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]}],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f6a922d8-00ce-11ee-b4f7-25cfc3329b28", {"id":"f6a922d8-00ce-11ee-b4f7-25cfc3329b28","name":"schema::SubclassableObject","is_abstract":true,"kind":"object","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f6a2efd0-00ce-11ee-bcd6-8fb1bad207a0"}],"union_of":[],"intersection_of":[],"pointers":[{"card":"AtMostOne","name":"abstract","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"AtMostOne","name":"is_abstract","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":true,"is_readonly":false,"has_default":true,"pointers":[]},{"card":"One","name":"final","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":true,"is_readonly":false,"has_default":false,"pointers":[]},{"card":"One","name":"is_final","target_id":"00000000-0000-0000-0000-000000000109","kind":"property","is_exclusive":false,"is_computed":true,"is_readonly":false,"has_default":false,"pointers":[]}],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[],"range_element_id":null} as any); +spec.set("f77488f6-00ce-11ee-ad9a-0f9b478e0ccb", {"id":"f77488f6-00ce-11ee-ad9a-0f9b478e0ccb","name":"schema::InheritingObject","is_abstract":true,"kind":"object","enum_values":null,"is_seq":false,"material_id":null,"bases":[{"id":"f6a922d8-00ce-11ee-b4f7-25cfc3329b28"}],"union_of":[],"intersection_of":[],"pointers":[{"card":"Many","name":"bases","target_id":"f77488f6-00ce-11ee-ad9a-0f9b478e0ccb","kind":"link","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[{"card":"AtMostOne","name":"@index","target_id":"00000000-0000-0000-0000-000000000105","kind":"property","is_computed":false,"is_readonly":false}]},{"card":"Many","name":"ancestors","target_id":"f77488f6-00ce-11ee-ad9a-0f9b478e0ccb","kind":"link","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[{"card":"AtMostOne","name":"@index","target_id":"00000000-0000-0000-0000-000000000105","kind":"property","is_computed":false,"is_readonly":false}]},{"card":"AtMostOne","name":"inherited_fields","target_id":"f4f119e6-00ce-11ee-9a0b-934fb014cd5d","kind":"property","is_exclusive":false,"is_computed":false,"is_readonly":false,"has_default":false,"pointers":[]}],"exclusives":[],"backlinks":[{"card":"Many","name":">","is_abstract":false,"kind":"tuple","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[{"target_id":"00000000-0000-0000-0000-000000000105","name":"major"},{"target_id":"00000000-0000-0000-0000-000000000105","name":"minor"},{"target_id":"00000000-0000-0000-0000-000000000101","name":"stage"},{"target_id":"00000000-0000-0000-0000-000000000105","name":"stage_no"},{"target_id":"f4f119e6-00ce-11ee-9a0b-934fb014cd5d","name":"local"}],"range_element_id":null} as any); +spec.set("fb021718-00ce-11ee-8d81-5d6f603eab62", {"id":"fb021718-00ce-11ee-8d81-5d6f603eab62","name":"tuple>","is_abstract":false,"kind":"tuple","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[{"target_id":"00000000-0000-0000-0000-000000000105","name":"major"},{"target_id":"00000000-0000-0000-0000-000000000105","name":"minor"},{"target_id":"fad7b478-00ce-11ee-8f6a-b399c8e7e5f7","name":"stage"},{"target_id":"00000000-0000-0000-0000-000000000105","name":"stage_no"},{"target_id":"f4f119e6-00ce-11ee-9a0b-934fb014cd5d","name":"local"}],"range_element_id":null} as any); +spec.set("f7e66be2-00ce-11ee-8901-5f871cb0f151", {"id":"f7e66be2-00ce-11ee-8901-5f871cb0f151","name":"tuple","is_abstract":false,"kind":"tuple","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[{"target_id":"00000000-0000-0000-0000-000000000101","name":"name"},{"target_id":"00000000-0000-0000-0000-000000000101","name":"expr"}],"range_element_id":null} as any); +spec.set("ffc7827e-00ce-11ee-a95a-874dc4b9f11e", {"id":"ffc7827e-00ce-11ee-a95a-874dc4b9f11e","name":"tuple>>","is_abstract":false,"kind":"tuple","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[{"target_id":"00000000-0000-0000-0000-000000000101","name":"name"},{"target_id":"fd3e3bb0-00ce-11ee-b14d-a782523a6a93","name":"expr"}],"range_element_id":null} as any); +spec.set("f2a95c0c-00ce-11ee-897b-b386845887d1", {"id":"f2a95c0c-00ce-11ee-897b-b386845887d1","name":"tuple","is_abstract":true,"kind":"tuple","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[{"target_id":"00000000-0000-0000-0000-000000000105","name":"0"},{"target_id":"00000000-0000-0000-0000-000000000001","name":"1"}],"range_element_id":null} as any); +spec.set("f508f548-00ce-11ee-82c5-352d3a41bf71", {"id":"f508f548-00ce-11ee-82c5-352d3a41bf71","name":"tuple","is_abstract":false,"kind":"tuple","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[{"target_id":"00000000-0000-0000-0000-000000000105","name":"0"},{"target_id":"00000000-0000-0000-0000-000000000105","name":"1"}],"range_element_id":null} as any); +spec.set("f5635eac-00ce-11ee-8ccc-473c87d15381", {"id":"f5635eac-00ce-11ee-8ccc-473c87d15381","name":"tuple","is_abstract":false,"kind":"tuple","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[{"target_id":"00000000-0000-0000-0000-000000000101","name":"0"},{"target_id":"00000000-0000-0000-0000-00000000010f","name":"1"}],"range_element_id":null} as any); +spec.set("fd3e3bb0-00ce-11ee-b14d-a782523a6a93", {"id":"fd3e3bb0-00ce-11ee-b14d-a782523a6a93","name":"tuple>","is_abstract":false,"kind":"tuple","enum_values":null,"is_seq":false,"material_id":null,"bases":[],"union_of":[],"intersection_of":[],"pointers":[],"exclusives":[],"backlinks":[],"backlink_stubs":[],"array_element_id":null,"tuple_elements":[{"target_id":"00000000-0000-0000-0000-000000000101","name":"text"},{"target_id":"fd3e37e6-00ce-11ee-93ba-3b7113c38bd6","name":"refs"}],"range_element_id":null} as any); +spec.set("00000000-0000-0000-0000-0000000001ff", {"id":"00000000-0000-0000-0000-0000000001ff","name":"std::number","is_abstract":false,"is_seq":false,"kind":"scalar","enum_values":null,"material_id":null,"bases":[]} as any); + +const complexParamKinds: Set<$.TypeKind> = new Set([]); + + +export { spec, complexParamKinds }; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/cardinality.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/cardinality.ts new file mode 100644 index 000000000..1af342023 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/cardinality.ts @@ -0,0 +1,357 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { Cardinality } from "edgedb/dist/reflection/index"; +import type { TypeSet } from "./typesystem"; + +// Computing cardinality of path +// From base set cadinality and pointer cardinality +// Used in path expressions +// Cardinality Empty AtMostOne One Many AtLeastOne +// Empty 0 0 0 0 0 +// AtMostOne 0 AtMostOne AtMostOne Many Many +// One 0 AtMostOne One Many AtLeastOne +// Many 0 Many Many Many Many +// AtLeastOne 0 Many AtLeastOne Many AtLeastOne +export namespace cardutil { + export type multiplyCardinalities< + C1 extends Cardinality, + C2 extends Cardinality + > = C1 extends Cardinality.Empty + ? Cardinality.Empty + : C1 extends Cardinality.One + ? C2 + : C1 extends Cardinality.AtMostOne + ? C2 extends Cardinality.One + ? Cardinality.AtMostOne + : C2 extends Cardinality.AtLeastOne + ? Cardinality.Many + : C2 + : C1 extends Cardinality.Many + ? C2 extends Cardinality.Empty + ? Cardinality.Empty + : Cardinality.Many + : C1 extends Cardinality.AtLeastOne + ? C2 extends Cardinality.AtMostOne + ? Cardinality.Many + : C2 extends Cardinality.One + ? Cardinality.AtLeastOne + : C2 + : never; + + export function multiplyCardinalities( + c1: Cardinality, + c2: Cardinality + ): Cardinality { + if (c1 === Cardinality.Empty) return Cardinality.Empty; + + if (c1 === Cardinality.One) return c2; + if (c1 === Cardinality.AtMostOne) { + if (c2 === Cardinality.One) return Cardinality.AtMostOne; + if (c2 === Cardinality.AtLeastOne) return Cardinality.Many; + return c2; + } + if (c1 === Cardinality.Many) { + if (c2 === Cardinality.Empty) return Cardinality.Empty; + return Cardinality.Many; + } + if (c1 === Cardinality.AtLeastOne) { + if (c2 === Cardinality.AtMostOne) return Cardinality.Many; + if (c2 === Cardinality.One) return Cardinality.AtLeastOne; + return c2; + } + throw new Error(`Invalid Cardinality ${c1}`); + } + + type _multiplyCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]] + > = Cards extends [infer Card] + ? Card + : Cards extends [infer A, infer B, ...infer Rest] + ? A extends Cardinality + ? B extends Cardinality + ? Rest extends Cardinality[] + ? multiplyCardinalities extends Cardinality + ? _multiplyCardinalitiesVariadic< + [multiplyCardinalities, ...Rest] + > + : never + : never + : never + : never + : never; + + export type multiplyCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]] + > = _multiplyCardinalitiesVariadic extends Cardinality + ? _multiplyCardinalitiesVariadic + : never; + + export function multiplyCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]] + >(cards: Cards): multiplyCardinalitiesVariadic { + if (cards.length === 0) throw new Error("Empty tuple not allowed"); + if (cards.length === 1) return cards[0] as any; + return cards.reduce( + (product, card) => multiplyCardinalities(product, card), + Cardinality.One + ) as any; + } + + // Merging two sets + // Used in set constructor + // Cardinality Empty AtMostOne One Many AtLeastOne + // Empty Empty AtMostOne One Many AtLeastOne + // AtMostOne AtMostOne Many AtLeastOne Many AtLeastOne + // One One AtLeastOne AtLeastOne AtLeastOne AtLeastOne + // Many Many Many AtLeastOne Many AtLeastOne + // AtLeastOne AtLeastOne AtLeastOne AtLeastOne AtLeastOne AtLeastOne + + export type mergeCardinalities< + A extends Cardinality, + B extends Cardinality + > = A extends Cardinality.Empty + ? B + : B extends Cardinality.Empty + ? A + : A extends Cardinality.AtLeastOne + ? Cardinality.AtLeastOne + : B extends Cardinality.AtLeastOne + ? Cardinality.AtLeastOne + : A extends Cardinality.One + ? Cardinality.AtLeastOne + : B extends Cardinality.One + ? Cardinality.AtLeastOne + : Cardinality.Many; + + export function mergeCardinalities< + A extends Cardinality, + B extends Cardinality + >(a: A, b: B): mergeCardinalities { + if (a === Cardinality.Empty) return b as any; + if (b === Cardinality.Empty) return a as any; + if (a === Cardinality.AtLeastOne) return Cardinality.AtLeastOne as any; + if (b === Cardinality.AtLeastOne) return Cardinality.AtLeastOne as any; + if (a === Cardinality.One) return Cardinality.AtLeastOne as any; + if (b === Cardinality.One) return Cardinality.AtLeastOne as any; + return Cardinality.Many as any; + } + + type _mergeCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]] + > = Cards extends [infer Card] + ? Card + : Cards extends [infer A, infer B, ...infer Rest] + ? A extends Cardinality + ? B extends Cardinality + ? Rest extends Cardinality[] + ? mergeCardinalities extends Cardinality + ? _mergeCardinalitiesVariadic<[mergeCardinalities, ...Rest]> + : never + : never + : never + : never + : never; + + export type mergeCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]] + > = _mergeCardinalitiesVariadic extends Cardinality + ? _mergeCardinalitiesVariadic + : never; + export function mergeCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]] + >(cards: Cards): mergeCardinalitiesVariadic { + if (cards.length === 0) throw new Error("Empty tuple not allowed"); + if (cards.length === 1) return cards[0] as any; + const [first, second, ...rest] = cards as unknown as [ + Cardinality, + Cardinality, + ...Cardinality[] + ]; + if (cards.length === 2) return mergeCardinalities(first, second) as any; + return mergeCardinalitiesVariadic([ + mergeCardinalities(first, second), + ...rest, + ]); + } + + // 'or' cardinalities together + // used in the IF ELSE operator, for expr (a IF bool ELSE b) + // result cardinality is 'a' cardinality *or* 'b' cardinality + // Cardinality Empty AtMostOne One Many AtLeastOne + // Empty 0 AtMostOne AtMostOne Many Many + // AtMostOne AtMostOne AtMostOne AtMostOne Many Many + // One AtMostOne AtMostOne One Many AtLeastOne + // Many Many Many Many Many Many + // AtLeastOne Many Many AtLeastOne Many AtLeastOne + + export type orCardinalities< + C1 extends Cardinality, + C2 extends Cardinality + > = C1 extends C2 + ? C1 + : C1 extends Cardinality.Many + ? C1 + : C1 extends Cardinality.AtMostOne + ? C2 extends Cardinality.Many + ? C2 + : C2 extends Cardinality.AtLeastOne + ? Cardinality.Many + : C1 + : C1 extends Cardinality.AtLeastOne + ? C2 extends Cardinality.One + ? Cardinality.AtLeastOne + : Cardinality.Many + : C1 extends Cardinality.Empty + ? C2 extends Cardinality.AtMostOne + ? Cardinality.AtMostOne + : C2 extends Cardinality.One + ? Cardinality.AtMostOne + : Cardinality.Many + : C2 extends Cardinality.Empty + ? Cardinality.AtMostOne + : C2; + + export function orCardinalities( + c1: Cardinality, + c2: Cardinality + ): Cardinality { + if (c1 === c2 || c1 === Cardinality.Many) return c1; + if (c1 === Cardinality.AtLeastOne) { + if (c2 === Cardinality.One) return Cardinality.AtLeastOne; + return Cardinality.Many; + } + if (c1 === Cardinality.AtMostOne) { + if (c2 === Cardinality.Many || c2 === Cardinality.AtLeastOne) { + return Cardinality.Many; + } + return c1; + } + if (c1 === Cardinality.Empty) { + if (c2 === Cardinality.AtMostOne || c2 === Cardinality.One) { + return Cardinality.AtMostOne; + } + return Cardinality.Many; + } + if (c2 === Cardinality.Empty) return Cardinality.AtMostOne; + return c2; + } + + // Empty AtMostOne One Many AtLeastOne + // One One One One AtLeastOne AtLeastOne + // Zero 0 AtMostOne AtMostOne Many Many + + export type overrideLowerBound< + C extends Cardinality, + O extends "One" | "Zero" + > = O extends "One" + ? C extends Cardinality.Many + ? Cardinality.AtLeastOne + : C extends Cardinality.AtLeastOne + ? Cardinality.AtLeastOne + : Cardinality.One + : C extends Cardinality.Empty + ? Cardinality.Empty + : C extends Cardinality.Many + ? Cardinality.Many + : C extends Cardinality.AtLeastOne + ? Cardinality.Many + : Cardinality.AtMostOne; + + export function overrideLowerBound< + C extends Cardinality, + O extends "One" | "Zero" + >(card: C, override: O): overrideLowerBound { + if (override === "One") { + if (card === Cardinality.Many || card === Cardinality.AtLeastOne) { + return Cardinality.AtLeastOne as any; + } else { + return Cardinality.One as any; + } + } else { + if (card === Cardinality.Many || card === Cardinality.AtLeastOne) { + return Cardinality.Many as any; + } else if (card === Cardinality.Empty) { + return Cardinality.Empty as any; + } else { + return Cardinality.AtMostOne as any; + } + } + } + + // Empty AtMostOne One Many AtLeastOne + // One AtMostOne AtMostOne One AtMostOne One + // Many Many Many AtLeastOne Many AtLeastOne + + export type overrideUpperBound< + C extends Cardinality, + O extends "One" | "Many" + > = O extends "One" + ? C extends Cardinality.Many + ? Cardinality.AtMostOne + : C extends Cardinality.AtLeastOne + ? Cardinality.One + : C extends Cardinality.Empty + ? Cardinality.AtMostOne + : C + : C extends Cardinality.One + ? Cardinality.AtLeastOne + : C extends Cardinality.AtMostOne + ? Cardinality.Many + : C extends Cardinality.Empty + ? Cardinality.Many + : C; + + export function overrideUpperBound< + C extends Cardinality, + O extends "One" | "Many" + >(card: C, override: O): overrideUpperBound { + if (override === "One") { + if (card === Cardinality.One || card === Cardinality.AtLeastOne) { + return Cardinality.One as any; + } else { + return Cardinality.AtMostOne as any; + } + } else { + if (card === Cardinality.One || card === Cardinality.AtLeastOne) { + return Cardinality.AtLeastOne as any; + } else { + return Cardinality.Many as any; + } + } + } + + export type paramCardinality

= [P] extends [TypeSet] + ? // default to one + // fixes multiplyCardinalities bug for func with optional args + [Cardinality] extends [P["__cardinality__"]] + ? Cardinality.One + : P["__cardinality__"] + : Cardinality.One; + + export type optionalParamCardinality

= overrideLowerBound< + paramCardinality

, + "One" + >; + + type _paramArrayCardinality = { + [K in keyof T]: T[K] extends TypeSet + ? T[K]["__cardinality__"] + : Cardinality.One; + }; + + export type paramArrayCardinality = + multiplyCardinalitiesVariadic<_paramArrayCardinality>; + + export type assignable = C extends Cardinality.Empty + ? Cardinality.Empty + : C extends Cardinality.One + ? Cardinality.One + : C extends Cardinality.AtMostOne + ? Cardinality.One | Cardinality.AtMostOne | Cardinality.Empty + : C extends Cardinality.AtLeastOne + ? Cardinality.One | Cardinality.AtLeastOne | Cardinality.Many + : C extends Cardinality.Many + ? Cardinality + : never; +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/cast.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/cast.ts new file mode 100644 index 000000000..ddb4440e4 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/cast.ts @@ -0,0 +1,56 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { ExpressionKind, Cardinality } from "edgedb/dist/reflection/index"; +import type { + Expression, + BaseType, + TypeSet, + ObjectTypeExpression, +} from "./typesystem"; +import { $expressionify } from "./path"; +import type { orScalarLiteral } from "./castMaps"; +import { literalToTypeSet } from "./castMaps"; + +export function cast( + target: Target, + arg: null +): $expr_Cast< + Target extends BaseType + ? Target + : Target extends ObjectTypeExpression + ? Target["__element__"] + : never, + Cardinality.Empty +>; +export function cast( + target: Target, + expr: orScalarLiteral +): $expr_Cast< + Target, + Cardinality extends Expr["__cardinality__"] + ? Cardinality.One + : Expr["__cardinality__"] +>; +export function cast(target: BaseType, expr: any) { + const cleanedExpr = expr === null ? null : literalToTypeSet(expr); + return $expressionify({ + __element__: (target as any).__cardinality__ + ? (target as any).__element__ + : target, + __cardinality__: + cleanedExpr === null ? Cardinality.Empty : cleanedExpr.__cardinality__, + __expr__: cleanedExpr, + __kind__: ExpressionKind.Cast, + }) as any; +} + +export type $expr_Cast< + Target extends BaseType = BaseType, + Card extends Cardinality = Cardinality +> = Expression<{ + __element__: Target; + __cardinality__: Card; + __kind__: ExpressionKind.Cast; + __expr__: TypeSet | null; +}>; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/castMaps.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/castMaps.ts new file mode 100644 index 000000000..2f44f55d5 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/castMaps.ts @@ -0,0 +1,740 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as edgedb from "edgedb"; +import type * as $ from "./reflection"; +import * as literal from "./literal"; +import type * as _std from "./modules/std"; +import type * as _sys from "./modules/sys"; +import type * as _schema from "./modules/schema"; +import type * as _cfg from "./modules/cfg"; +import type * as _cal from "./modules/cal"; +export type scalarAssignableBy = + T extends _std.$number ? _std.$number : + T extends _sys.$VersionStage ? _sys.$VersionStage : + T extends _sys.$TransactionIsolation ? _sys.$TransactionIsolation : + T extends _std.$uuid ? _std.$uuid : + T extends _std.$str ? _std.$str : + T extends _std.$json ? _std.$json : + T extends _std.$int64 ? _std.$int64 : + T extends _std.$int32 ? _std.$int32 : + T extends _std.$int16 ? _std.$int16 : + T extends _std.$float64 ? _std.$float64 : + T extends _std.$float32 ? _std.$float32 : + T extends _std.$duration ? _std.$duration : + T extends _std.$decimal ? _std.$decimalλIAssignableBy : + T extends _std.$datetime ? _std.$datetime : + T extends _std.$bytes ? _std.$bytes : + T extends _std.$bool ? _std.$bool : + T extends _std.$bigint ? _std.$bigint : + T extends _std.$JsonEmpty ? _std.$JsonEmpty : + T extends _schema.$Volatility ? _schema.$Volatility : + T extends _schema.$TypeModifier ? _schema.$TypeModifier : + T extends _schema.$TriggerTiming ? _schema.$TriggerTiming : + T extends _schema.$TriggerScope ? _schema.$TriggerScope : + T extends _schema.$TriggerKind ? _schema.$TriggerKind : + T extends _schema.$TargetDeleteAction ? _schema.$TargetDeleteAction : + T extends _schema.$SourceDeleteAction ? _schema.$SourceDeleteAction : + T extends _schema.$RewriteKind ? _schema.$RewriteKind : + T extends _schema.$ParameterKind ? _schema.$ParameterKind : + T extends _schema.$OperatorKind ? _schema.$OperatorKind : + T extends _schema.$MigrationGeneratedBy ? _schema.$MigrationGeneratedBy : + T extends _schema.$Cardinality ? _schema.$Cardinality : + T extends _schema.$AccessPolicyAction ? _schema.$AccessPolicyAction : + T extends _schema.$AccessKind ? _schema.$AccessKind : + T extends _cfg.$memory ? _cfg.$memory : + T extends _cfg.$ConnectionTransport ? _cfg.$ConnectionTransport : + T extends _cfg.$AllowBareDDL ? _cfg.$AllowBareDDL : + T extends _cal.$relative_duration ? _cal.$relative_durationλIAssignableBy : + T extends _cal.$local_time ? _cal.$local_time : + T extends _cal.$local_datetime ? _cal.$local_datetimeλIAssignableBy : + T extends _cal.$local_date ? _cal.$local_date : + T extends _cal.$date_duration ? _cal.$date_duration : + never + +export type scalarCastableFrom = + T extends _std.$number ? _std.$number : + T extends _sys.$VersionStage ? _sys.$VersionStage : + T extends _sys.$TransactionIsolation ? _sys.$TransactionIsolation : + T extends _std.$uuid ? _std.$uuid : + T extends _std.$str ? _std.$str : + T extends _std.$json ? _std.$json : + T extends _std.$int64 ? _std.$int64 : + T extends _std.$int32 ? _std.$int32 : + T extends _std.$int16 ? _std.$int16 : + T extends _std.$float64 ? _std.$float64 : + T extends _std.$float32 ? _std.$float32 : + T extends _std.$duration ? _std.$duration : + T extends _std.$decimal ? _std.$decimalλICastableTo : + T extends _std.$datetime ? _std.$datetime : + T extends _std.$bytes ? _std.$bytes : + T extends _std.$bool ? _std.$bool : + T extends _std.$bigint ? _std.$bigint : + T extends _std.$JsonEmpty ? _std.$JsonEmpty : + T extends _schema.$Volatility ? _schema.$Volatility : + T extends _schema.$TypeModifier ? _schema.$TypeModifier : + T extends _schema.$TriggerTiming ? _schema.$TriggerTiming : + T extends _schema.$TriggerScope ? _schema.$TriggerScope : + T extends _schema.$TriggerKind ? _schema.$TriggerKind : + T extends _schema.$TargetDeleteAction ? _schema.$TargetDeleteAction : + T extends _schema.$SourceDeleteAction ? _schema.$SourceDeleteAction : + T extends _schema.$RewriteKind ? _schema.$RewriteKind : + T extends _schema.$ParameterKind ? _schema.$ParameterKind : + T extends _schema.$OperatorKind ? _schema.$OperatorKind : + T extends _schema.$MigrationGeneratedBy ? _schema.$MigrationGeneratedBy : + T extends _schema.$Cardinality ? _schema.$Cardinality : + T extends _schema.$AccessPolicyAction ? _schema.$AccessPolicyAction : + T extends _schema.$AccessKind ? _schema.$AccessKind : + T extends _cfg.$memory ? _cfg.$memory : + T extends _cfg.$ConnectionTransport ? _cfg.$ConnectionTransport : + T extends _cfg.$AllowBareDDL ? _cfg.$AllowBareDDL : + T extends _cal.$relative_duration ? _cal.$relative_durationλICastableTo : + T extends _cal.$local_time ? _cal.$local_time : + T extends _cal.$local_datetime ? _cal.$local_datetimeλICastableTo : + T extends _cal.$local_date ? _cal.$local_date : + T extends _cal.$date_duration ? _cal.$date_duration : + never + +type getSharedParentScalar = + A extends _std.$number ? + B extends _std.$number ? + B + : + never + : + A extends _sys.$VersionStage ? + B extends _sys.$VersionStage ? + B + : + never + : + A extends _sys.$TransactionIsolation ? + B extends _sys.$TransactionIsolation ? + B + : + never + : + A extends _std.$uuid ? + B extends _std.$uuid ? + B + : + never + : + A extends _std.$str ? + B extends _std.$str ? + B + : + never + : + A extends _std.$json ? + B extends _std.$json ? + B + : + never + : + A extends _std.$int64 ? + B extends _std.$int64 ? + B + : + never + : + A extends _std.$int32 ? + B extends _std.$int32 ? + B + : + never + : + A extends _std.$int16 ? + B extends _std.$int16 ? + B + : + never + : + A extends _std.$float64 ? + B extends _std.$float64 ? + B + : + never + : + A extends _std.$float32 ? + B extends _std.$float32 ? + B + : + never + : + A extends _std.$duration ? + B extends _std.$duration ? + B + : + never + : + A extends _std.$decimal ? + B extends _std.$decimal ? + B + : + B extends _std.$bigint ? + A + : + never + : + A extends _std.$datetime ? + B extends _std.$datetime ? + B + : + never + : + A extends _std.$bytes ? + B extends _std.$bytes ? + B + : + never + : + A extends _std.$bool ? + B extends _std.$bool ? + B + : + never + : + A extends _std.$bigint ? + B extends _std.$decimal ? + B + : + B extends _std.$bigint ? + B + : + never + : + A extends _std.$JsonEmpty ? + B extends _std.$JsonEmpty ? + B + : + never + : + A extends _schema.$Volatility ? + B extends _schema.$Volatility ? + B + : + never + : + A extends _schema.$TypeModifier ? + B extends _schema.$TypeModifier ? + B + : + never + : + A extends _schema.$TriggerTiming ? + B extends _schema.$TriggerTiming ? + B + : + never + : + A extends _schema.$TriggerScope ? + B extends _schema.$TriggerScope ? + B + : + never + : + A extends _schema.$TriggerKind ? + B extends _schema.$TriggerKind ? + B + : + never + : + A extends _schema.$TargetDeleteAction ? + B extends _schema.$TargetDeleteAction ? + B + : + never + : + A extends _schema.$SourceDeleteAction ? + B extends _schema.$SourceDeleteAction ? + B + : + never + : + A extends _schema.$RewriteKind ? + B extends _schema.$RewriteKind ? + B + : + never + : + A extends _schema.$ParameterKind ? + B extends _schema.$ParameterKind ? + B + : + never + : + A extends _schema.$OperatorKind ? + B extends _schema.$OperatorKind ? + B + : + never + : + A extends _schema.$MigrationGeneratedBy ? + B extends _schema.$MigrationGeneratedBy ? + B + : + never + : + A extends _schema.$Cardinality ? + B extends _schema.$Cardinality ? + B + : + never + : + A extends _schema.$AccessPolicyAction ? + B extends _schema.$AccessPolicyAction ? + B + : + never + : + A extends _schema.$AccessKind ? + B extends _schema.$AccessKind ? + B + : + never + : + A extends _cfg.$memory ? + B extends _cfg.$memory ? + B + : + never + : + A extends _cfg.$ConnectionTransport ? + B extends _cfg.$ConnectionTransport ? + B + : + never + : + A extends _cfg.$AllowBareDDL ? + B extends _cfg.$AllowBareDDL ? + B + : + never + : + A extends _cal.$relative_duration ? + B extends _cal.$relative_duration ? + B + : + B extends _cal.$date_duration ? + A + : + never + : + A extends _cal.$local_time ? + B extends _cal.$local_time ? + B + : + never + : + A extends _cal.$local_datetime ? + B extends _cal.$local_datetime ? + B + : + B extends _cal.$local_date ? + A + : + never + : + A extends _cal.$local_date ? + B extends _cal.$local_datetime ? + B + : + B extends _cal.$local_date ? + B + : + never + : + A extends _cal.$date_duration ? + B extends _cal.$relative_duration ? + B + : + B extends _cal.$date_duration ? + B + : + never + : +never + +function getSharedParentScalar(a: A, b: B): A | B { + a = (a as any).__casttype__ || a; + b = (b as any).__casttype__ || b; + if (a.__name__ === "std::number") { + if(b.__name__ === "std::number") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "sys::VersionStage") { + if(b.__name__ === "sys::VersionStage") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "sys::TransactionIsolation") { + if(b.__name__ === "sys::TransactionIsolation") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::uuid") { + if(b.__name__ === "std::uuid") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::str") { + if(b.__name__ === "std::str") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::json") { + if(b.__name__ === "std::json") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::int64") { + if(b.__name__ === "std::int64") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::int32") { + if(b.__name__ === "std::int32") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::int16") { + if(b.__name__ === "std::int16") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::float64") { + if(b.__name__ === "std::float64") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::float32") { + if(b.__name__ === "std::float32") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::duration") { + if(b.__name__ === "std::duration") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::decimal") { + if(b.__name__ === "std::decimal") { + return b; + } + if(b.__name__ === "std::bigint") { + return a; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::datetime") { + if(b.__name__ === "std::datetime") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::bytes") { + if(b.__name__ === "std::bytes") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::bool") { + if(b.__name__ === "std::bool") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::bigint") { + if(b.__name__ === "std::decimal") { + return b; + } + if(b.__name__ === "std::bigint") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::JsonEmpty") { + if(b.__name__ === "std::JsonEmpty") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::Volatility") { + if(b.__name__ === "schema::Volatility") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TypeModifier") { + if(b.__name__ === "schema::TypeModifier") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TriggerTiming") { + if(b.__name__ === "schema::TriggerTiming") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TriggerScope") { + if(b.__name__ === "schema::TriggerScope") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TriggerKind") { + if(b.__name__ === "schema::TriggerKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TargetDeleteAction") { + if(b.__name__ === "schema::TargetDeleteAction") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::SourceDeleteAction") { + if(b.__name__ === "schema::SourceDeleteAction") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::RewriteKind") { + if(b.__name__ === "schema::RewriteKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::ParameterKind") { + if(b.__name__ === "schema::ParameterKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::OperatorKind") { + if(b.__name__ === "schema::OperatorKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::MigrationGeneratedBy") { + if(b.__name__ === "schema::MigrationGeneratedBy") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::Cardinality") { + if(b.__name__ === "schema::Cardinality") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::AccessPolicyAction") { + if(b.__name__ === "schema::AccessPolicyAction") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::AccessKind") { + if(b.__name__ === "schema::AccessKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::memory") { + if(b.__name__ === "cfg::memory") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::ConnectionTransport") { + if(b.__name__ === "cfg::ConnectionTransport") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::AllowBareDDL") { + if(b.__name__ === "cfg::AllowBareDDL") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cal::relative_duration") { + if(b.__name__ === "cal::relative_duration") { + return b; + } + if(b.__name__ === "cal::date_duration") { + return a; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cal::local_time") { + if(b.__name__ === "cal::local_time") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cal::local_datetime") { + if(b.__name__ === "cal::local_datetime") { + return b; + } + if(b.__name__ === "cal::local_date") { + return a; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cal::local_date") { + if(b.__name__ === "cal::local_datetime") { + return b; + } + if(b.__name__ === "cal::local_date") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cal::date_duration") { + if(b.__name__ === "cal::relative_duration") { + return b; + } + if(b.__name__ === "cal::date_duration") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); +} + +const implicitCastMap = new Map>([ + ["cal::date_duration", new Set(["cal::relative_duration"])], + ["cal::local_date", new Set(["cal::local_datetime"])], + ["std::bigint", new Set(["std::decimal"])], +]); +function isImplicitlyCastableTo(from: string, to: string): boolean { + const _a = implicitCastMap.get(from), + _b = _a != null ? _a.has(to) : null; + return _b != null ? _b : false; +}; + +export type scalarLiterals = + | number + | string + | boolean + | bigint + | Uint8Array + | Date + | edgedb.Duration + | edgedb.LocalDateTime + | edgedb.LocalDate + | edgedb.LocalTime + | edgedb.RelativeDuration + | edgedb.DateDuration + | edgedb.ConfigMemory + | edgedb.Range; + +type getTsType = T extends $.ScalarType + ? T extends _std.$decimal | _std.$json | _std.$uuid + ? never + : T["__tstype__"] + : T extends $.RangeType + ? edgedb.Range + : never; +export type orScalarLiteral = + | T + | ($.BaseTypeSet extends T ? scalarLiterals : $.Cardinality extends T["__cardinality__"] ? getTsType : $.computeTsTypeCard< getTsType, T["__cardinality__"] >); +export type scalarWithConstType< + T extends $.ScalarType, + TsConstType +> = $.ScalarType< + T["__name__"], + T["__tstype__"], + TsConstType +>; +export type literalToScalarType = + T extends number ? scalarWithConstType<_std.$number, T> : + T extends string ? scalarWithConstType<_std.$str, T> : + T extends boolean ? scalarWithConstType<_std.$bool, T> : + T extends bigint ? scalarWithConstType<_std.$bigint, T> : + T extends Uint8Array ? scalarWithConstType<_std.$bytes, T> : + T extends Date ? scalarWithConstType<_std.$datetime, T> : + T extends edgedb.Duration ? scalarWithConstType<_std.$duration, T> : + T extends edgedb.LocalDateTime ? scalarWithConstType<_cal.$local_datetime, T> : + T extends edgedb.LocalDate ? scalarWithConstType<_cal.$local_date, T> : + T extends edgedb.LocalTime ? scalarWithConstType<_cal.$local_time, T> : + T extends edgedb.RelativeDuration ? scalarWithConstType<_cal.$relative_duration, T> : + T extends edgedb.DateDuration ? scalarWithConstType<_cal.$date_duration, T> : + T extends edgedb.ConfigMemory ? scalarWithConstType<_cfg.$memory, T> : + T extends edgedb.Range ? $.RangeType> : + $.BaseType; + +type literalToTypeSet = T extends $.TypeSet + ? T + : $.$expr_Literal>; + +export type mapLiteralToTypeSet = { + [k in keyof T]: literalToTypeSet; +}; + +function literalToTypeSet(type: any): $.TypeSet { + if (type && type.__element__) { + return type; + } + if (typeof type === "number") { + return literal.$getType("00000000-0000-0000-0000-0000000001ff")(type); + } + if (typeof type === "string") { + return literal.$getType("00000000-0000-0000-0000-000000000101")(type); + } + if (typeof type === "boolean") { + return literal.$getType("00000000-0000-0000-0000-000000000109")(type); + } + if (typeof type === "bigint") { + return literal.$getType("00000000-0000-0000-0000-000000000110")(type); + } + if (type instanceof Uint8Array) { + return literal.$getType("00000000-0000-0000-0000-000000000102")(type); + } + if (type instanceof Date) { + return literal.$getType("00000000-0000-0000-0000-00000000010a")(type); + } + if (type instanceof edgedb.Duration) { + return literal.$getType("00000000-0000-0000-0000-00000000010e")(type); + } + if (type instanceof edgedb.LocalDateTime) { + return literal.$getType("00000000-0000-0000-0000-00000000010b")(type); + } + if (type instanceof edgedb.LocalDate) { + return literal.$getType("00000000-0000-0000-0000-00000000010c")(type); + } + if (type instanceof edgedb.LocalTime) { + return literal.$getType("00000000-0000-0000-0000-00000000010d")(type); + } + if (type instanceof edgedb.RelativeDuration) { + return literal.$getType("00000000-0000-0000-0000-000000000111")(type); + } + if (type instanceof edgedb.DateDuration) { + return literal.$getType("00000000-0000-0000-0000-000000000112")(type); + } + if (type instanceof edgedb.ConfigMemory) { + return literal.$getType("00000000-0000-0000-0000-000000000130")(type); + } + throw new Error(`Cannot convert literal '${type}' into scalar type`); +} + + +export { getSharedParentScalar, isImplicitlyCastableTo, literalToTypeSet }; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/casting.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/casting.ts new file mode 100644 index 000000000..5d92f89e6 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/casting.ts @@ -0,0 +1,164 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { Cardinality } from "edgedb/dist/reflection/index"; +import type { + ArrayType, + BaseType, + BaseTypeTuple, + BaseTypeToTsType, + EnumType, + LinkDesc, + NamedTupleType, + ObjectType, + ObjectTypeSet, + PrimitiveTypeSet, + PropertyDesc, + ScalarType, + TupleType, + TypeSet, + RangeType, +} from "./typesystem"; +import type { cardutil } from "./cardinality"; + +import type { scalarCastableFrom, scalarAssignableBy } from "./castMaps"; + +export type anonymizeObject = ObjectType< + string, + T["__pointers__"], + any +>; + +//////////////// +// ASSIGNABLE +//////////////// + +type assignableTuple = { + [k in keyof Items]: Items[k] extends BaseType + ? assignableBy + : never; +} extends infer NewItems + ? NewItems extends BaseTypeTuple + ? NewItems + : never + : never; + +export type assignableBy = T extends ScalarType + ? scalarAssignableBy + : T extends ObjectType + ? anonymizeObject + : T extends EnumType + ? T + : T extends ArrayType + ? ArrayType> + : T extends TupleType + ? TupleType> + : T extends NamedTupleType + ? NamedTupleType<{ + [k in keyof T["__shape__"]]: assignableBy; + }> + : T extends RangeType + ? RangeType< + scalarAssignableBy extends ScalarType + ? scalarAssignableBy + : never + > + : never; + +export type pointerToAssignmentExpression< + Pointer extends PropertyDesc | LinkDesc, + IsSetModifier extends boolean = false +> = setToAssignmentExpression< + TypeSet, + IsSetModifier +>; + +export type setToAssignmentExpression< + Set extends TypeSet, + IsSetModifier extends boolean +> = [Set] extends [PrimitiveTypeSet] + ? + | TypeSet< + assignableBy, + cardutil.assignable< + // Set["__cardinality__"] + cardutil.overrideLowerBound + > + > + | getAssignmentLiteral + : [Set] extends [ObjectTypeSet] + ? TypeSet< + ObjectType< + // anonymize the object type + string, + Set["__element__"]["__pointers__"] + >, + cardutil.assignable< + // Allow expressions with AtMostOne or Many cardinality in + // insert/update shape even when link is required since EdgeDB will + // assert cardinality at runtime + cardutil.overrideLowerBound + > + > + : never; + +type getAssignmentLiteral< + Set extends PrimitiveTypeSet, + IsSetModifier extends boolean +> = BaseTypeToTsType extends infer TsType + ? + | TsType + | (Set["__cardinality__"] extends Cardinality.Many + ? TsType[] + : Set["__cardinality__"] extends Cardinality.AtLeastOne + ? IsSetModifier extends true + ? TsType[] + : [TsType, ...TsType[]] + : never) + : never; + +//////////////// +// CASTABLES +//////////////// + +type castableTuple = { + [k in keyof Items]: Items[k] extends BaseType + ? castableFrom + : never; +} extends infer NewItems + ? NewItems extends BaseTypeTuple + ? NewItems + : never + : never; + +export type castableFrom = T extends ScalarType + ? scalarCastableFrom + : T extends ObjectType + ? anonymizeObject + : T extends ArrayType + ? ArrayType> + : T extends TupleType + ? TupleType> + : T extends NamedTupleType + ? NamedTupleType<{ + [k in keyof T["__shape__"]]: castableFrom; + }> + : never; + +export type pointerToCastableExpression< + Pointer extends PropertyDesc | LinkDesc +> = [Pointer] extends [PropertyDesc] + ? { + __element__: castableFrom; + __cardinality__: cardutil.assignable; + } + : [Pointer] extends [LinkDesc] + ? TypeSet< + ObjectType< + // anonymize the object type + string, + Pointer["target"]["__pointers__"] + >, + cardutil.assignable + > + : never; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/collections.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/collections.ts new file mode 100644 index 000000000..2d21b187d --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/collections.ts @@ -0,0 +1,366 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { + Cardinality, + ExpressionKind, + TypeKind, + typeutil, +} from "edgedb/dist/reflection/index"; +import { cardutil } from "./cardinality"; +import type { + $expr_Array, + $expr_NamedTuple, + $expr_Tuple, + $expr_TuplePath, + ArrayType, + BaseType, + getPrimitiveBaseType, + NamedTupleLiteralShape, + NamedTupleShape, + NamedTupleType, + NonArrayType, + ObjectTypeExpression, + ObjectTypePointers, + PropertyDesc, + TupleType, + TypeSet, +} from "./typesystem"; + +import { $expressionify, ExpressionRoot } from "./path"; +import type { getCardsFromExprs } from "./set"; +import { + literalToScalarType, + literalToTypeSet, + mapLiteralToTypeSet, + orScalarLiteral, + scalarLiterals, +} from "./castMaps"; + +const indexSliceRegx = /^(-?\d+)(?:(:)(-?\d+)?)?|:(-?\d+)$/; + +const arrayLikeProxyHandlers: ProxyHandler = { + get(target: ExpressionRoot, prop: string | symbol, proxy: any) { + const match = typeof prop === "string" ? prop.match(indexSliceRegx) : null; + if (match) { + const start = match[1]; + const end = match[3] ?? match[4]; + const isIndex = start && !match[2]; + return $expressionify({ + __kind__: ExpressionKind.Operator, + __element__: + target.__element__.__kind__ === TypeKind.array && isIndex + ? (target.__element__ as ArrayType).__element__ + : target.__element__, + __cardinality__: target.__cardinality__, + __name__: "[]", + __opkind__: "Infix", + __args__: [ + proxy, + isIndex + ? literalToTypeSet(Number(start)) + : [ + start && literalToTypeSet(Number(start)), + end && literalToTypeSet(Number(end)), + ], + ], + }) as any; + } + return (target as any)[prop]; + }, +}; + +function arrayLikeIndex(this: ExpressionRoot, index: any) { + const indexTypeSet = literalToTypeSet(index); + return $expressionify({ + __kind__: ExpressionKind.Operator, + __element__: + this.__element__.__kind__ === TypeKind.array + ? (this.__element__ as ArrayType).__element__ + : this.__element__, + __cardinality__: cardutil.multiplyCardinalities( + this.__cardinality__, + indexTypeSet.__cardinality__ + ), + __name__: "[]", + __opkind__: "Infix", + __args__: [this, indexTypeSet], + }) as any; +} + +function arrayLikeSlice(this: ExpressionRoot, start: any, end: any) { + const startTypeSet = start && literalToTypeSet(start); + const endTypeSet = end && literalToTypeSet(end); + return $expressionify({ + __kind__: ExpressionKind.Operator, + __element__: this.__element__, + __cardinality__: cardutil.multiplyCardinalities( + cardutil.multiplyCardinalities( + this.__cardinality__, + startTypeSet?.__cardinality__ ?? Cardinality.One + ), + endTypeSet?.__cardinality__ ?? Cardinality.One + ), + __name__: "[]", + __opkind__: "Infix", + __args__: [this, [startTypeSet, endTypeSet]], + }) as any; +} + +export function $arrayLikeIndexify(_expr: ExpressionRoot) { + if ( + _expr.__element__.__kind__ === TypeKind.array || + (_expr.__element__.__kind__ === TypeKind.scalar && + (_expr.__element__.__name__ === "std::str" || + _expr.__element__.__name__ === "std::bytes")) + ) { + const expr = new Proxy(_expr, arrayLikeProxyHandlers) as any; + + expr.index = arrayLikeIndex.bind(expr); + expr.slice = arrayLikeSlice.bind(expr); + + return expr; + } + + return _expr; +} + +// ARRAY +export function array( + element: Element +): ArrayType; +export function array< + Expr extends TypeSet | scalarLiterals, + Exprs extends orScalarLiteral< + TypeSet< + Expr extends TypeSet + ? getPrimitiveBaseType + : getPrimitiveBaseType> + > + >[] +>( + arg: [Expr, ...Exprs] +): $expr_Array< + ArrayType< + Expr extends TypeSet + ? getPrimitiveBaseType + : getPrimitiveBaseType> + >, + cardutil.multiplyCardinalitiesVariadic< + getCardsFromExprs> + > +>; +export function array(arg: any) { + if (Array.isArray(arg)) { + const items = arg.map((a) => literalToTypeSet(a)); + return $expressionify({ + __kind__: ExpressionKind.Array, + __cardinality__: cardutil.multiplyCardinalitiesVariadic( + items.map((item) => item.__cardinality__) as any + ), + __element__: { + __kind__: TypeKind.array, + __name__: `array<${items[0]!.__element__.__name__}>`, + __element__: items[0]!.__element__, + } as any, + __items__: items, + }); + } + if (arg.__kind__) { + return { + __kind__: TypeKind.array, + __name__: `array<${arg.__name__}>`, + __element__: arg, + } as any; + } + + throw new Error("Invalid array input."); +} + +// TUPLE + +const tupleProxyHandlers: ProxyHandler = { + get(target: ExpressionRoot, prop: string | symbol, proxy: any) { + const type = target.__element__; + const items = + type.__kind__ === TypeKind.tuple + ? (type as TupleType).__items__ + : type.__kind__ === TypeKind.namedtuple + ? (type as NamedTupleType).__shape__ + : null; + return items?.hasOwnProperty(prop) + ? tuplePath(proxy, (items as any)[prop], prop as any) + : (target as any)[prop]; + }, +}; + +export function $tuplePathify(expr: ExpressionRoot) { + if ( + expr.__element__.__kind__ !== TypeKind.tuple && + expr.__element__.__kind__ !== TypeKind.namedtuple + ) { + return expr; + } + + return new Proxy(expr, tupleProxyHandlers); +} + +function tuplePath( + parent: $expr_Tuple | $expr_TuplePath, + itemType: BaseType, + index: string +): $expr_TuplePath { + return $expressionify({ + __kind__: ExpressionKind.TuplePath, + __element__: itemType, + __cardinality__: parent.__cardinality__, + __parent__: parent, + __index__: index, + }) as any; +} + +function makeTupleType(name: string, items: BaseType[]) { + return { + __kind__: TypeKind.tuple, + __name__: name, + __items__: items, + } as any; +} + +const typeKinds = new Set(Object.values(TypeKind)); + +export function tuple>( + items: Items +): TupleType; +export function tuple< + Item extends TypeSet | scalarLiterals, + Items extends typeutil.tupleOf +>( + items: Items +): $expr_Tuple< + Items extends typeutil.tupleOf ? mapLiteralToTypeSet : never +>; +export function tuple( + shape: Shape +): NamedTupleType; +export function tuple( + shape: Shape +): $expr_NamedTuple>; +export function tuple(input: any) { + if (Array.isArray(input)) { + // is tuple + if (input.every((item) => typeKinds.has(item.__kind__))) { + const typeItems = input as BaseType[]; + const typeName = `tuple<${typeItems + .map((item) => item.__name__) + .join(", ")}>`; + return makeTupleType(typeName, typeItems); + } + + const items = input.map((item) => literalToTypeSet(item)); + const name = `tuple<${items + .map((item) => item.__element__.__name__) + .join(", ")}>`; + return $expressionify({ + __kind__: ExpressionKind.Tuple, + __element__: makeTupleType( + name, + items.map((item) => item.__element__) + ), + __cardinality__: cardutil.multiplyCardinalitiesVariadic( + items.map((i) => i.__cardinality__) as any + ), + __items__: items, + }) as any; + } else { + // is named tuple + if (Object.values(input).every((el: any) => typeKinds.has(el.__kind__))) { + const typeName = `tuple<${Object.entries(input) + .map(([key, val]: [string, any]) => `${key}: ${val.__name__}`) + .join(", ")}>`; + return { + __kind__: TypeKind.namedtuple, + __name__: typeName, + __shape__: input, + } as any; + } + + const exprShape: NamedTupleLiteralShape = {}; + const typeShape: NamedTupleShape = {}; + for (const [key, val] of Object.entries(input)) { + const typeSet = literalToTypeSet(val); + exprShape[key] = typeSet; + typeShape[key] = typeSet.__element__; + } + const name = `tuple<${Object.entries(exprShape) + .map(([key, val]) => `${key}: ${val.__element__.__name__}`) + .join(", ")}>`; + return $expressionify({ + __kind__: ExpressionKind.NamedTuple, + __element__: { + __kind__: TypeKind.namedtuple, + __name__: name, + __shape__: typeShape, + } as any, + __cardinality__: cardutil.multiplyCardinalitiesVariadic( + Object.values(exprShape).map((val) => val.__cardinality__) as any + ), + __shape__: exprShape, + }) as any; + } +} + +type PropertyNamesFromPointers = { + [k in keyof Pointers as Pointers[k] extends PropertyDesc + ? Pointers[k]["computed"] extends true + ? never + : k + : never]: Pointers[k]; +}; + +export function $objectTypeToTupleType( + objectType: Expr +): PropertyNamesFromPointers< + Expr["__element__"]["__pointers__"] +> extends infer Pointers + ? Pointers extends ObjectTypePointers + ? NamedTupleType<{ + [k in keyof Pointers as k extends "id" + ? never + : k]: Pointers[k]["target"]; + }> + : never + : never; +export function $objectTypeToTupleType< + Expr extends ObjectTypeExpression, + Fields extends keyof PropertyNamesFromPointers< + Expr["__element__"]["__pointers__"] + > +>( + objectType: Expr, + includeFields: Fields[] +): NamedTupleType<{ + [k in Fields]: Expr["__element__"]["__pointers__"][k] extends PropertyDesc + ? Expr["__element__"]["__pointers__"][k]["target"] + : never; +}>; +export function $objectTypeToTupleType(...args: any[]): any { + const [objExpr, fields] = args as [ + ObjectTypeExpression, + string[] | undefined + ]; + const shape = Object.entries(objExpr.__element__.__pointers__).reduce( + (_shape, [key, val]) => { + if ( + fields?.length + ? fields.includes(key) + : key !== "id" && val.__kind__ === "property" && !val.computed + ) { + _shape[key] = val.target; + } + return _shape; + }, + {} as NamedTupleShape + ); + return tuple(shape); +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/config.json b/packages/benchmarks/project-fixture/dbschema/edgeql-js/config.json new file mode 100644 index 000000000..e9125cbbd --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/config.json @@ -0,0 +1,2 @@ +// EdgeDB query builder. To update, run `npx @edgedb/generate edgeql-js` +{"target":"ts"} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/detached.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/detached.ts new file mode 100644 index 000000000..30abddd63 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/detached.ts @@ -0,0 +1,24 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { ExpressionKind } from "edgedb/dist/reflection/index"; +import type { Expression, TypeSet } from "./typesystem"; +import { $expressionify } from "./path"; + +export function detached( + expr: Expr +): $expr_Detached { + return $expressionify({ + __element__: expr.__element__, + __cardinality__: expr.__cardinality__, + __expr__: expr, + __kind__: ExpressionKind.Detached, + }) as any; +} + +export type $expr_Detached = Expression<{ + __element__: Expr["__element__"]; + __cardinality__: Expr["__cardinality__"]; + __kind__: ExpressionKind.Detached; + __expr__: TypeSet; +}>; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/external.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/external.ts new file mode 100644 index 000000000..6936aff37 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/external.ts @@ -0,0 +1,33 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { TypeSet, setToTsType } from "./typesystem"; + +export { literal } from "./literal"; +export {} from "./path"; +export { set } from "./set"; +export { cast } from "./cast"; +export { + ASC, + DESC, + EMPTY_FIRST, + EMPTY_LAST, + is, + delete, + select, +} from "./select"; +export { update } from "./update"; +export { insert } from "./insert"; +export { + array, + tuple, + $objectTypeToTupleType as objectTypeToTupleType, +} from "./collections"; +export {} from "./funcops"; +export { for } from "./for"; +export { alias, with } from "./with"; +export { optional, params } from "./params"; +export { detached } from "./detached"; +export {} from "./toEdgeQL"; + +export type $infer = setToTsType; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/for.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/for.ts new file mode 100644 index 000000000..02665d831 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/for.ts @@ -0,0 +1,60 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { Cardinality, ExpressionKind } from "edgedb/dist/reflection/index"; +import { cardutil } from "./cardinality"; +import type { Expression, BaseType, BaseTypeSet } from "./typesystem"; +import { $expressionify } from "./path"; + +export type $expr_For< + El extends BaseType = BaseType, + Card extends Cardinality = Cardinality + // IterSet extends BaseTypeSet = BaseTypeSet, + // Expr extends BaseTypeSet = BaseTypeSet +> = Expression<{ + __element__: El; + __cardinality__: Card; + __kind__: ExpressionKind.For; + __iterSet__: BaseTypeSet; + __forVar__: $expr_ForVar; + __expr__: BaseTypeSet; +}>; + +export type $expr_ForVar = Expression<{ + __element__: Type; + __cardinality__: Cardinality.One; + __kind__: ExpressionKind.ForVar; +}>; + +function _for( + set: IteratorSet, + expr: (variable: $expr_ForVar) => Expr +): $expr_For< + Expr["__element__"], + cardutil.multiplyCardinalities< + IteratorSet["__cardinality__"], + Expr["__cardinality__"] + > +> { + const forVar = $expressionify({ + __kind__: ExpressionKind.ForVar, + __element__: set.__element__, + __cardinality__: Cardinality.One, + }) as $expr_ForVar; + + const returnExpr = expr(forVar); + + return $expressionify({ + __kind__: ExpressionKind.For, + __element__: returnExpr.__element__, + __cardinality__: cardutil.multiplyCardinalities( + set.__cardinality__, + returnExpr.__cardinality__ + ), + __iterSet__: set, + __expr__: returnExpr, + __forVar__: forVar, + }) as any; +} + +export { _for as for }; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/funcops.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/funcops.ts new file mode 100644 index 000000000..ab874abc2 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/funcops.ts @@ -0,0 +1,461 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { + Cardinality, + introspect, + TypeKind, +} from "edgedb/dist/reflection/index"; +import { cardutil } from "./cardinality"; +import { makeType } from "./hydrate"; +import type { + BaseType, + BaseTypeSet, + ArrayType, + ObjectType, + TypeSet, + RangeType, + Expression, +} from "./typesystem"; +import { cast } from "./cast"; +import { isImplicitlyCastableTo, literalToTypeSet } from "./castMaps"; +import { literal } from "./literal"; + +import type { + ExpressionKind, + OperatorKind, +} from "edgedb/dist/reflection/index"; + +export type $expr_Function< + // Name extends string = string, + // Args extends (BaseTypeSet | undefined)[] = (BaseTypeSet | undefined)[], + // NamedArgs extends {[key: string]: BaseTypeSet} = { + // [key: string]: BaseTypeSet; + // }, + // ReturnType extends BaseTypeSet = BaseTypeSet, + El extends BaseType = BaseType, + Card extends Cardinality = Cardinality +> = Expression<{ + __element__: El; + __cardinality__: Card; + __kind__: ExpressionKind.Function; + __name__: string; + __args__: (BaseTypeSet | undefined)[]; + __namedargs__: { [key: string]: BaseTypeSet }; +}>; + +export type $expr_Operator< + // Name extends string = string, + // OpKind extends OperatorKind = OperatorKind, + // Args extends TypeSet[] = TypeSet[], + // ReturnType extends TypeSet = TypeSet, + El extends BaseType = BaseType, + Card extends Cardinality = Cardinality +> = Expression<{ + __element__: El; + __cardinality__: Card; + __kind__: ExpressionKind.Operator; + __name__: string; + __opkind__: OperatorKind; + __args__: TypeSet[]; +}>; + +interface OverloadFuncArgDef { + typeId: string; + optional?: boolean; + setoftype?: boolean; + variadic?: boolean; +} + +interface OverloadFuncDef { + kind?: string; + args: OverloadFuncArgDef[]; + namedArgs?: { [key: string]: OverloadFuncArgDef }; + returnTypeId: string; + returnTypemod?: "SetOfType" | "OptionalType"; + preservesOptionality?: boolean; +} + +function mapLiteralToTypeSet(literals: any[]): TypeSet[]; +function mapLiteralToTypeSet(literals: { [key: string]: any }): { + [key: string]: TypeSet; +}; +function mapLiteralToTypeSet(literals: any[] | { [key: string]: any }) { + if (Array.isArray(literals)) { + return literals.map((lit) => (lit != null ? literalToTypeSet(lit) : lit)); + } + const obj: { [key: string]: TypeSet } = {}; + for (const key of Object.keys(literals)) { + obj[key] = + literals[key] != null ? literalToTypeSet(literals[key]) : literals[key]; + } + return obj; +} + +export function $resolveOverload( + funcName: string, + args: any[], + typeSpec: introspect.Types, + funcDefs: OverloadFuncDef[] +) { + const positionalArgs: (TypeSet | undefined)[] = []; + let namedArgs: { [key: string]: TypeSet } | undefined; + if (args.length) { + if (args[0] !== undefined) { + try { + positionalArgs.push(literalToTypeSet(args[0])); + } catch { + // first arg is not a expr or literal type, so assume named args object + namedArgs = mapLiteralToTypeSet(args[0] as object); + } + } else { + positionalArgs.push(undefined); + } + positionalArgs.push(...mapLiteralToTypeSet(args.slice(1))); + } + + for (const def of funcDefs) { + const resolvedOverload = _tryOverload( + funcName, + positionalArgs, + namedArgs, + typeSpec, + def + ); + if (resolvedOverload !== null) { + return resolvedOverload; + } + } + + throw new Error( + `No function overload found for ${ + funcName.includes("::") + ? `'e.${funcName.split("::")[1]}()'` + : `operator '${funcName}'` + } with args: ${args.map((arg) => `${arg}`).join(", ")}` + ); +} + +const ANYTYPE_ARG = Symbol(); + +function _tryOverload( + funcName: string, + args: (BaseTypeSet | undefined)[], + namedArgs: { [key: string]: BaseTypeSet } | undefined, + typeSpec: introspect.Types, + funcDef: OverloadFuncDef +): { + kind?: string; + returnType: BaseType; + cardinality: Cardinality; + args: BaseTypeSet[]; + namedArgs: { [key: string]: BaseTypeSet }; +} | null { + if ( + (funcDef.namedArgs === undefined && namedArgs !== undefined) || + (namedArgs === undefined && + funcDef.namedArgs && + Object.values(funcDef.namedArgs).some((arg) => !arg.optional)) + ) { + return null; + } + + const lastParamVariadic = funcDef.args[funcDef.args.length - 1]?.variadic; + if (!lastParamVariadic && args.length > funcDef.args.length) { + return null; + } + + const paramCardinalities: [Cardinality, ...Cardinality[]] = [Cardinality.One]; + + if (namedArgs) { + for (const [key, value] of Object.entries(namedArgs)) { + const argDef = funcDef.namedArgs?.[key]; + if ( + !argDef || + !compareType(typeSpec, argDef.typeId, value.__element__).match + ) { + return null; + } + + paramCardinalities.push( + argDef.setoftype + ? funcDef.preservesOptionality + ? cardutil.overrideUpperBound(value.__cardinality__, "One") + : Cardinality.One + : argDef.optional + ? cardutil.overrideLowerBound(value.__cardinality__, "One") + : value.__cardinality__ + ); + } + } + + let positionalArgs: BaseTypeSet[] = []; + + let returnAnytype: BaseType | undefined; + let needsAnytypeReplacement = false; + + for (let i = 0; i < funcDef.args.length; i++) { + const argDef = funcDef.args[i]!; + const arg = args[i]; + + if (arg === undefined) { + if (!argDef.optional) { + return null; + } + + if (i < args.length) { + // arg is explicitly undefined, inject empty set + const argTypeName = typeSpec.get(argDef.typeId).name; + if ( + argTypeName.includes("anytype") || + argTypeName.includes("std::anypoint") + ) { + if (!returnAnytype) { + positionalArgs.push(ANYTYPE_ARG as any); + needsAnytypeReplacement = true; + } else { + positionalArgs.push(cast(returnAnytype, null)); + } + } else { + const argType = makeType(typeSpec, argDef.typeId, literal); + positionalArgs.push(cast(argType, null)); + } + } + } else { + const { match, anytype } = compareType( + typeSpec, + argDef.typeId, + arg.__element__ + ); + + if (!match) { + return null; + } + if (!returnAnytype && anytype) { + returnAnytype = anytype; + } + + positionalArgs.push( + ...(argDef.variadic ? (args.slice(i) as BaseTypeSet[]) : [arg]) + ); + if (argDef.setoftype) { + paramCardinalities.push( + funcDef.preservesOptionality + ? cardutil.overrideUpperBound(arg.__cardinality__, "One") + : Cardinality.One + ); + } else { + const card = argDef.variadic + ? cardutil.multiplyCardinalitiesVariadic( + (args.slice(i) as BaseTypeSet[]).map( + (el) => el.__cardinality__ + ) as [Cardinality, ...Cardinality[]] + ) + : arg.__cardinality__; + + paramCardinalities.push( + argDef.optional ? cardutil.overrideLowerBound(card, "One") : card + ); + } + } + } + + let cardinality: Cardinality; + if (funcName === "if_else") { + cardinality = cardutil.multiplyCardinalities( + cardutil.orCardinalities( + positionalArgs[0]!.__cardinality__, + positionalArgs[2]!.__cardinality__ + ), + positionalArgs[1]!.__cardinality__ + ); + } else if (funcName === "std::assert_exists") { + cardinality = cardutil.overrideLowerBound( + positionalArgs[0]!.__cardinality__, + "One" + ); + } else if (funcName === "union") { + cardinality = cardutil.mergeCardinalities( + positionalArgs[0]!.__cardinality__, + positionalArgs[1]!.__cardinality__ + ); + } else if (funcName === "??") { + cardinality = cardutil.orCardinalities( + positionalArgs[0]!.__cardinality__, + positionalArgs[1]!.__cardinality__ + ); + } else if (funcName === "distinct") { + cardinality = positionalArgs[0]!.__cardinality__; + } else { + cardinality = + funcDef.returnTypemod === "SetOfType" + ? Cardinality.Many + : cardutil.multiplyCardinalitiesVariadic(paramCardinalities); + + if ( + funcDef.returnTypemod === "OptionalType" && + !funcDef.preservesOptionality + ) { + cardinality = cardutil.overrideLowerBound(cardinality, "Zero"); + } + } + + if (needsAnytypeReplacement) { + if (!returnAnytype) { + throw new Error(`could not resolve anytype for ${funcName}`); + } + positionalArgs = positionalArgs.map((arg) => + (arg as any) === ANYTYPE_ARG ? cast(returnAnytype!, null) : arg + ); + } + + return { + kind: funcDef.kind, + returnType: makeType( + typeSpec, + funcDef.returnTypeId, + literal, + returnAnytype + ), + cardinality, + args: positionalArgs, + namedArgs: namedArgs ?? {}, + }; +} + +const nameRemapping: { [key: string]: string } = { + "std::int16": "std::number", + "std::int32": "std::number", + "std::int64": "std::number", + "std::float32": "std::number", + "std::float64": "std::number", +}; +const descendantCache = new Map(); +function getDescendantNames(typeSpec: introspect.Types, typeId: string) { + if (descendantCache.has(typeId)) { + return descendantCache.get(typeId)!; + } + const descendants: string[] = [ + ...new Set( + [...typeSpec.values()] + .filter( + (type) => + type.kind === "scalar" && type.bases.some(({ id }) => id === typeId) + ) + .flatMap((type) => + type.is_abstract + ? getDescendantNames(typeSpec, type.id) + : [nameRemapping[type.name]!, type.name] + ) + ), + ]; + descendantCache.set(typeId, descendants); + return descendants; +} + +function compareType( + typeSpec: introspect.Types, + typeId: string, + arg: BaseType +): { match: boolean; anytype?: BaseType } { + const type = typeSpec.get(typeId); + + if (type.name === "anytype") { + return { match: true, anytype: arg }; + } + + if (type.name === "std::anypoint") { + const descendants = getDescendantNames(typeSpec, typeId); + if (descendants.includes(arg.__name__)) { + return { match: true, anytype: arg }; + } + } + + if (type.name === "std::anyenum") { + return { match: arg.__kind__ === TypeKind.enum }; + } + + if (type.kind === "scalar") { + arg = (arg as any).__casttype__ ?? arg; + return { + match: + (arg.__kind__ === TypeKind.scalar || arg.__kind__ === TypeKind.enum) && + (arg.__name__ === type.name || + isImplicitlyCastableTo(arg.__name__, type.name)), + }; + } + if (type.kind === "array") { + if (arg.__kind__ === TypeKind.array) { + return compareType( + typeSpec, + type.array_element_id, + (arg as any as ArrayType).__element__ as BaseType + ); + } + } + if (type.kind === "range") { + if (arg.__kind__ === TypeKind.range) { + return compareType( + typeSpec, + type.range_element_id, + (arg as any as RangeType).__element__ as BaseType + ); + } + } + if (type.kind === "object") { + if (arg.__kind__ !== TypeKind.object) return { match: false }; + + const objectArg = arg as ObjectType; + let match = true; + + // shape comparison + for (const ptr of type.pointers) { + if (objectArg.__pointers__[ptr.name]) { + const argPtr = objectArg.__pointers__[ptr.name]!; + const ptrTarget = typeSpec.get(ptr.target_id); + if ( + ptrTarget.name !== argPtr.target.__name__ || + ptr.card !== argPtr.cardinality + ) { + match = false; + } + } + } + + return { + match, + }; + } + if (type.kind === "tuple") { + const items = + arg.__kind__ === TypeKind.tuple + ? (arg as any).__items__ + : arg.__kind__ === TypeKind.namedtuple + ? (arg as any).__shape__ + : null; + if (items) { + const keys = Object.keys(items); + + if (keys.length === type.tuple_elements.length) { + let anytype: BaseType | undefined; + for (let i = 0; i < keys.length; i++) { + if (keys[i] !== type.tuple_elements[i]!.name) { + return { match: false }; + } + const { match: m, anytype: a } = compareType( + typeSpec, + type.tuple_elements[i]!.target_id, + (items as any)[keys[i]!] + ); + if (!m) { + return { match: false }; + } + if (a) anytype = a; + } + return { match: true, anytype }; + } + } + } + + return { match: false }; +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/globals.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/globals.ts new file mode 100644 index 000000000..176aa3c9f --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/globals.ts @@ -0,0 +1,30 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { ExpressionKind, Cardinality } from "edgedb/dist/reflection/index"; +import type { Expression, BaseType } from "./typesystem"; +import { $expressionify } from "./path"; + +export function makeGlobal< + // Name extends string, + Type extends BaseType, + Card extends Cardinality +>(name: string, type: Type, card: Card): $expr_Global { + return $expressionify({ + __name__: name, + __element__: type, + __cardinality__: card, + __kind__: ExpressionKind.Global, + }); +} + +export type $expr_Global< + // Name extends string = string, + Type extends BaseType = BaseType, + Card extends Cardinality = Cardinality +> = Expression<{ + __name__: string; + __element__: Type; + __cardinality__: Card; + __kind__: ExpressionKind.Global; +}>; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/group.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/group.ts new file mode 100644 index 000000000..6b2e32204 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/group.ts @@ -0,0 +1,349 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { + Expression, + ObjectType, + ObjectTypeSet, + TypeSet, + BaseType, + $scopify, + PropertyDesc, + LinkDesc, +} from "./typesystem"; +import { + Cardinality, + ExpressionKind, + TypeKind, +} from "edgedb/dist/reflection/index"; +import { makeType } from "./hydrate"; + +import { $expressionify, $getScopedExpr } from "./path"; +// @ts-ignore +import type { $FreeObjectλShape, $str } from "./modules/std"; +import { spec } from "./__spec__"; +import { literal } from "./literal"; +import { resolveShapeElement } from "./select"; +import type { + normaliseShape, + // normaliseElement, + objectTypeToSelectShape, +} from "./select"; + +type SingletonSet = Expression< + TypeSet +>; +type SimpleGroupElements = { [k: string]: SingletonSet }; +type GroupModifiers = { by: SimpleGroupElements }; +type NestedGroupElements = { + [k: string]: SingletonSet | GroupingSet; +}; + +export type GroupingSet = { + __kind__: "groupingset"; + __settype__: "set" | "tuple" | "rollup" | "cube"; + __elements__: NestedGroupElements; + __exprs__: [string, SingletonSet][]; +}; +export function isGroupingSet(arg: any): arg is GroupingSet { + return arg.__kind__ === "groupingset"; +} + +// result is partial to prevent "X is specified more than once" errors +// the return type is a lie, this function returns a grouping set +// but it pretends to return a SimpleGroupElements +// to make the static computatation of `key` easier +const makeGroupingSet = + (prefix: string) => + (grps: T): { [k in keyof T]?: T[k] } => { + const seenKeys = new Map(); + const unfiltered = Object.entries(grps as NestedGroupElements).flatMap( + ([k, grp]) => + isGroupingSet(grp) + ? grp.__exprs__ + : ([[k, grp]] as [string, SingletonSet][]) + ); + const filtered = unfiltered.filter(([k, expr]) => { + if (!seenKeys.has(k)) { + seenKeys.set(k, expr); + return true; + } + + if (expr !== seenKeys.get(k)) { + throw new Error( + `Cannot override pre-existing expression with key "${k}"` + ); + } + + return false; + }); + + return { + [`${Math.round(1000000 * Math.random())}___`]: { + __kind__: "groupingset", + __settype__: prefix, + __elements__: grps, + __exprs__: filtered, + } as GroupingSet, + } as any; + }; +const set = makeGroupingSet("set"); +const tuple = makeGroupingSet("tuple"); +const rollup = makeGroupingSet("rollup"); +const cube = makeGroupingSet("cube"); + +const setFuncs = { set, tuple, rollup, cube }; + +export type $expr_Group< + Expr extends ObjectTypeSet = ObjectTypeSet, + Mods extends GroupModifiers = GroupModifiers, + Shape extends object = { id: true } +> = Expression<{ + __element__: ObjectType< + "std::FreeObject", + $FreeObjectλShape & { + // adding free shape elements into __pointers__ + // because objectTypeToSelectShape doesn't allow shapes on computeds + // and setToTsType can't handle that currently + grouping: PropertyDesc<$str, Cardinality.Many, false, true, true, false>; + key: LinkDesc< + ObjectType< + "std::FreeObject", + { + // tslint:disable-next-line + [k in keyof Mods["by"]]: Mods["by"][k]["__element__"] extends ObjectType + ? never + : PropertyDesc< + Mods["by"][k]["__element__"], + Cardinality.AtMostOne + >; + } + >, + Cardinality.One, + {}, + false, + true, + true, + false + >; + elements: LinkDesc< + Expr["__element__"], + Cardinality.Many, + {}, + false, + true, + true, + false + >; + }, + { + // grouping: true; + // key: {[k in keyof Mods["by"]]: true}; + // elements: normaliseShape; + grouping: TypeSet<$str, Cardinality.Many>; + key: Expression<{ + __element__: ObjectType< + "std::FreeObject", + $FreeObjectλShape, + { + [k in keyof Mods["by"]]: Expression<{ + __element__: Mods["by"][k]["__element__"]; + __cardinality__: Cardinality.AtMostOne; + }>; + } + >; + __cardinality__: Cardinality.One; + }>; + elements: Expression<{ + __element__: ObjectType< + Expr["__element__"]["__name__"], + Expr["__element__"]["__pointers__"], + // Omit, "by"> + normaliseShape + >; + __cardinality__: Cardinality.Many; + }>; + } + >; + __cardinality__: Cardinality.Many; + // bit of a lie, this is a GroupingSet at runtime + __modifiers__: Mods; + __kind__: ExpressionKind.Group; + __expr__: ObjectTypeSet; + __scope__: ObjectTypeSet; +}>; + +// type modifierKeys = "by"; +type noUndefined = T extends undefined ? never : T; +type groupFunc = < + Expr extends ObjectTypeSet, + // Shape extends GroupModifiers + // Grps extends SimpleGroupElements, + Shape extends { by?: SimpleGroupElements } & objectTypeToSelectShape< + Expr["__element__"] + > + // Mods extends GroupModifiers = {by: Shape["by"]} +>( + expr: Expr, + getter: (arg: $scopify) => Readonly +) => $expr_Group< + Expr, + { by: noUndefined }, + normaliseShape +>; + +const groupFunc: groupFunc = (expr, getter) => { + const { shape, scope, modifiers } = resolveShape(getter, expr); + // const scope = $getScopedExpr(expr as any); + // const rawGroupings = getter(scope); + const groupSet = tuple(modifiers.by); + + // only one key in object returned from makeGroupingSet + const key = Object.keys(groupSet)[0]!; + const grouping = groupSet[key] as any as GroupingSet; + const keyShape: any = {}; + const keyPointers: any = {}; + const keyShapeElement: any = {}; + + for (const [k, e] of grouping.__exprs__) { + keyShape[k] = $expressionify({ + __element__: e.__element__, + __cardinality__: Cardinality.AtMostOne, + } as any); + keyPointers[k] = { + __kind__: "property", + target: e.__element__, + cardinality: Cardinality.AtMostOne, + exclusive: false, + computed: false, + readonly: false, + hasDefault: false, + } as PropertyDesc; + keyShapeElement[k] = true; + } + + const $FreeObject = makeType( + spec, + [...spec.values()].find((s) => s.name === "std::FreeObject")!.id, + literal + ); + + const str = makeType( + spec, + [...spec.values()].find((s) => s.name === "std::str")!.id, + literal + ); + + return $expressionify({ + __element__: { + ...$FreeObject, + __name__: "std::FreeObject", + __pointers__: { + ...($FreeObject as any).__pointers__, + __name__: "std::FreeObject", + grouping: { + __kind__: "property", + target: str, + cardinality: Cardinality.Many, + exclusive: false, + computed: false, + readonly: false, + hasDefault: false, + } as PropertyDesc, + key: { + __kind__: "link", + target: { + ...$FreeObject, + __name__: "std::FreeObject", + __pointers__: { + ...($FreeObject as any).__pointers__, + ...keyPointers, + }, + __shape__: keyShape, + }, + properties: {}, + cardinality: Cardinality.One, + exclusive: false, + computed: false, + readonly: false, + hasDefault: false, + } as LinkDesc, + + elements: { + __kind__: "link", + target: expr.__element__, + cardinality: Cardinality.Many, + properties: {}, + exclusive: false, + computed: false, + readonly: false, + hasDefault: false, + } as LinkDesc, + }, + __shape__: { + grouping: $expressionify({ + __element__: str, + __cardinality__: Cardinality.Many, + } as any), + key: $expressionify({ + __element__: { + ...$FreeObject, + __shape__: keyShape, + }, + __cardinality__: Cardinality.One, + } as any), + elements: $expressionify({ + __element__: { ...expr.__element__, __shape__: shape } as any, + __cardinality__: Cardinality.Many, + } as any), + }, + }, + + __cardinality__: Cardinality.Many, + __expr__: expr, + __modifiers__: { by: grouping }, + __kind__: ExpressionKind.Group, + __scope__: scope, + }) as any; +}; +Object.assign(groupFunc, setFuncs); + +function resolveShape( + shapeGetter: ((scope: any) => any) | any, + expr: TypeSet +): { modifiers: { by: SimpleGroupElements }; shape: any; scope: TypeSet } { + const modifiers: { by: SimpleGroupElements } = {} as any; + const shape: any = {}; + + // get scoped object if expression is objecttypeset + const scope = $getScopedExpr(expr as any) as ObjectTypeSet; + + // execute getter with scope + const selectShape = + typeof shapeGetter === "function" ? shapeGetter(scope) : shapeGetter; + + for (const [key, value] of Object.entries(selectShape)) { + // handle modifier keys + if (key === "by") { + modifiers[key] = value as any; + } else { + // for scalar expressions, scope === expr + // shape keys are not allowed + if (expr.__element__.__kind__ !== TypeKind.object) { + throw new Error( + `Invalid select shape key '${key}' on scalar expression, ` + + `only modifiers are allowed (filter, order_by, offset and limit)` + ); + } + shape[key] = resolveShapeElement(key, value, scope); + } + } + if (Object.keys(shape).length === 0) { + shape.id = true; + } + if (!modifiers.by) { + throw new Error("Must provide a `by` key in `e.group`"); + } + return { shape, modifiers, scope }; +} +export const group: typeof setFuncs & groupFunc = groupFunc as any; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/hydrate.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/hydrate.ts new file mode 100644 index 000000000..06591fe38 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/hydrate.ts @@ -0,0 +1,286 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { $ } from "edgedb"; + +import type { + BaseType, + ObjectType, + ObjectTypePointers, + LinkDesc, + PropertyDesc, + TupleType, +} from "./typesystem"; + +import { util, TypeKind } from "edgedb/dist/reflection/index"; +import type { typeutil } from "edgedb/dist/reflection/index"; + +const typeCache = new Map(); + +const _linkProps = Symbol(); + +function applySpec( + spec: $.introspect.Types, + type: $.introspect.ObjectType, + shape: any, + seen: Set, + literal: any +): void { + const allPointers = [ + ...type.pointers, + ...type.backlinks, + ...type.backlink_stubs, + ]; + for (const ptr of allPointers) { + if (seen.has(ptr.name)) { + continue; + } + seen.add(ptr.name); + + if (ptr.kind === "link") { + shape[ptr.name] = { + __kind__: "link", + cardinality: ptr.card, + exclusive: ptr.is_exclusive, + computed: ptr.is_computed, + readonly: ptr.is_readonly, + } as LinkDesc; + util.defineGetter(shape[ptr.name], "target", () => + makeType(spec, ptr.target_id, literal) + ); + util.defineGetter(shape[ptr.name], "properties", () => { + if (!shape[ptr.name][_linkProps]) { + const linkProperties: { [k: string]: any } = (shape[ptr.name][ + _linkProps + ] = {}); + for (const linkProp of ptr.pointers ?? []) { + // We only support "link properties" in EdgeDB, currently. + if (linkProp.kind !== "property") { + return; + } + // No use for them reflected, at the moment. + if (linkProp.name === "source" || linkProp.name === "target") { + return; + } + + const linkPropObject: any = { + __kind__: "property", + }; + linkPropObject.cardinality = linkProp.card; + util.defineGetter(linkPropObject, "target", () => { + return makeType(spec, linkProp.target_id, literal); + }); + linkProperties[linkProp.name] = linkPropObject; + } + } + return shape[ptr.name][_linkProps]; + }); + } else if (ptr.kind === "property") { + shape[ptr.name] = { + __kind__: "property", + cardinality: ptr.card, + exclusive: ptr.is_exclusive, + computed: ptr.is_computed, + readonly: ptr.is_readonly, + } as PropertyDesc; + util.defineGetter(shape[ptr.name], "target", () => + makeType(spec, ptr.target_id, literal) + ); + } + } +} + +export function makeType( + spec: $.introspect.Types, + id: string, + // should be (type: any, val: any) => any, but causes + // 'Type instantiation is excessively deep and possibly infinite' error + // in typescript 4.5 + literal: any, + anytype?: BaseType +): T { + const type = spec.get(id); + + if (type.name === "anytype" || type.name === "std::anypoint") { + if (anytype) return anytype as unknown as T; + throw new Error("anytype not provided"); + } + + if (typeCache.has(id)) { + return typeCache.get(id) as T; + } + + const obj: any = {}; + obj.__name__ = type.name; + + if (type.kind === "object") { + obj.__kind__ = TypeKind.object; + + const pointers: any = {}; + const seen = new Set(); + applySpec(spec, type, pointers, seen, literal); + const ancestors = [...type.bases]; + for (const anc of ancestors) { + const ancType = spec.get(anc.id); + if (ancType.kind === "object" || ancType.kind === "scalar") { + ancestors.push(...ancType.bases); + } + if (ancType.kind !== "object") { + throw new Error(`Not an object: ${id}`); + } + applySpec(spec, ancType, pointers, seen, literal); + } + + obj.__pointers__ = pointers; + obj.__shape__ = {}; + typeCache.set(id, obj); + return obj; + } else if (type.kind === "scalar") { + const scalarObj = type.is_abstract + ? {} + : type.enum_values + ? {} + : // : type.name === "std::json" + // ? (((val: any) => { + // return literal(scalarObj, JSON.stringify(val)); + // }) as any) + (((val: any) => { + return literal(scalarObj, val); + }) as any); + + if (type.enum_values) { + scalarObj.__kind__ = TypeKind.enum; + scalarObj.__values__ = type.enum_values; + for (const val of type.enum_values) { + Object.defineProperty(scalarObj, val, { + get() { + return literal(scalarObj, val); + }, + }); + } + } else { + scalarObj.__kind__ = TypeKind.scalar; + } + scalarObj.__name__ = type.name; + + if (type.cast_type) { + scalarObj.__casttype__ = makeType(spec, type.cast_type, literal); + } + typeCache.set(id, scalarObj); + return scalarObj; + } else if (type.kind === "array") { + obj.__kind__ = TypeKind.array; + util.defineGetter(obj, "__element__", () => { + return makeType(spec, type.array_element_id, literal, anytype); + }); + util.defineGetter(obj, "__name__", () => { + return `array<${obj.__element__.__name__}>`; + }); + return obj; + } else if (type.kind === "tuple") { + if (type.tuple_elements[0]!.name === "0") { + // unnamed tuple + obj.__kind__ = TypeKind.tuple; + + util.defineGetter(obj, "__items__", () => { + return type.tuple_elements.map((el) => + makeType(spec, el.target_id, literal, anytype) + ) as any; + }); + util.defineGetter(obj, "__name__", () => { + return `tuple<${obj.__items__ + .map((item: any) => item.__name__) + .join(", ")}>`; + }); + return obj; + } else { + // named tuple + obj.__kind__ = TypeKind.namedtuple; + + util.defineGetter(obj, "__shape__", () => { + const shape: any = {}; + for (const el of type.tuple_elements) { + shape[el.name] = makeType(spec, el.target_id, literal, anytype); + } + return shape; + }); + util.defineGetter(obj, "__name__", () => { + return `tuple<${Object.entries(obj.__shape__) + .map(([key, val]: [string, any]) => `${key}: ${val.__name__}`) + .join(", ")}>`; + }); + return obj; + } + } else if (type.kind === "range") { + obj.__kind__ = TypeKind.range; + util.defineGetter(obj, "__element__", () => { + return makeType(spec, type.range_element_id, literal, anytype); + }); + util.defineGetter(obj, "__name__", () => { + return `range<${obj.__element__.__name__}>`; + }); + return obj; + } else { + throw new Error("Invalid type."); + } +} +export type mergeObjectShapes< + A extends ObjectTypePointers, + B extends ObjectTypePointers +> = typeutil.flatten<{ + [k in keyof A & keyof B]: A[k] extends B[k] // possible performance issue? + ? B[k] extends A[k] + ? A[k] + : never + : never; +}>; + +export type mergeObjectTypes< + A extends ObjectType | undefined, + B extends ObjectType | undefined +> = A extends ObjectType + ? B extends ObjectType + ? ObjectType< + `${A["__name__"]} UNION ${B["__name__"]}`, + mergeObjectShapes, + null + > + : A + : B extends ObjectType + ? B + : undefined; + +export function $mergeObjectTypes( + a: A, + b: B +): mergeObjectTypes { + const obj = { + __kind__: TypeKind.object, + __name__: `${a.__name__} UNION ${b.__name__}`, + get __pointers__() { + const merged: any = {}; + for (const [akey, aitem] of Object.entries(a.__pointers__)) { + if (!b.__pointers__[akey]) continue; + + const bitem = b.__pointers__[akey]!; + if (aitem.cardinality !== bitem.cardinality) continue; + // names must reflect full type + if (aitem.target.__name__ !== bitem.target.__name__) continue; + merged[akey] = aitem; + } + return merged; + }, + __shape__: {}, + }; + return obj as any; +} + +export function $mergeTupleTypes( + a: A, + b: B +): TupleType { + if (a.__items__.length !== b.__items__.length) { + throw new Error("Incompatible tuple types; lengths differ."); + } + return {} as TupleType; +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/imports.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/imports.ts new file mode 100644 index 000000000..2764b39b5 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/imports.ts @@ -0,0 +1,7 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +export * as edgedb from "edgedb"; +export { spec } from "./__spec__"; +export * as syntax from "./syntax"; +export * as castMaps from "./castMaps"; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/index.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/index.ts new file mode 100644 index 000000000..3fc2bc0e3 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/index.ts @@ -0,0 +1,50 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +export * from "./external"; +export { createClient } from "edgedb"; +import * as $ from "./reflection"; +import * as $syntax from "./syntax"; +import * as $op from "./operators"; +import _std from "./modules/std"; +import _cal from "./modules/cal"; +import _cfg from "./modules/cfg"; +import _schema from "./modules/schema"; +import _sys from "./modules/sys"; +import _default from "./modules/default"; +import _math from "./modules/math"; + +const ExportDefault: typeof _std & + typeof _default & + $.util.OmitDollarPrefixed & + typeof $op & { + "std": typeof _std; + "cal": typeof _cal; + "cfg": typeof _cfg; + "schema": typeof _schema; + "sys": typeof _sys; + "default": typeof _default; + "math": typeof _math; +} = { + ..._std, + ..._default, + ...$.util.omitDollarPrefixed($syntax), + ...$op, + "std": _std, + "cal": _cal, + "cfg": _cfg, + "schema": _schema, + "sys": _sys, + "default": _default, + "math": _math, +}; +const Cardinality = $.Cardinality; +type Cardinality = $.Cardinality; +export type Set< + Type extends $.BaseType, + Card extends $.Cardinality = $.Cardinality.Many +> = $.TypeSet; + + +export default ExportDefault; +export { Cardinality }; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/insert.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/insert.ts new file mode 100644 index 000000000..12dbe7c3b --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/insert.ts @@ -0,0 +1,301 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { + Cardinality, + ExpressionKind, + typeutil, + TypeKind, +} from "edgedb/dist/reflection/index"; +import type { + Expression, + LinkDesc, + ObjectTypeSet, + ObjectTypePointers, + PropertyDesc, + stripBacklinks, + stripNonInsertables, + $scopify, + stripSet, + TypeSet, + ObjectType, + NamedTupleType, +} from "./typesystem"; +import type { pointerToAssignmentExpression } from "./casting"; +import { $expressionify, $getScopedExpr } from "./path"; +import { cast } from "./cast"; +import { set } from "./set"; +import { literal } from "./literal"; +import { $getTypeByName } from "./literal"; +import type { $expr_PathNode } from "./path"; +import type { $Object } from "./modules/std"; +import type { scalarLiterals } from "./castMaps"; + +export type pointerIsOptional = + T["cardinality"] extends + | Cardinality.Many + | Cardinality.Empty + | Cardinality.AtMostOne + ? true + : false; + +export type InsertShape = typeutil.flatten< + RawInsertShape +>; + +export type RawInsertShape = + // short-circuit infinitely deep + ObjectType extends El + ? never + : typeutil.stripNever< + stripNonInsertables> + > extends infer Shape + ? Shape extends ObjectTypePointers + ? typeutil.addQuestionMarks<{ + [k in keyof Shape]: + | pointerToAssignmentExpression + | (pointerIsOptional extends true + ? undefined | null + : never) + | (Shape[k]["hasDefault"] extends true ? undefined : never); + }> & { [k in `@${string}`]: TypeSet | scalarLiterals } + : never + : never; + +interface UnlessConflict { + on: TypeSet | null; + else?: TypeSet; +} + +type InsertBaseExpression = { + __kind__: ExpressionKind.Insert; + __element__: Root["__element__"]; + __cardinality__: Cardinality.One; + __expr__: stripSet; + __shape__: any; +}; +export type $expr_Insert< + // Root extends $expr_PathNode = $expr_PathNode + El extends ObjectType = ObjectType + // Conflict = UnlessConflict | null + // Shape extends InsertShape = any +> = Expression<{ + __kind__: ExpressionKind.Insert; + __element__: El; + __cardinality__: Cardinality.One; + __expr__: $expr_PathNode; + __shape__: InsertShape; + + unlessConflict(): $expr_InsertUnlessConflict< + El, + // Expression<{ + // __kind__: ExpressionKind.Insert; + // __element__: El; + // __cardinality__: Cardinality.One; + // __expr__: $expr_PathNode; + // __shape__: InsertShape; + // }>, + { on: null } + >; + unlessConflict( + conflictGetter: (scope: $scopify) => Conflict + ): $expr_InsertUnlessConflict< + El, + // Expression<{ + // __kind__: ExpressionKind.Insert; + // __element__: El; + // __cardinality__: Cardinality.One; + // __expr__: $expr_PathNode; + // __shape__: InsertShape; + // }>, + Conflict + >; +}>; + +export type $expr_InsertUnlessConflict< + El extends ObjectType = ObjectType, + // Root extends InsertBaseExpression = InsertBaseExpression, + Conflict extends UnlessConflict = UnlessConflict +> = Expression<{ + __kind__: ExpressionKind.InsertUnlessConflict; + __element__: Conflict["else"] extends TypeSet + ? Conflict["else"]["__element__"]["__name__"] extends El["__name__"] + ? El + : $Object + : El; + __cardinality__: Conflict["else"] extends TypeSet + ? Conflict["else"]["__cardinality__"] + : Cardinality.AtMostOne; + __expr__: InsertBaseExpression; + __conflict__: Conflict; +}>; + +function unlessConflict( + this: $expr_Insert, + conflictGetter?: (scope: TypeSet) => UnlessConflict +) { + const expr: any = { + __kind__: ExpressionKind.InsertUnlessConflict, + __element__: this.__element__, + __cardinality__: Cardinality.AtMostOne, + __expr__: this, + // __conflict__: Conflict; + }; + + if (!conflictGetter) { + expr.__conflict__ = { on: null }; + return $expressionify(expr); + } else { + const scopedExpr = $getScopedExpr(this.__expr__); + const conflict = conflictGetter(scopedExpr); + expr.__conflict__ = conflict; + if (conflict.else) { + expr.__cardinality__ = conflict.else.__cardinality__; + if (this.__element__.__name__ !== conflict.else.__element__.__name__) { + expr.__element__ = $getTypeByName("std::Object"); + } + } + return $expressionify(expr); + } +} + +export function $insertify( + expr: Omit<$expr_Insert, "unlessConflict"> +): $expr_Insert { + (expr as any).unlessConflict = unlessConflict.bind(expr as any); + return expr as any; +} + +export function $normaliseInsertShape( + root: ObjectTypeSet, + shape: { [key: string]: any }, + isUpdate: boolean = false +): { [key: string]: TypeSet | { "+=": TypeSet } | { "-=": TypeSet } } { + const newShape: { + [key: string]: TypeSet | { "+=": TypeSet } | { "-=": TypeSet }; + } = {}; + + const _shape: [string, any][] = + shape.__element__?.__kind__ === TypeKind.namedtuple + ? Object.keys((shape.__element__ as NamedTupleType).__shape__).map( + (key) => [key, shape[key]] + ) + : Object.entries(shape); + for (const [key, _val] of _shape) { + let val = _val; + let setModify: string | null = null; + if (isUpdate && _val != null && typeof _val === "object") { + const valKeys = Object.keys(_val); + if ( + valKeys.length === 1 && + (valKeys[0] === "+=" || valKeys[0] === "-=") + ) { + val = _val[valKeys[0]]; + setModify = valKeys[0]; + } + } + + const pointer = root.__element__.__pointers__[key]; + + // no pointer, not a link property + const isLinkProp = key[0] === "@"; + if (!pointer && !isLinkProp) { + throw new Error( + `Could not find property pointer for ${ + isUpdate ? "update" : "insert" + } shape key: '${key}'` + ); + } + + // skip undefined vals + if (val === undefined) continue; + + // is val is expression, assign to newShape + if (val?.__kind__) { + // ranges can contain null values, so if the type is 'std::number' + // we need to set the type to the exact number type of the pointer + // so null casts are correct + if ( + val.__kind__ === ExpressionKind.Literal && + val.__element__.__kind__ === TypeKind.range && + val.__element__.__element__.__name__ === "std::number" + ) { + newShape[key] = (literal as any)(pointer?.target, val.__value__); + } else { + newShape[key] = _val; + } + continue; + } + + // handle link props + // after this guard, pointer definitely is defined + if (isLinkProp) { + throw new Error( + `Cannot assign plain data to link property '${key}'. Provide an expression instead.` + ); + } + // Workaround to tell TypeScript pointer definitely is defined + if (!pointer) { + throw new Error( + "Code will never reach here, but TypeScript cannot determine" + ); + } + + // trying to assign plain data to a link + if (pointer.__kind__ !== "property" && val !== null) { + throw new Error( + `Must provide subquery when assigning to link '${key}' in ${ + isUpdate ? "update" : "insert" + } query.` + ); + } + + // val is plain data + // key corresponds to pointer or starts with "@" + const isMulti = + pointer.cardinality === Cardinality.AtLeastOne || + pointer.cardinality === Cardinality.Many; + if (pointer.__kind__ === "property") { + if (pointer.target.__name__ === "std::json") { + } + } + + const wrappedVal = + val === null + ? cast(pointer.target, null) + : isMulti && Array.isArray(val) + ? val.length === 0 + ? cast(pointer.target, null) + : set(...val.map((v) => (literal as any)(pointer.target, v))) + : (literal as any)(pointer.target, val); + newShape[key] = setModify + ? ({ [setModify]: wrappedVal } as any) + : wrappedVal; + } + return newShape; +} + +export function insert( + root: Root, + shape: InsertShape +): $expr_Insert { + if (typeof shape !== "object") { + throw new Error( + `invalid insert shape.${ + typeof shape === "function" + ? " Hint: Insert shape is expected to be an object, " + + "not a function returning a shape object." + : "" + }` + ); + } + const expr: any = { + __kind__: ExpressionKind.Insert, + __element__: root.__element__, + __cardinality__: Cardinality.One, + __expr__: root, + __shape__: $normaliseInsertShape(root, shape), + }; + (expr as any).unlessConflict = unlessConflict.bind(expr); + return $expressionify($insertify(expr)) as any; +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/json.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/json.ts new file mode 100644 index 000000000..363b7bab1 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/json.ts @@ -0,0 +1,93 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { ExpressionKind, TypeKind } from "edgedb/dist/reflection/index"; +import type { ParamType } from "./typesystem"; +import { encodeB64 } from "edgedb/dist/primitives/buffer"; +import type { $expr_WithParams } from "./params"; + +function jsonStringify(type: ParamType, val: any): string { + if (type.__kind__ === TypeKind.array) { + if (Array.isArray(val)) { + return `[${val + .map((item) => jsonStringify(type.__element__, item)) + .join()}]`; + } + throw new Error(`Param with array type is not an array`); + } + if (type.__kind__ === TypeKind.tuple) { + if (!Array.isArray(val)) { + throw new Error(`Param with tuple type is not an array`); + } + if (val.length !== type.__items__.length) { + throw new Error( + `Param with tuple type has incorrect number of items. Got ${val.length} expected ${type.__items__.length}` + ); + } + return `[${val + .map((item, i) => jsonStringify(type.__items__[i]!, item)) + .join()}]`; + } + if (type.__kind__ === TypeKind.namedtuple) { + if (typeof val !== "object") { + throw new Error(`Param with named tuple type is not an object`); + } + if (Object.keys(val).length !== Object.keys(type.__shape__).length) { + throw new Error( + `Param with named tuple type has incorrect number of items. Got ${ + Object.keys(val).length + } expected ${Object.keys(type.__shape__).length}` + ); + } + return `{${Object.entries(val) + .map(([key, item]) => { + if (!type.__shape__[key]) { + throw new Error( + `Unexpected key in named tuple param: ${key}, expected keys: ${Object.keys( + type.__shape__ + ).join()}` + ); + } + return `"${key}": ${jsonStringify(type.__shape__[key]!, item)}`; + }) + .join()}}`; + } + if ( + type.__kind__ === TypeKind.scalar + // || type.__kind__ === TypeKind.castonlyscalar + ) { + switch (type.__name__) { + case "std::bigint": + return val.toString(); + case "std::json": + return JSON.stringify(val); + case "std::bytes": + return `"${encodeB64(val)}"`; + case "cfg::memory": + return `"${val.toString()}"`; + default: + return JSON.stringify(val); + } + } + if (type.__kind__ === TypeKind.enum) { + return JSON.stringify(val); + } + throw new Error(`Invalid param type: ${(type as any).__kind__}`); +} + +export function jsonifyComplexParams(expr: any, _args: any) { + if (_args && expr.__kind__ === ExpressionKind.WithParams) { + const args = { ..._args }; + for (const param of (expr as $expr_WithParams).__params__) { + if (param.__isComplex__) { + args[param.__name__] = jsonStringify( + param.__element__ as any, + args[param.__name__] + ); + } + } + + return args; + } + return _args; +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/literal.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/literal.ts new file mode 100644 index 000000000..f0b2295f6 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/literal.ts @@ -0,0 +1,58 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { + Expression, + BaseType, + BaseTypeToTsType, + ScalarType, +} from "./typesystem"; + +// import { +// Cardinality, +// ExpressionKind, +// BaseType, +// BaseTypeToTsType, +// makeType, +// ScalarType +// } from "edgedb/dist/reflection/index"; + +// import type {$expr_Literal} from "./literal"; +import { $expressionify } from "./path"; +import { spec } from "./__spec__"; +import { Cardinality, ExpressionKind } from "edgedb/dist/reflection/index"; +import { makeType } from "./hydrate"; + +export type $expr_Literal = Expression<{ + __element__: Type; + __cardinality__: Cardinality.One; + __kind__: ExpressionKind.Literal; + __value__: any; +}>; + +export function literal( + type: T, + value: BaseTypeToTsType +): $expr_Literal { + return $expressionify({ + __element__: type, + __cardinality__: Cardinality.One, + __kind__: ExpressionKind.Literal, + __value__: value, + }) as any; +} + +export const $nameMapping = new Map([ + ...([...spec.values()].map((type) => [type.name, type.id]) as any), + ["std::number", "00000000-0000-0000-0000-0000000001ff"], +]); + +export function $getType(id: string): (val: any) => $expr_Literal { + return makeType(spec, id, literal) as any; +} + +export function $getTypeByName( + name: string +): (val: any) => $expr_Literal { + return makeType(spec, $nameMapping.get(name)!, literal) as any; +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/cal.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/cal.ts new file mode 100644 index 000000000..70f9a3c0a --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/cal.ts @@ -0,0 +1,478 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _std from "./std"; +export type $date_duration = $.ScalarType<"cal::date_duration", _.edgedb.DateDuration>; +const date_duration: $.scalarTypeWithConstructor<$date_duration, string> = $.makeType<$.scalarTypeWithConstructor<$date_duration, string>>(_.spec, "00000000-0000-0000-0000-000000000112", _.syntax.literal); + +export type $local_date = $.ScalarType<"cal::local_date", _.edgedb.LocalDate>; +const local_date: $.scalarTypeWithConstructor<$local_date, string> = $.makeType<$.scalarTypeWithConstructor<$local_date, string>>(_.spec, "00000000-0000-0000-0000-00000000010c", _.syntax.literal); + +export type $local_datetime = $.ScalarType<"cal::local_datetime", _.edgedb.LocalDateTime>; +const local_datetime: $.scalarTypeWithConstructor<$local_datetime, string> = $.makeType<$.scalarTypeWithConstructor<$local_datetime, string>>(_.spec, "00000000-0000-0000-0000-00000000010b", _.syntax.literal); +export type $local_datetimeλICastableTo = $local_datetime | $local_date; +export type $local_datetimeλIAssignableBy = $local_datetime | $local_date; + +export type $local_time = $.ScalarType<"cal::local_time", _.edgedb.LocalTime>; +const local_time: $.scalarTypeWithConstructor<$local_time, string> = $.makeType<$.scalarTypeWithConstructor<$local_time, string>>(_.spec, "00000000-0000-0000-0000-00000000010d", _.syntax.literal); + +export type $relative_duration = $.ScalarType<"cal::relative_duration", _.edgedb.RelativeDuration>; +const relative_duration: $.scalarTypeWithConstructor<$relative_duration, string> = $.makeType<$.scalarTypeWithConstructor<$relative_duration, string>>(_.spec, "00000000-0000-0000-0000-000000000111", _.syntax.literal); +export type $relative_durationλICastableTo = $relative_duration | $date_duration; +export type $relative_durationλIAssignableBy = $relative_duration | $date_duration; + +type to_local_datetimeλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +> = $.$expr_Function< + $local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_local_datetimeλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type to_local_datetimeλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P4 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P5 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P6 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + $local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality>, $.cardutil.paramCardinality>, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** + * Create a `cal::local_datetime` value. + */ +function to_local_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_local_datetimeλFuncExpr; +/** + * Create a `cal::local_datetime` value. + */ +function to_local_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + dt: P1, + zone: P2, +): to_local_datetimeλFuncExpr2; +/** + * Create a `cal::local_datetime` value. + */ +function to_local_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P4 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P5 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P6 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + year: P1, + month: P2, + day: P3, + hour: P4, + min: P5, + sec: P6, +): to_local_datetimeλFuncExpr3; +function to_local_datetime(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::to_local_datetime', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::to_local_datetime", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_local_dateλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +> = $.$expr_Function< + $local_date, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_local_dateλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $local_date, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type to_local_dateλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + $local_date, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** + * Create a `cal::local_date` value. + */ +function to_local_date< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_local_dateλFuncExpr; +/** + * Create a `cal::local_date` value. + */ +function to_local_date< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + dt: P1, + zone: P2, +): to_local_dateλFuncExpr2; +/** + * Create a `cal::local_date` value. + */ +function to_local_date< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + year: P1, + month: P2, + day: P3, +): to_local_dateλFuncExpr3; +function to_local_date(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::to_local_date', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c"}, + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::to_local_date", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_local_timeλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +> = $.$expr_Function< + $local_time, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_local_timeλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $local_time, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type to_local_timeλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + $local_time, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** + * Create a `cal::local_time` value. + */ +function to_local_time< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_local_timeλFuncExpr; +/** + * Create a `cal::local_time` value. + */ +function to_local_time< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + dt: P1, + zone: P2, +): to_local_timeλFuncExpr2; +/** + * Create a `cal::local_time` value. + */ +function to_local_time< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + hour: P1, + min: P2, + sec: P3, +): to_local_timeλFuncExpr3; +function to_local_time(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::to_local_time', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d"}, + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::to_local_time", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_relative_durationλFuncExpr< + NamedArgs extends { + "years"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "months"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "days"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "hours"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "minutes"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "seconds"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "microseconds"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + }, +> = $.$expr_Function< + $relative_duration, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `cal::relative_duration` value. + */ +function to_relative_duration< + NamedArgs extends { + "years"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "months"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "days"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "hours"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "minutes"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "seconds"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "microseconds"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + }, +>( + namedArgs: NamedArgs, +): to_relative_durationλFuncExpr; +function to_relative_duration(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::to_relative_duration', args, _.spec, [ + {args: [], namedArgs: {"years": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "months": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "days": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "hours": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "minutes": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "seconds": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "microseconds": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000111"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::to_relative_duration", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_date_durationλFuncExpr< + NamedArgs extends { + "years"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "months"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "days"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + }, +> = $.$expr_Function< + $date_duration, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `cal::date_duration` value. + */ +function to_date_duration< + NamedArgs extends { + "years"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "months"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + "days"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + }, +>( + namedArgs: NamedArgs, +): to_date_durationλFuncExpr; +function to_date_duration(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::to_date_duration', args, _.spec, [ + {args: [], namedArgs: {"years": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "months": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "days": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000112"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::to_date_duration", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type time_getλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Extract a specific element of input time by name. + */ +function time_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + dt: P1, + el: P2, +): time_getλFuncExpr; +function time_get(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::time_get', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::time_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type date_getλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Extract a specific element of input date by name. + */ +function date_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + dt: P1, + el: P2, +): date_getλFuncExpr; +function date_get(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::date_get', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::date_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type duration_normalize_hoursλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$relative_durationλICastableTo>>, +> = $.$expr_Function< + $relative_duration, $.cardutil.paramCardinality +>; +/** + * Convert 24-hour chunks into days. + */ +function duration_normalize_hours< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$relative_durationλICastableTo>>, +>( + dur: P1, +): duration_normalize_hoursλFuncExpr; +function duration_normalize_hours(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::duration_normalize_hours', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::duration_normalize_hours", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type duration_normalize_daysλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$date_duration>>, +> = $.$expr_Function< + $date_duration, $.cardutil.paramCardinality +>; +type duration_normalize_daysλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$relative_durationλICastableTo>>, +> = $.$expr_Function< + $relative_duration, $.cardutil.paramCardinality +>; +/** + * Convert 30-day chunks into months. + */ +function duration_normalize_days< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$date_duration>>, +>( + dur: P1, +): duration_normalize_daysλFuncExpr; +/** + * Convert 30-day chunks into months. + */ +function duration_normalize_days< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$relative_durationλICastableTo>>, +>( + dur: P1, +): duration_normalize_daysλFuncExpr2; +function duration_normalize_days(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cal::duration_normalize_days', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000112"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cal::duration_normalize_days", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + + + +export { date_duration, local_date, local_datetime, local_time, relative_duration }; + +type __defaultExports = { + "date_duration": typeof date_duration; + "local_date": typeof local_date; + "local_datetime": typeof local_datetime; + "local_time": typeof local_time; + "relative_duration": typeof relative_duration; + "to_local_datetime": typeof to_local_datetime; + "to_local_date": typeof to_local_date; + "to_local_time": typeof to_local_time; + "to_relative_duration": typeof to_relative_duration; + "to_date_duration": typeof to_date_duration; + "time_get": typeof time_get; + "date_get": typeof date_get; + "duration_normalize_hours": typeof duration_normalize_hours; + "duration_normalize_days": typeof duration_normalize_days +}; +const __defaultExports: __defaultExports = { + "date_duration": date_duration, + "local_date": local_date, + "local_datetime": local_datetime, + "local_time": local_time, + "relative_duration": relative_duration, + "to_local_datetime": to_local_datetime, + "to_local_date": to_local_date, + "to_local_time": to_local_time, + "to_relative_duration": to_relative_duration, + "to_date_duration": to_date_duration, + "time_get": time_get, + "date_get": date_get, + "duration_normalize_hours": duration_normalize_hours, + "duration_normalize_days": duration_normalize_days +}; +export default __defaultExports; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/cfg.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/cfg.ts new file mode 100644 index 000000000..f0230577d --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/cfg.ts @@ -0,0 +1,212 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _std from "./std"; +export type $AllowBareDDL = { + "AlwaysAllow": $.$expr_Literal<$AllowBareDDL>; + "NeverAllow": $.$expr_Literal<$AllowBareDDL>; +} & $.EnumType<"cfg::AllowBareDDL", ["AlwaysAllow", "NeverAllow"]>; +const AllowBareDDL: $AllowBareDDL = $.makeType<$AllowBareDDL>(_.spec, "fb527712-00ce-11ee-a2b5-5938a2344e0b", _.syntax.literal); + +export type $ConnectionTransport = { + "TCP": $.$expr_Literal<$ConnectionTransport>; + "TCP_PG": $.$expr_Literal<$ConnectionTransport>; + "HTTP": $.$expr_Literal<$ConnectionTransport>; +} & $.EnumType<"cfg::ConnectionTransport", ["TCP", "TCP_PG", "HTTP"]>; +const ConnectionTransport: $ConnectionTransport = $.makeType<$ConnectionTransport>(_.spec, "fb52dc52-00ce-11ee-a982-a7fcd907f812", _.syntax.literal); + +export type $memory = $.ScalarType<"cfg::memory", _.edgedb.ConfigMemory>; +const memory: $.scalarTypeWithConstructor<$memory, string> = $.makeType<$.scalarTypeWithConstructor<$memory, string>>(_.spec, "00000000-0000-0000-0000-000000000130", _.syntax.literal); + +export type $ConfigObjectλShape = $.typeutil.flatten<_std.$BaseObjectλShape & { +}>; +type $ConfigObject = $.ObjectType<"cfg::ConfigObject", $ConfigObjectλShape, null, [ + ..._std.$BaseObject['__exclusives__'], +]>; +const $ConfigObject = $.makeType<$ConfigObject>(_.spec, "fb5344b2-00ce-11ee-8e62-adfdb0bddd8d", _.syntax.literal); + +const ConfigObject: $.$expr_PathNode<$.TypeSet<$ConfigObject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($ConfigObject, $.Cardinality.Many), null); + +export type $AbstractConfigλShape = $.typeutil.flatten<$ConfigObjectλShape & { + "auth": $.LinkDesc<$Auth, $.Cardinality.Many, {}, false, false, false, false>; + "force_database_error": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, true>; + "session_idle_timeout": $.PropertyDesc<_std.$duration, $.Cardinality.One, false, false, false, true>; + "session_idle_transaction_timeout": $.PropertyDesc<_std.$duration, $.Cardinality.One, false, false, false, true>; + "query_execution_timeout": $.PropertyDesc<_std.$duration, $.Cardinality.One, false, false, false, false>; + "listen_port": $.PropertyDesc<_std.$int16, $.Cardinality.One, false, false, false, true>; + "listen_addresses": $.PropertyDesc<_std.$str, $.Cardinality.Many, false, false, false, false>; + "allow_dml_in_functions": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, true>; + "allow_bare_ddl": $.PropertyDesc<$AllowBareDDL, $.Cardinality.AtMostOne, false, false, false, true>; + "apply_access_policies": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, true>; + "allow_user_specified_id": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, true>; + "shared_buffers": $.PropertyDesc<$memory, $.Cardinality.AtMostOne, false, false, false, false>; + "query_work_mem": $.PropertyDesc<$memory, $.Cardinality.AtMostOne, false, false, false, false>; + "effective_cache_size": $.PropertyDesc<$memory, $.Cardinality.AtMostOne, false, false, false, false>; + "effective_io_concurrency": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne, false, false, false, false>; + "default_statistics_target": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne, false, false, false, false>; + "_pg_prepared_statement_cache_size": $.PropertyDesc<_std.$int16, $.Cardinality.One, false, false, false, true>; +}>; +type $AbstractConfig = $.ObjectType<"cfg::AbstractConfig", $AbstractConfigλShape, null, [ + ...$ConfigObject['__exclusives__'], +]>; +const $AbstractConfig = $.makeType<$AbstractConfig>(_.spec, "fb7cf4ba-00ce-11ee-96c8-af50a9862c3e", _.syntax.literal); + +const AbstractConfig: $.$expr_PathNode<$.TypeSet<$AbstractConfig, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($AbstractConfig, $.Cardinality.Many), null); + +export type $AuthλShape = $.typeutil.flatten<$ConfigObjectλShape & { + "method": $.LinkDesc<$AuthMethod, $.Cardinality.AtMostOne, {}, true, false, true, false>; + "priority": $.PropertyDesc<_std.$int64, $.Cardinality.One, true, false, true, false>; + "user": $.PropertyDesc<_std.$str, $.Cardinality.Many, false, false, true, true>; + "comment": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, true, false>; + "; + "; + "; + "; + "; +}>; +type $Auth = $.ObjectType<"cfg::Auth", $AuthλShape, null, [ + ...$ConfigObject['__exclusives__'], + {priority: {__element__: _std.$int64, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, + {method: {__element__: $AuthMethod, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $Auth = $.makeType<$Auth>(_.spec, "fb711fd2-00ce-11ee-8d6e-f3dd08f2109f", _.syntax.literal); + +const Auth: $.$expr_PathNode<$.TypeSet<$Auth, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Auth, $.Cardinality.Many), null); + +export type $AuthMethodλShape = $.typeutil.flatten<$ConfigObjectλShape & { + "transports": $.PropertyDesc<$ConnectionTransport, $.Cardinality.Many, false, false, true, false>; + "; + "; +}>; +type $AuthMethod = $.ObjectType<"cfg::AuthMethod", $AuthMethodλShape, null, [ + ...$ConfigObject['__exclusives__'], +]>; +const $AuthMethod = $.makeType<$AuthMethod>(_.spec, "fb589282-00ce-11ee-9b69-cf30cb8c4098", _.syntax.literal); + +const AuthMethod: $.$expr_PathNode<$.TypeSet<$AuthMethod, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($AuthMethod, $.Cardinality.Many), null); + +export type $ConfigλShape = $.typeutil.flatten<$AbstractConfigλShape & { +}>; +type $Config = $.ObjectType<"cfg::Config", $ConfigλShape, null, [ + ...$AbstractConfig['__exclusives__'], +]>; +const $Config = $.makeType<$Config>(_.spec, "fb9ee0c0-00ce-11ee-b6fc-991053382adb", _.syntax.literal); + +const Config: $.$expr_PathNode<$.TypeSet<$Config, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Config, $.Cardinality.Many), null); + +export type $DatabaseConfigλShape = $.typeutil.flatten<$AbstractConfigλShape & { +}>; +type $DatabaseConfig = $.ObjectType<"cfg::DatabaseConfig", $DatabaseConfigλShape, null, [ + ...$AbstractConfig['__exclusives__'], +]>; +const $DatabaseConfig = $.makeType<$DatabaseConfig>(_.spec, "fbd9ff2a-00ce-11ee-90b6-4332a0095615", _.syntax.literal); + +const DatabaseConfig: $.$expr_PathNode<$.TypeSet<$DatabaseConfig, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($DatabaseConfig, $.Cardinality.Many), null); + +export type $InstanceConfigλShape = $.typeutil.flatten<$AbstractConfigλShape & { +}>; +type $InstanceConfig = $.ObjectType<"cfg::InstanceConfig", $InstanceConfigλShape, null, [ + ...$AbstractConfig['__exclusives__'], +]>; +const $InstanceConfig = $.makeType<$InstanceConfig>(_.spec, "fbbc64f6-00ce-11ee-9f26-0976dc7dc1d4", _.syntax.literal); + +const InstanceConfig: $.$expr_PathNode<$.TypeSet<$InstanceConfig, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($InstanceConfig, $.Cardinality.Many), null); + +export type $JWTλShape = $.typeutil.flatten & { + "transports": $.PropertyDesc<$ConnectionTransport, $.Cardinality.Many, false, false, true, true>; +}>; +type $JWT = $.ObjectType<"cfg::JWT", $JWTλShape, null, [ + ...$AuthMethod['__exclusives__'], +]>; +const $JWT = $.makeType<$JWT>(_.spec, "fb6a6f16-00ce-11ee-aef6-25680c744d41", _.syntax.literal); + +const JWT: $.$expr_PathNode<$.TypeSet<$JWT, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($JWT, $.Cardinality.Many), null); + +export type $SCRAMλShape = $.typeutil.flatten & { + "transports": $.PropertyDesc<$ConnectionTransport, $.Cardinality.Many, false, false, true, true>; +}>; +type $SCRAM = $.ObjectType<"cfg::SCRAM", $SCRAMλShape, null, [ + ...$AuthMethod['__exclusives__'], +]>; +const $SCRAM = $.makeType<$SCRAM>(_.spec, "fb63fd2a-00ce-11ee-9f9f-c7b95000dbbe", _.syntax.literal); + +const SCRAM: $.$expr_PathNode<$.TypeSet<$SCRAM, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($SCRAM, $.Cardinality.Many), null); + +export type $TrustλShape = $.typeutil.flatten<$AuthMethodλShape & { +}>; +type $Trust = $.ObjectType<"cfg::Trust", $TrustλShape, null, [ + ...$AuthMethod['__exclusives__'], +]>; +const $Trust = $.makeType<$Trust>(_.spec, "fb5e29d6-00ce-11ee-b25c-597135fdd53e", _.syntax.literal); + +const Trust: $.$expr_PathNode<$.TypeSet<$Trust, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Trust, $.Cardinality.Many), null); + +type get_config_jsonλFuncExpr< + NamedArgs extends { + "sources"?: $.TypeSet<$.ArrayType<_std.$str>>, + "max_source"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + }, +> = $.$expr_Function< + _std.$json, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +function get_config_json< + NamedArgs extends { + "sources"?: $.TypeSet<$.ArrayType<_std.$str>>, + "max_source"?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + }, +>( + namedArgs: NamedArgs, +): get_config_jsonλFuncExpr; +function get_config_json(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('cfg::get_config_json', args, _.spec, [ + {args: [], namedArgs: {"sources": {typeId: "f4f119e6-00ce-11ee-9a0b-934fb014cd5d", optional: true, setoftype: false, variadic: false}, "max_source": {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-00000000010f"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cfg::get_config_json", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + + + +export { AllowBareDDL, ConnectionTransport, memory, $ConfigObject, ConfigObject, $AbstractConfig, AbstractConfig, $Auth, Auth, $AuthMethod, AuthMethod, $Config, Config, $DatabaseConfig, DatabaseConfig, $InstanceConfig, InstanceConfig, $JWT, JWT, $SCRAM, SCRAM, $Trust, Trust }; + +type __defaultExports = { + "AllowBareDDL": typeof AllowBareDDL; + "ConnectionTransport": typeof ConnectionTransport; + "memory": typeof memory; + "ConfigObject": typeof ConfigObject; + "AbstractConfig": typeof AbstractConfig; + "Auth": typeof Auth; + "AuthMethod": typeof AuthMethod; + "Config": typeof Config; + "DatabaseConfig": typeof DatabaseConfig; + "InstanceConfig": typeof InstanceConfig; + "JWT": typeof JWT; + "SCRAM": typeof SCRAM; + "Trust": typeof Trust; + "get_config_json": typeof get_config_json +}; +const __defaultExports: __defaultExports = { + "AllowBareDDL": AllowBareDDL, + "ConnectionTransport": ConnectionTransport, + "memory": memory, + "ConfigObject": ConfigObject, + "AbstractConfig": AbstractConfig, + "Auth": Auth, + "AuthMethod": AuthMethod, + "Config": Config, + "DatabaseConfig": DatabaseConfig, + "InstanceConfig": InstanceConfig, + "JWT": JWT, + "SCRAM": SCRAM, + "Trust": Trust, + "get_config_json": get_config_json +}; +export default __defaultExports; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/default.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/default.ts new file mode 100644 index 000000000..046f06999 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/default.ts @@ -0,0 +1,27 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _std from "./std"; +export type $PersonλShape = $.typeutil.flatten<_std.$Object_f65d226600ce11ee81279554e3ef2585λShape & { + "name": $.PropertyDesc<_std.$str, $.Cardinality.One, false, false, false, false>; +}>; +type $Person = $.ObjectType<"default::Person", $PersonλShape, null, [ + ..._std.$Object_f65d226600ce11ee81279554e3ef2585['__exclusives__'], +]>; +const $Person = $.makeType<$Person>(_.spec, "6498b67c-03d7-11ee-aadd-f51fa7cecb09", _.syntax.literal); + +const Person: $.$expr_PathNode<$.TypeSet<$Person, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Person, $.Cardinality.Many), null); + + + +export { $Person, Person }; + +type __defaultExports = { + "Person": typeof Person +}; +const __defaultExports: __defaultExports = { + "Person": Person +}; +export default __defaultExports; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/math.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/math.ts new file mode 100644 index 000000000..ebde3fa38 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/math.ts @@ -0,0 +1,493 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _std from "./std"; +type var_fad038a600ce11ee9d218fcb95715042λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.cardutil.overrideLowerBound<$.Cardinality.One, 'Zero'> +>; +type var_fad038a600ce11ee9d218fcb95715042λFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.cardutil.overrideLowerBound<$.Cardinality.One, 'Zero'> +>; +/** + * Return the sample variance of the input set. + */ +function var_fad038a600ce11ee9d218fcb95715042< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + vals: P1, +): var_fad038a600ce11ee9d218fcb95715042λFuncExpr; +/** + * Return the sample variance of the input set. + */ +function var_fad038a600ce11ee9d218fcb95715042< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + vals: P1, +): var_fad038a600ce11ee9d218fcb95715042λFuncExpr2; +function var_fad038a600ce11ee9d218fcb95715042(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::var', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff", returnTypemod: "OptionalType"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108", returnTypemod: "OptionalType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::var", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type var_popλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.cardutil.overrideLowerBound<$.Cardinality.One, 'Zero'> +>; +type var_popλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.cardutil.overrideLowerBound<$.Cardinality.One, 'Zero'> +>; +/** + * Return the population variance of the input set. + */ +function var_pop< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + vals: P1, +): var_popλFuncExpr; +/** + * Return the population variance of the input set. + */ +function var_pop< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + vals: P1, +): var_popλFuncExpr2; +function var_pop(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::var_pop', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff", returnTypemod: "OptionalType"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108", returnTypemod: "OptionalType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::var_pop", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type absλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyreal>>, +> = $.$expr_Function< + _std.$anyreal, $.cardutil.paramCardinality +>; +/** + * Return the absolute value of the input *x*. + */ +function abs< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyreal>>, +>( + x: P1, +): absλFuncExpr; +function abs(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::abs', args, _.spec, [ + {args: [{typeId: "f26e79f2-00ce-11ee-9118-f1407ce497dc", optional: false, setoftype: false, variadic: false}], returnTypeId: "f26e79f2-00ce-11ee-9118-f1407ce497dc"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::abs", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type ceilλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.cardutil.paramCardinality +>; +type ceilλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +> = $.$expr_Function< + _std.$bigint, $.cardutil.paramCardinality +>; +type ceilλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.cardutil.paramCardinality +>; +/** + * Round up to the nearest integer. + */ +function ceil< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + x: P1, +): ceilλFuncExpr; +/** + * Round up to the nearest integer. + */ +function ceil< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + x: P1, +): ceilλFuncExpr2; +/** + * Round up to the nearest integer. + */ +function ceil< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + x: P1, +): ceilλFuncExpr3; +function ceil(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::ceil', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::ceil", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type floorλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.cardutil.paramCardinality +>; +type floorλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +> = $.$expr_Function< + _std.$bigint, $.cardutil.paramCardinality +>; +type floorλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.cardutil.paramCardinality +>; +/** + * Round down to the nearest integer. + */ +function floor< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + x: P1, +): floorλFuncExpr; +/** + * Round down to the nearest integer. + */ +function floor< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + x: P1, +): floorλFuncExpr2; +/** + * Round down to the nearest integer. + */ +function floor< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + x: P1, +): floorλFuncExpr3; +function floor(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::floor', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::floor", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type lnλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.cardutil.paramCardinality +>; +type lnλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.cardutil.paramCardinality +>; +/** + * Return the natural logarithm of the input value. + */ +function ln< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + x: P1, +): lnλFuncExpr; +/** + * Return the natural logarithm of the input value. + */ +function ln< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + x: P1, +): lnλFuncExpr2; +function ln(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::ln', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::ln", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type lgλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.cardutil.paramCardinality +>; +type lgλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.cardutil.paramCardinality +>; +/** + * Return the base 10 logarithm of the input value. + */ +function lg< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + x: P1, +): lgλFuncExpr; +/** + * Return the base 10 logarithm of the input value. + */ +function lg< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + x: P1, +): lgλFuncExpr2; +function lg(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::lg', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::lg", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type logλFuncExpr< + NamedArgs extends { + "base": _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Return the logarithm of the input value in the specified *base*. + */ +function log< + NamedArgs extends { + "base": _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + namedArgs: NamedArgs, + x: P1, +): logλFuncExpr; +function log(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::log', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], namedArgs: {"base": {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::log", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type meanλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.Cardinality.One +>; +type meanλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.Cardinality.One +>; +/** + * Return the arithmetic mean of the input set. + */ +function mean< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + vals: P1, +): meanλFuncExpr; +/** + * Return the arithmetic mean of the input set. + */ +function mean< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + vals: P1, +): meanλFuncExpr2; +function mean(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::mean', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::mean", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type stddevλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.Cardinality.One +>; +type stddevλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.Cardinality.One +>; +/** + * Return the sample standard deviation of the input set. + */ +function stddev< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + vals: P1, +): stddevλFuncExpr; +/** + * Return the sample standard deviation of the input set. + */ +function stddev< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + vals: P1, +): stddevλFuncExpr2; +function stddev(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::stddev', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::stddev", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type stddev_popλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, $.Cardinality.One +>; +type stddev_popλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, $.Cardinality.One +>; +/** + * Return the population standard deviation of the input set. + */ +function stddev_pop< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + vals: P1, +): stddev_popλFuncExpr; +/** + * Return the population standard deviation of the input set. + */ +function stddev_pop< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + vals: P1, +): stddev_popλFuncExpr2; +function stddev_pop(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('math::stddev_pop', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "math::stddev_pop", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + + + +type __defaultExports = { + "var": typeof var_fad038a600ce11ee9d218fcb95715042; + "var_pop": typeof var_pop; + "abs": typeof abs; + "ceil": typeof ceil; + "floor": typeof floor; + "ln": typeof ln; + "lg": typeof lg; + "log": typeof log; + "mean": typeof mean; + "stddev": typeof stddev; + "stddev_pop": typeof stddev_pop +}; +const __defaultExports: __defaultExports = { + "var": var_fad038a600ce11ee9d218fcb95715042, + "var_pop": var_pop, + "abs": abs, + "ceil": ceil, + "floor": floor, + "ln": ln, + "lg": lg, + "log": log, + "mean": mean, + "stddev": stddev, + "stddev_pop": stddev_pop +}; +export default __defaultExports; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/schema.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/schema.ts new file mode 100644 index 000000000..69ef1fab8 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/schema.ts @@ -0,0 +1,972 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _std from "./std"; +import type * as _sys from "./sys"; +import type * as _cfg from "./cfg"; +import type * as _default from "./default"; +export type $AccessKind = { + "Select": $.$expr_Literal<$AccessKind>; + "UpdateRead": $.$expr_Literal<$AccessKind>; + "UpdateWrite": $.$expr_Literal<$AccessKind>; + "Delete": $.$expr_Literal<$AccessKind>; + "Insert": $.$expr_Literal<$AccessKind>; +} & $.EnumType<"schema::AccessKind", ["Select", "UpdateRead", "UpdateWrite", "Delete", "Insert"]>; +const AccessKind: $AccessKind = $.makeType<$AccessKind>(_.spec, "f6a088d0-00ce-11ee-bea4-f59ec342125c", _.syntax.literal); + +export type $AccessPolicyAction = { + "Allow": $.$expr_Literal<$AccessPolicyAction>; + "Deny": $.$expr_Literal<$AccessPolicyAction>; +} & $.EnumType<"schema::AccessPolicyAction", ["Allow", "Deny"]>; +const AccessPolicyAction: $AccessPolicyAction = $.makeType<$AccessPolicyAction>(_.spec, "f6a02692-00ce-11ee-8e35-b314cbcb4927", _.syntax.literal); + +export type $Cardinality = { + "One": $.$expr_Literal<$Cardinality>; + "Many": $.$expr_Literal<$Cardinality>; +} & $.EnumType<"schema::Cardinality", ["One", "Many"]>; +const Cardinality: $Cardinality = $.makeType<$Cardinality>(_.spec, "f69d69de-00ce-11ee-9aaa-9167e0b410c4", _.syntax.literal); + +export type $MigrationGeneratedBy = { + "DevMode": $.$expr_Literal<$MigrationGeneratedBy>; + "DDLStatement": $.$expr_Literal<$MigrationGeneratedBy>; +} & $.EnumType<"schema::MigrationGeneratedBy", ["DevMode", "DDLStatement"]>; +const MigrationGeneratedBy: $MigrationGeneratedBy = $.makeType<$MigrationGeneratedBy>(_.spec, "f6a27794-00ce-11ee-9d52-dd6ef89754d6", _.syntax.literal); + +export type $OperatorKind = { + "Infix": $.$expr_Literal<$OperatorKind>; + "Postfix": $.$expr_Literal<$OperatorKind>; + "Prefix": $.$expr_Literal<$OperatorKind>; + "Ternary": $.$expr_Literal<$OperatorKind>; +} & $.EnumType<"schema::OperatorKind", ["Infix", "Postfix", "Prefix", "Ternary"]>; +const OperatorKind: $OperatorKind = $.makeType<$OperatorKind>(_.spec, "f69e98a4-00ce-11ee-9f50-6573efacd54a", _.syntax.literal); + +export type $ParameterKind = { + "VariadicParam": $.$expr_Literal<$ParameterKind>; + "NamedOnlyParam": $.$expr_Literal<$ParameterKind>; + "PositionalParam": $.$expr_Literal<$ParameterKind>; +} & $.EnumType<"schema::ParameterKind", ["VariadicParam", "NamedOnlyParam", "PositionalParam"]>; +const ParameterKind: $ParameterKind = $.makeType<$ParameterKind>(_.spec, "f69f5de8-00ce-11ee-8fc3-33263e60870f", _.syntax.literal); + +export type $RewriteKind = { + "Update": $.$expr_Literal<$RewriteKind>; + "Insert": $.$expr_Literal<$RewriteKind>; +} & $.EnumType<"schema::RewriteKind", ["Update", "Insert"]>; +const RewriteKind: $RewriteKind = $.makeType<$RewriteKind>(_.spec, "f6a213a8-00ce-11ee-aec2-b7a1b319add8", _.syntax.literal); + +export type $SourceDeleteAction = { + "DeleteTarget": $.$expr_Literal<$SourceDeleteAction>; + "Allow": $.$expr_Literal<$SourceDeleteAction>; + "DeleteTargetIfOrphan": $.$expr_Literal<$SourceDeleteAction>; +} & $.EnumType<"schema::SourceDeleteAction", ["DeleteTarget", "Allow", "DeleteTargetIfOrphan"]>; +const SourceDeleteAction: $SourceDeleteAction = $.makeType<$SourceDeleteAction>(_.spec, "f69e32e2-00ce-11ee-bf6b-577d8a99899f", _.syntax.literal); + +export type $TargetDeleteAction = { + "Restrict": $.$expr_Literal<$TargetDeleteAction>; + "DeleteSource": $.$expr_Literal<$TargetDeleteAction>; + "Allow": $.$expr_Literal<$TargetDeleteAction>; + "DeferredRestrict": $.$expr_Literal<$TargetDeleteAction>; +} & $.EnumType<"schema::TargetDeleteAction", ["Restrict", "DeleteSource", "Allow", "DeferredRestrict"]>; +const TargetDeleteAction: $TargetDeleteAction = $.makeType<$TargetDeleteAction>(_.spec, "f69dd022-00ce-11ee-9aa1-193de66584e0", _.syntax.literal); + +export type $TriggerKind = { + "Update": $.$expr_Literal<$TriggerKind>; + "Delete": $.$expr_Literal<$TriggerKind>; + "Insert": $.$expr_Literal<$TriggerKind>; +} & $.EnumType<"schema::TriggerKind", ["Update", "Delete", "Insert"]>; +const TriggerKind: $TriggerKind = $.makeType<$TriggerKind>(_.spec, "f6a14f5e-00ce-11ee-a172-2db410fcd715", _.syntax.literal); + +export type $TriggerScope = { + "All": $.$expr_Literal<$TriggerScope>; + "Each": $.$expr_Literal<$TriggerScope>; +} & $.EnumType<"schema::TriggerScope", ["All", "Each"]>; +const TriggerScope: $TriggerScope = $.makeType<$TriggerScope>(_.spec, "f6a1b174-00ce-11ee-9a9c-5ff3afeaf949", _.syntax.literal); + +export type $TriggerTiming = { + "After": $.$expr_Literal<$TriggerTiming>; + "AfterCommitOf": $.$expr_Literal<$TriggerTiming>; +} & $.EnumType<"schema::TriggerTiming", ["After", "AfterCommitOf"]>; +const TriggerTiming: $TriggerTiming = $.makeType<$TriggerTiming>(_.spec, "f6a0eb36-00ce-11ee-a38a-75e238b739a6", _.syntax.literal); + +export type $TypeModifier = { + "SetOfType": $.$expr_Literal<$TypeModifier>; + "OptionalType": $.$expr_Literal<$TypeModifier>; + "SingletonType": $.$expr_Literal<$TypeModifier>; +} & $.EnumType<"schema::TypeModifier", ["SetOfType", "OptionalType", "SingletonType"]>; +const TypeModifier: $TypeModifier = $.makeType<$TypeModifier>(_.spec, "f69fc152-00ce-11ee-bec1-4ffbdce8b92e", _.syntax.literal); + +export type $Volatility = { + "Immutable": $.$expr_Literal<$Volatility>; + "Stable": $.$expr_Literal<$Volatility>; + "Volatile": $.$expr_Literal<$Volatility>; +} & $.EnumType<"schema::Volatility", ["Immutable", "Stable", "Volatile"]>; +const Volatility: $Volatility = $.makeType<$Volatility>(_.spec, "f69efb0a-00ce-11ee-894a-83bbc16daa88", _.syntax.literal); + +export type $Object_f6a2efd000ce11eebcd68fb1bad207a0λShape = $.typeutil.flatten<_std.$BaseObjectλShape & { + "name": $.PropertyDesc<_std.$str, $.Cardinality.One, false, false, false, false>; + "internal": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, false, false, true>; + "builtin": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, false, false, true>; + "computed_fields": $.PropertyDesc<$.ArrayType<_std.$str>, $.Cardinality.AtMostOne, false, false, false, false>; +}>; +type $Object_f6a2efd000ce11eebcd68fb1bad207a0 = $.ObjectType<"schema::Object", $Object_f6a2efd000ce11eebcd68fb1bad207a0λShape, null, [ + ..._std.$BaseObject['__exclusives__'], +]>; +const $Object_f6a2efd000ce11eebcd68fb1bad207a0 = $.makeType<$Object_f6a2efd000ce11eebcd68fb1bad207a0>(_.spec, "f6a2efd0-00ce-11ee-bcd6-8fb1bad207a0", _.syntax.literal); + +const Object_f6a2efd000ce11eebcd68fb1bad207a0: $.$expr_PathNode<$.TypeSet<$Object_f6a2efd000ce11eebcd68fb1bad207a0, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Object_f6a2efd000ce11eebcd68fb1bad207a0, $.Cardinality.Many), null); + +export type $SubclassableObjectλShape = $.typeutil.flatten<$Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { + "abstract": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, true>; + "is_abstract": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, true, false, true>; + "final": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, true, false, false>; + "is_final": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, true, false, false>; +}>; +type $SubclassableObject = $.ObjectType<"schema::SubclassableObject", $SubclassableObjectλShape, null, [ + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $SubclassableObject = $.makeType<$SubclassableObject>(_.spec, "f6a922d8-00ce-11ee-b4f7-25cfc3329b28", _.syntax.literal); + +const SubclassableObject: $.$expr_PathNode<$.TypeSet<$SubclassableObject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($SubclassableObject, $.Cardinality.Many), null); + +export type $InheritingObjectλShape = $.typeutil.flatten<$SubclassableObjectλShape & { + "bases": $.LinkDesc<$InheritingObject, $.Cardinality.Many, { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, false, false, false, false>; + "ancestors": $.LinkDesc<$InheritingObject, $.Cardinality.Many, { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, false, false, false, false>; + "inherited_fields": $.PropertyDesc<$.ArrayType<_std.$str>, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; +}>; +type $InheritingObject = $.ObjectType<"schema::InheritingObject", $InheritingObjectλShape, null, [ + ...$SubclassableObject['__exclusives__'], +]>; +const $InheritingObject = $.makeType<$InheritingObject>(_.spec, "f77488f6-00ce-11ee-ad9a-0f9b478e0ccb", _.syntax.literal); + +const InheritingObject: $.$expr_PathNode<$.TypeSet<$InheritingObject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($InheritingObject, $.Cardinality.Many), null); + +export type $AnnotationSubjectλShape = $.typeutil.flatten<$Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { + "annotations": $.LinkDesc<$Annotation, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@value": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne>; + }, false, false, false, false>; +}>; +type $AnnotationSubject = $.ObjectType<"schema::AnnotationSubject", $AnnotationSubjectλShape, null, [ + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $AnnotationSubject = $.makeType<$AnnotationSubject>(_.spec, "f75d65b8-00ce-11ee-b8ca-9fbba635c7d5", _.syntax.literal); + +const AnnotationSubject: $.$expr_PathNode<$.TypeSet<$AnnotationSubject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($AnnotationSubject, $.Cardinality.Many), null); + +export type $AccessPolicyλShape = $.typeutil.flatten<$InheritingObjectλShape & $AnnotationSubjectλShape & { + "subject": $.LinkDesc<$ObjectType, $.Cardinality.One, {}, false, false, false, false>; + "access_kinds": $.PropertyDesc<$AccessKind, $.Cardinality.Many, false, false, false, false>; + "condition": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "action": $.PropertyDesc<$AccessPolicyAction, $.Cardinality.One, false, false, false, false>; + "expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "errmessage": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; +}>; +type $AccessPolicy = $.ObjectType<"schema::AccessPolicy", $AccessPolicyλShape, null, [ + ...$InheritingObject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], +]>; +const $AccessPolicy = $.makeType<$AccessPolicy>(_.spec, "f82a23f0-00ce-11ee-b436-f94f74665490", _.syntax.literal); + +const AccessPolicy: $.$expr_PathNode<$.TypeSet<$AccessPolicy, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($AccessPolicy, $.Cardinality.Many), null); + +export type $AliasλShape = $.typeutil.flatten<$AnnotationSubjectλShape & { + "type": $.LinkDesc<$Type, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "expr": $.PropertyDesc<_std.$str, $.Cardinality.One, false, false, false, false>; +}>; +type $Alias = $.ObjectType<"schema::Alias", $AliasλShape, null, [ + ...$AnnotationSubject['__exclusives__'], +]>; +const $Alias = $.makeType<$Alias>(_.spec, "f87a08d4-00ce-11ee-b224-d712d3805a06", _.syntax.literal); + +const Alias: $.$expr_PathNode<$.TypeSet<$Alias, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Alias, $.Cardinality.Many), null); + +export type $AnnotationλShape = $.typeutil.flatten<$InheritingObjectλShape & $AnnotationSubjectλShape & { + "inheritable": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; +}>; +type $Annotation = $.ObjectType<"schema::Annotation", $AnnotationλShape, null, [ + ...$InheritingObject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], +]>; +const $Annotation = $.makeType<$Annotation>(_.spec, "f764c420-00ce-11ee-8f66-7d05ab6267e6", _.syntax.literal); + +const Annotation: $.$expr_PathNode<$.TypeSet<$Annotation, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Annotation, $.Cardinality.Many), null); + +export type $TypeλShape = $.typeutil.flatten<$SubclassableObjectλShape & $AnnotationSubjectλShape & { + "expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "from_alias": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, false>; + "is_from_alias": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, true, false, false>; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; +}>; +type $Type = $.ObjectType<"schema::Type", $TypeλShape, null, [ + ...$SubclassableObject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], +]>; +const $Type = $.makeType<$Type>(_.spec, "f6b286fc-00ce-11ee-942e-41e5d0296e7c", _.syntax.literal); + +const Type: $.$expr_PathNode<$.TypeSet<$Type, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Type, $.Cardinality.Many), null); + +export type $PrimitiveTypeλShape = $.typeutil.flatten<$TypeλShape & { +}>; +type $PrimitiveType = $.ObjectType<"schema::PrimitiveType", $PrimitiveTypeλShape, null, [ + ...$Type['__exclusives__'], +]>; +const $PrimitiveType = $.makeType<$PrimitiveType>(_.spec, "f6d3cf1a-00ce-11ee-b47c-9df37fb226d0", _.syntax.literal); + +const PrimitiveType: $.$expr_PathNode<$.TypeSet<$PrimitiveType, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($PrimitiveType, $.Cardinality.Many), null); + +export type $CollectionTypeλShape = $.typeutil.flatten<$PrimitiveTypeλShape & { +}>; +type $CollectionType = $.ObjectType<"schema::CollectionType", $CollectionTypeλShape, null, [ + ...$PrimitiveType['__exclusives__'], +]>; +const $CollectionType = $.makeType<$CollectionType>(_.spec, "f6dfa6f0-00ce-11ee-97ba-41f39467a640", _.syntax.literal); + +const CollectionType: $.$expr_PathNode<$.TypeSet<$CollectionType, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($CollectionType, $.Cardinality.Many), null); + +export type $ArrayλShape = $.typeutil.flatten<$CollectionTypeλShape & { + "element_type": $.LinkDesc<$Type, $.Cardinality.One, {}, false, false, false, false>; + "dimensions": $.PropertyDesc<$.ArrayType<_std.$int16>, $.Cardinality.AtMostOne, false, false, false, false>; +}>; +type $Array = $.ObjectType<"schema::Array", $ArrayλShape, null, [ + ...$CollectionType['__exclusives__'], +]>; +const $Array = $.makeType<$Array>(_.spec, "f6ec053a-00ce-11ee-9586-cfc0d3e5ee13", _.syntax.literal); + +const Array: $.$expr_PathNode<$.TypeSet<$Array, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Array, $.Cardinality.Many), null); + +export type $ArrayExprAliasλShape = $.typeutil.flatten<$ArrayλShape & { +}>; +type $ArrayExprAlias = $.ObjectType<"schema::ArrayExprAlias", $ArrayExprAliasλShape, null, [ + ...$Array['__exclusives__'], +]>; +const $ArrayExprAlias = $.makeType<$ArrayExprAlias>(_.spec, "f6fb3e42-00ce-11ee-8c89-49cb8fa85a63", _.syntax.literal); + +const ArrayExprAlias: $.$expr_PathNode<$.TypeSet<$ArrayExprAlias, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($ArrayExprAlias, $.Cardinality.Many), null); + +export type $CallableObjectλShape = $.typeutil.flatten<$AnnotationSubjectλShape & { + "params": $.LinkDesc<$Parameter, $.Cardinality.Many, { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, false, false, false, false>; + "return_type": $.LinkDesc<$Type, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "return_typemod": $.PropertyDesc<$TypeModifier, $.Cardinality.AtMostOne, false, false, false, false>; +}>; +type $CallableObject = $.ObjectType<"schema::CallableObject", $CallableObjectλShape, null, [ + ...$AnnotationSubject['__exclusives__'], +]>; +const $CallableObject = $.makeType<$CallableObject>(_.spec, "f790e4ec-00ce-11ee-84ea-ff4793c4439e", _.syntax.literal); + +const CallableObject: $.$expr_PathNode<$.TypeSet<$CallableObject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($CallableObject, $.Cardinality.Many), null); + +export type $VolatilitySubjectλShape = $.typeutil.flatten<$Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { + "volatility": $.PropertyDesc<$Volatility, $.Cardinality.AtMostOne, false, false, false, true>; +}>; +type $VolatilitySubject = $.ObjectType<"schema::VolatilitySubject", $VolatilitySubjectλShape, null, [ + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $VolatilitySubject = $.makeType<$VolatilitySubject>(_.spec, "f7a1ddce-00ce-11ee-8448-e591ea7d9e05", _.syntax.literal); + +const VolatilitySubject: $.$expr_PathNode<$.TypeSet<$VolatilitySubject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($VolatilitySubject, $.Cardinality.Many), null); + +export type $CastλShape = $.typeutil.flatten<$AnnotationSubjectλShape & $VolatilitySubjectλShape & { + "from_type": $.LinkDesc<$Type, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "to_type": $.LinkDesc<$Type, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "allow_implicit": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, false>; + "allow_assignment": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, false>; +}>; +type $Cast = $.ObjectType<"schema::Cast", $CastλShape, null, [ + ...$AnnotationSubject['__exclusives__'], + ...$VolatilitySubject['__exclusives__'], +]>; +const $Cast = $.makeType<$Cast>(_.spec, "fa603b64-00ce-11ee-ad36-ad2980a9b2be", _.syntax.literal); + +const Cast: $.$expr_PathNode<$.TypeSet<$Cast, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Cast, $.Cardinality.Many), null); + +export type $ConsistencySubjectλShape = $.typeutil.flatten<$InheritingObjectλShape & $AnnotationSubjectλShape & { + "constraints": $.LinkDesc<$Constraint, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, true, false, false, false>; + "; + "; +}>; +type $ConsistencySubject = $.ObjectType<"schema::ConsistencySubject", $ConsistencySubjectλShape, null, [ + ...$InheritingObject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], + {constraints: {__element__: $Constraint, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $ConsistencySubject = $.makeType<$ConsistencySubject>(_.spec, "f7c8eaa4-00ce-11ee-9304-2bdcaa809750", _.syntax.literal); + +const ConsistencySubject: $.$expr_PathNode<$.TypeSet<$ConsistencySubject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($ConsistencySubject, $.Cardinality.Many), null); + +export type $ConstraintλShape = $.typeutil.flatten & $InheritingObjectλShape & { + "subject": $.LinkDesc<$ConsistencySubject, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "params": $.LinkDesc<$Parameter, $.Cardinality.Many, { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + "@value": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne>; + }, false, false, false, false>; + "expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "subjectexpr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "finalexpr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "errmessage": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "delegated": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, false>; + "except_expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; + "; + "; + "; + "; + "; +}>; +type $Constraint = $.ObjectType<"schema::Constraint", $ConstraintλShape, null, [ + ...$CallableObject['__exclusives__'], + ...$InheritingObject['__exclusives__'], +]>; +const $Constraint = $.makeType<$Constraint>(_.spec, "f7aa4806-00ce-11ee-8a63-cb7b2e62984c", _.syntax.literal); + +const Constraint: $.$expr_PathNode<$.TypeSet<$Constraint, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Constraint, $.Cardinality.Many), null); + +export type $DeltaλShape = $.typeutil.flatten<$Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { + "parents": $.LinkDesc<$Delta, $.Cardinality.Many, {}, false, false, false, false>; + "; + "; +}>; +type $Delta = $.ObjectType<"schema::Delta", $DeltaλShape, null, [ + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $Delta = $.makeType<$Delta>(_.spec, "f7545ffe-00ce-11ee-a5a1-67c464728973", _.syntax.literal); + +const Delta: $.$expr_PathNode<$.TypeSet<$Delta, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Delta, $.Cardinality.Many), null); + +export type $ExtensionλShape = $.typeutil.flatten<$AnnotationSubjectλShape & $Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { + "package": $.LinkDesc<_sys.$ExtensionPackage, $.Cardinality.One, {}, true, false, false, false>; +}>; +type $Extension = $.ObjectType<"schema::Extension", $ExtensionλShape, null, [ + ...$AnnotationSubject['__exclusives__'], + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], + {package: {__element__: _sys.$ExtensionPackage, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $Extension = $.makeType<$Extension>(_.spec, "fa8f287a-00ce-11ee-b00a-bfff645ed8de", _.syntax.literal); + +const Extension: $.$expr_PathNode<$.TypeSet<$Extension, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Extension, $.Cardinality.Many), null); + +export type $FunctionλShape = $.typeutil.flatten<$CallableObjectλShape & $VolatilitySubjectλShape & { + "used_globals": $.LinkDesc<$Global, $.Cardinality.Many, { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, false, false, false, false>; + "body": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "language": $.PropertyDesc<_std.$str, $.Cardinality.One, false, false, false, false>; + "preserves_optionality": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, true>; +}>; +type $Function = $.ObjectType<"schema::Function", $FunctionλShape, null, [ + ...$CallableObject['__exclusives__'], + ...$VolatilitySubject['__exclusives__'], +]>; +const $Function = $.makeType<$Function>(_.spec, "fa27a7a4-00ce-11ee-825b-f9f5861cb2cb", _.syntax.literal); + +const Function: $.$expr_PathNode<$.TypeSet<$Function, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Function, $.Cardinality.Many), null); + +export type $FutureBehaviorλShape = $.typeutil.flatten<$Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { +}>; +type $FutureBehavior = $.ObjectType<"schema::FutureBehavior", $FutureBehaviorλShape, null, [ + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $FutureBehavior = $.makeType<$FutureBehavior>(_.spec, "faa16558-00ce-11ee-b39e-b72681f89a30", _.syntax.literal); + +const FutureBehavior: $.$expr_PathNode<$.TypeSet<$FutureBehavior, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($FutureBehavior, $.Cardinality.Many), null); + +export type $GlobalλShape = $.typeutil.flatten<$AnnotationSubjectλShape & { + "target": $.LinkDesc<$Type, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "required": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, false>; + "cardinality": $.PropertyDesc<$Cardinality, $.Cardinality.AtMostOne, false, false, false, false>; + "expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "default": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; +}>; +type $Global = $.ObjectType<"schema::Global", $GlobalλShape, null, [ + ...$AnnotationSubject['__exclusives__'], +]>; +const $Global = $.makeType<$Global>(_.spec, "fa109c76-00ce-11ee-ad72-b5b637b45df0", _.syntax.literal); + +const Global: $.$expr_PathNode<$.TypeSet<$Global, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Global, $.Cardinality.Many), null); + +export type $IndexλShape = $.typeutil.flatten<$InheritingObjectλShape & $AnnotationSubjectλShape & { + "params": $.LinkDesc<$Parameter, $.Cardinality.Many, { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, false, false, false, false>; + "except_expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "kwargs": $.PropertyDesc<$.ArrayType<$.NamedTupleType<{name: _std.$str, expr: _std.$str}>>, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; + "; + "; +}>; +type $Index = $.ObjectType<"schema::Index", $IndexλShape, null, [ + ...$InheritingObject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], +]>; +const $Index = $.makeType<$Index>(_.spec, "f7e1ab52-00ce-11ee-8871-4f9d7393c69d", _.syntax.literal); + +const Index: $.$expr_PathNode<$.TypeSet<$Index, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Index, $.Cardinality.Many), null); + +export type $PointerλShape = $.typeutil.flatten & $AnnotationSubjectλShape & { + "source": $.LinkDesc<$Source, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "target": $.LinkDesc<$Type, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "rewrites": $.LinkDesc<$Rewrite, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, true, false, false, false>; + "cardinality": $.PropertyDesc<$Cardinality, $.Cardinality.AtMostOne, false, false, false, false>; + "required": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, false>; + "readonly": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, false>; + "default": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; + "; + "; + "; + "; +}>; +type $Pointer = $.ObjectType<"schema::Pointer", $PointerλShape, null, [ + ...$ConsistencySubject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], + {rewrites: {__element__: $Rewrite, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $Pointer = $.makeType<$Pointer>(_.spec, "f80a5f2a-00ce-11ee-b36c-adcedcf77321", _.syntax.literal); + +const Pointer: $.$expr_PathNode<$.TypeSet<$Pointer, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Pointer, $.Cardinality.Many), null); + +export type $SourceλShape = $.typeutil.flatten<$Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { + "pointers": $.LinkDesc<$Pointer, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, true, false, false, false>; + "indexes": $.LinkDesc<$Index, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, true, false, false, false>; + "; + "; + "; + "; +}>; +type $Source = $.ObjectType<"schema::Source", $SourceλShape, null, [ + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], + {pointers: {__element__: $Pointer, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, + {indexes: {__element__: $Index, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $Source = $.makeType<$Source>(_.spec, "f7fd3e30-00ce-11ee-a75f-2776ba57fdf1", _.syntax.literal); + +const Source: $.$expr_PathNode<$.TypeSet<$Source, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Source, $.Cardinality.Many), null); + +export type $LinkλShape = $.typeutil.flatten & $SourceλShape & { + "target": $.LinkDesc<$ObjectType, $.Cardinality.AtMostOne, {}, false, false, false, false>; + "properties": $.LinkDesc<$Property, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, false, true, false, false>; + "on_target_delete": $.PropertyDesc<$TargetDeleteAction, $.Cardinality.AtMostOne, false, false, false, false>; + "on_source_delete": $.PropertyDesc<$SourceDeleteAction, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; +}>; +type $Link = $.ObjectType<"schema::Link", $LinkλShape, null, [ + ...$Pointer['__exclusives__'], + ...$Source['__exclusives__'], +]>; +const $Link = $.makeType<$Link>(_.spec, "f983bdc4-00ce-11ee-a888-850a734a82df", _.syntax.literal); + +const Link: $.$expr_PathNode<$.TypeSet<$Link, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Link, $.Cardinality.Many), null); + +export type $MigrationλShape = $.typeutil.flatten<$AnnotationSubjectλShape & $Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { + "parents": $.LinkDesc<$Migration, $.Cardinality.Many, {}, false, false, false, false>; + "script": $.PropertyDesc<_std.$str, $.Cardinality.One, false, false, false, false>; + "message": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "generated_by": $.PropertyDesc<$MigrationGeneratedBy, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; +}>; +type $Migration = $.ObjectType<"schema::Migration", $MigrationλShape, null, [ + ...$AnnotationSubject['__exclusives__'], + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $Migration = $.makeType<$Migration>(_.spec, "fa79cb10-00ce-11ee-a586-f5edefc65ae7", _.syntax.literal); + +const Migration: $.$expr_PathNode<$.TypeSet<$Migration, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Migration, $.Cardinality.Many), null); + +export type $ModuleλShape = $.typeutil.flatten<$AnnotationSubjectλShape & $Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { +}>; +type $Module = $.ObjectType<"schema::Module", $ModuleλShape, null, [ + ...$AnnotationSubject['__exclusives__'], + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $Module = $.makeType<$Module>(_.spec, "f6cd81b4-00ce-11ee-a3c1-93b65561868f", _.syntax.literal); + +const Module: $.$expr_PathNode<$.TypeSet<$Module, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Module, $.Cardinality.Many), null); + +export type $ObjectTypeλShape = $.typeutil.flatten<$SourceλShape & Omit<$ConsistencySubjectλShape, " & $InheritingObjectλShape & Omit<$TypeλShape, " & $AnnotationSubjectλShape & { + "union_of": $.LinkDesc<$ObjectType, $.Cardinality.Many, {}, false, false, false, false>; + "intersection_of": $.LinkDesc<$ObjectType, $.Cardinality.Many, {}, false, false, false, false>; + "properties": $.LinkDesc<$Property, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, false, true, false, false>; + "links": $.LinkDesc<$Link, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, false, true, false, false>; + "access_policies": $.LinkDesc<$AccessPolicy, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, true, false, false, false>; + "triggers": $.LinkDesc<$Trigger, $.Cardinality.Many, { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, true, false, false, false>; + "compound_type": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, true, false, false>; + "is_compound_type": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, true, false, false>; + "<__type__[is std::BaseObject]": $.LinkDesc<$.ObjectType, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::TupleElement]": $.LinkDesc<$TupleElement, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Object]": $.LinkDesc<$Object_f6a2efd000ce11eebcd68fb1bad207a0, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Delta]": $.LinkDesc<$Delta, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::VolatilitySubject]": $.LinkDesc<$VolatilitySubject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::AnnotationSubject]": $.LinkDesc<$AnnotationSubject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::SubclassableObject]": $.LinkDesc<$SubclassableObject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::InheritingObject]": $.LinkDesc<$InheritingObject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is std::Object]": $.LinkDesc<_std.$Object_f65d226600ce11ee81279554e3ef2585, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is std::FreeObject]": $.LinkDesc<_std.$FreeObject, $.Cardinality.Many, {}, false, false, false, false>; + "; + "; + "; + "; + "<__type__[is schema::FutureBehavior]": $.LinkDesc<$FutureBehavior, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is sys::SystemObject]": $.LinkDesc<_sys.$SystemObject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is sys::ExternalObject]": $.LinkDesc<_sys.$ExternalObject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is sys::Database]": $.LinkDesc<_sys.$Database, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is sys::ExtensionPackage]": $.LinkDesc<_sys.$ExtensionPackage, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is sys::Role]": $.LinkDesc<_sys.$Role, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::ConfigObject]": $.LinkDesc<_cfg.$ConfigObject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::AuthMethod]": $.LinkDesc<_cfg.$AuthMethod, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::Trust]": $.LinkDesc<_cfg.$Trust, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::SCRAM]": $.LinkDesc<_cfg.$SCRAM, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::JWT]": $.LinkDesc<_cfg.$JWT, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::Auth]": $.LinkDesc<_cfg.$Auth, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::AbstractConfig]": $.LinkDesc<_cfg.$AbstractConfig, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::Config]": $.LinkDesc<_cfg.$Config, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::InstanceConfig]": $.LinkDesc<_cfg.$InstanceConfig, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is cfg::DatabaseConfig]": $.LinkDesc<_cfg.$DatabaseConfig, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Annotation]": $.LinkDesc<$Annotation, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Type]": $.LinkDesc<$Type, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::PrimitiveType]": $.LinkDesc<$PrimitiveType, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::CollectionType]": $.LinkDesc<$CollectionType, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Array]": $.LinkDesc<$Array, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::ArrayExprAlias]": $.LinkDesc<$ArrayExprAlias, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Tuple]": $.LinkDesc<$Tuple, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::TupleExprAlias]": $.LinkDesc<$TupleExprAlias, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Range]": $.LinkDesc<$Range, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::RangeExprAlias]": $.LinkDesc<$RangeExprAlias, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Alias]": $.LinkDesc<$Alias, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Global]": $.LinkDesc<$Global, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Parameter]": $.LinkDesc<$Parameter, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::CallableObject]": $.LinkDesc<$CallableObject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Function]": $.LinkDesc<$Function, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Operator]": $.LinkDesc<$Operator, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Cast]": $.LinkDesc<$Cast, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Migration]": $.LinkDesc<$Migration, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Module]": $.LinkDesc<$Module, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::PseudoType]": $.LinkDesc<$PseudoType, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Constraint]": $.LinkDesc<$Constraint, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::ConsistencySubject]": $.LinkDesc<$ConsistencySubject, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Rewrite]": $.LinkDesc<$Rewrite, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Pointer]": $.LinkDesc<$Pointer, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Property]": $.LinkDesc<$Property, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::ScalarType]": $.LinkDesc<$ScalarType, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Index]": $.LinkDesc<$Index, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Source]": $.LinkDesc<$Source, $.Cardinality.Many, {}, false, false, false, false>; + "; + "<__type__[is schema::Link]": $.LinkDesc<$Link, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::AccessPolicy]": $.LinkDesc<$AccessPolicy, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Trigger]": $.LinkDesc<$Trigger, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::ObjectType]": $.LinkDesc<$ObjectType, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is schema::Extension]": $.LinkDesc<$Extension, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__[is Person]": $.LinkDesc<_default.$Person, $.Cardinality.Many, {}, false, false, false, false>; + "<__type__": $.LinkDesc<$.ObjectType, $.Cardinality.Many, {}, false, false, false, false>; + "; + "; + "; + "; +}>; +type $ObjectType = $.ObjectType<"schema::ObjectType", $ObjectTypeλShape, null, [ + ...$Source['__exclusives__'], + ...$ConsistencySubject['__exclusives__'], + ...$InheritingObject['__exclusives__'], + ...$Type['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], + {access_policies: {__element__: $AccessPolicy, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, + {triggers: {__element__: $Trigger, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $ObjectType = $.makeType<$ObjectType>(_.spec, "f8b292a8-00ce-11ee-ae22-e1500e4da23e", _.syntax.literal); + +const ObjectType: $.$expr_PathNode<$.TypeSet<$ObjectType, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($ObjectType, $.Cardinality.Many), null); + +export type $OperatorλShape = $.typeutil.flatten<$CallableObjectλShape & $VolatilitySubjectλShape & { + "operator_kind": $.PropertyDesc<$OperatorKind, $.Cardinality.AtMostOne, false, false, false, false>; + "is_abstract": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, true, false, true>; + "abstract": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne, false, false, false, true>; +}>; +type $Operator = $.ObjectType<"schema::Operator", $OperatorλShape, null, [ + ...$CallableObject['__exclusives__'], + ...$VolatilitySubject['__exclusives__'], +]>; +const $Operator = $.makeType<$Operator>(_.spec, "fa44de28-00ce-11ee-9420-a3788dfb5ecc", _.syntax.literal); + +const Operator: $.$expr_PathNode<$.TypeSet<$Operator, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Operator, $.Cardinality.Many), null); + +export type $ParameterλShape = $.typeutil.flatten<$Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { + "type": $.LinkDesc<$Type, $.Cardinality.One, {}, false, false, false, false>; + "typemod": $.PropertyDesc<$TypeModifier, $.Cardinality.One, false, false, false, false>; + "kind": $.PropertyDesc<$ParameterKind, $.Cardinality.One, false, false, false, false>; + "num": $.PropertyDesc<_std.$int64, $.Cardinality.One, false, false, false, false>; + "default": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; + "; + "; + "; + "; +}>; +type $Parameter = $.ObjectType<"schema::Parameter", $ParameterλShape, null, [ + ...$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $Parameter = $.makeType<$Parameter>(_.spec, "f78508ca-00ce-11ee-80fb-c9fd5bb52360", _.syntax.literal); + +const Parameter: $.$expr_PathNode<$.TypeSet<$Parameter, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Parameter, $.Cardinality.Many), null); + +export type $PropertyλShape = $.typeutil.flatten<$PointerλShape & { + "; + "; + "; +}>; +type $Property = $.ObjectType<"schema::Property", $PropertyλShape, null, [ + ...$Pointer['__exclusives__'], +]>; +const $Property = $.makeType<$Property>(_.spec, "f9b6a658-00ce-11ee-843e-454fc4386b5d", _.syntax.literal); + +const Property: $.$expr_PathNode<$.TypeSet<$Property, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Property, $.Cardinality.Many), null); + +export type $PseudoTypeλShape = $.typeutil.flatten<$InheritingObjectλShape & $TypeλShape & { +}>; +type $PseudoType = $.ObjectType<"schema::PseudoType", $PseudoTypeλShape, null, [ + ...$InheritingObject['__exclusives__'], + ...$Type['__exclusives__'], +]>; +const $PseudoType = $.makeType<$PseudoType>(_.spec, "f6bbea8a-00ce-11ee-9b3a-63e39fbe278d", _.syntax.literal); + +const PseudoType: $.$expr_PathNode<$.TypeSet<$PseudoType, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($PseudoType, $.Cardinality.Many), null); + +export type $RangeλShape = $.typeutil.flatten<$CollectionTypeλShape & { + "element_type": $.LinkDesc<$Type, $.Cardinality.One, {}, false, false, false, false>; +}>; +type $Range = $.ObjectType<"schema::Range", $RangeλShape, null, [ + ...$CollectionType['__exclusives__'], +]>; +const $Range = $.makeType<$Range>(_.spec, "f734ad76-00ce-11ee-8f53-7166bafda910", _.syntax.literal); + +const Range: $.$expr_PathNode<$.TypeSet<$Range, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Range, $.Cardinality.Many), null); + +export type $RangeExprAliasλShape = $.typeutil.flatten<$RangeλShape & { +}>; +type $RangeExprAlias = $.ObjectType<"schema::RangeExprAlias", $RangeExprAliasλShape, null, [ + ...$Range['__exclusives__'], +]>; +const $RangeExprAlias = $.makeType<$RangeExprAlias>(_.spec, "f744704e-00ce-11ee-8187-9dc6035eb6e0", _.syntax.literal); + +const RangeExprAlias: $.$expr_PathNode<$.TypeSet<$RangeExprAlias, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($RangeExprAlias, $.Cardinality.Many), null); + +export type $RewriteλShape = $.typeutil.flatten<$InheritingObjectλShape & $AnnotationSubjectλShape & { + "subject": $.LinkDesc<$Pointer, $.Cardinality.One, {}, false, false, false, false>; + "kind": $.PropertyDesc<$TriggerKind, $.Cardinality.One, false, false, false, false>; + "expr": $.PropertyDesc<_std.$str, $.Cardinality.One, false, false, false, false>; + "; + "; + "; + "; +}>; +type $Rewrite = $.ObjectType<"schema::Rewrite", $RewriteλShape, null, [ + ...$InheritingObject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], +]>; +const $Rewrite = $.makeType<$Rewrite>(_.spec, "f85b2b44-00ce-11ee-8d22-ffed3b83d6d8", _.syntax.literal); + +const Rewrite: $.$expr_PathNode<$.TypeSet<$Rewrite, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Rewrite, $.Cardinality.Many), null); + +export type $ScalarTypeλShape = $.typeutil.flatten<$PrimitiveTypeλShape & $ConsistencySubjectλShape & $AnnotationSubjectλShape & { + "default": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "enum_values": $.PropertyDesc<$.ArrayType<_std.$str>, $.Cardinality.AtMostOne, false, false, false, false>; +}>; +type $ScalarType = $.ObjectType<"schema::ScalarType", $ScalarTypeλShape, null, [ + ...$PrimitiveType['__exclusives__'], + ...$ConsistencySubject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], +]>; +const $ScalarType = $.makeType<$ScalarType>(_.spec, "f88af61c-00ce-11ee-b035-cb29f59d0ddd", _.syntax.literal); + +const ScalarType: $.$expr_PathNode<$.TypeSet<$ScalarType, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($ScalarType, $.Cardinality.Many), null); + +export type $TriggerλShape = $.typeutil.flatten<$InheritingObjectλShape & $AnnotationSubjectλShape & { + "subject": $.LinkDesc<$ObjectType, $.Cardinality.One, {}, false, false, false, false>; + "timing": $.PropertyDesc<$TriggerTiming, $.Cardinality.One, false, false, false, false>; + "kinds": $.PropertyDesc<$TriggerKind, $.Cardinality.Many, false, false, false, false>; + "scope": $.PropertyDesc<$TriggerScope, $.Cardinality.One, false, false, false, false>; + "expr": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; +}>; +type $Trigger = $.ObjectType<"schema::Trigger", $TriggerλShape, null, [ + ...$InheritingObject['__exclusives__'], + ...$AnnotationSubject['__exclusives__'], +]>; +const $Trigger = $.makeType<$Trigger>(_.spec, "f8426e88-00ce-11ee-b13a-cbafb5668af9", _.syntax.literal); + +const Trigger: $.$expr_PathNode<$.TypeSet<$Trigger, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Trigger, $.Cardinality.Many), null); + +export type $TupleλShape = $.typeutil.flatten<$CollectionTypeλShape & { + "element_types": $.LinkDesc<$TupleElement, $.Cardinality.Many, { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, true, false, false, false>; + "named": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, false, false, false>; +}>; +type $Tuple = $.ObjectType<"schema::Tuple", $TupleλShape, null, [ + ...$CollectionType['__exclusives__'], + {element_types: {__element__: $TupleElement, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $Tuple = $.makeType<$Tuple>(_.spec, "f7106c22-00ce-11ee-a6d8-47f517556119", _.syntax.literal); + +const Tuple: $.$expr_PathNode<$.TypeSet<$Tuple, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Tuple, $.Cardinality.Many), null); + +export type $TupleElementλShape = $.typeutil.flatten<_std.$BaseObjectλShape & { + "type": $.LinkDesc<$Type, $.Cardinality.One, {}, false, false, false, false>; + "name": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; + "; +}>; +type $TupleElement = $.ObjectType<"schema::TupleElement", $TupleElementλShape, null, [ + ..._std.$BaseObject['__exclusives__'], +]>; +const $TupleElement = $.makeType<$TupleElement>(_.spec, "f70ac966-00ce-11ee-a7ba-835feeaa6367", _.syntax.literal); + +const TupleElement: $.$expr_PathNode<$.TypeSet<$TupleElement, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($TupleElement, $.Cardinality.Many), null); + +export type $TupleExprAliasλShape = $.typeutil.flatten<$TupleλShape & { +}>; +type $TupleExprAlias = $.ObjectType<"schema::TupleExprAlias", $TupleExprAliasλShape, null, [ + ...$Tuple['__exclusives__'], +]>; +const $TupleExprAlias = $.makeType<$TupleExprAlias>(_.spec, "f72209e6-00ce-11ee-9575-87af33185b71", _.syntax.literal); + +const TupleExprAlias: $.$expr_PathNode<$.TypeSet<$TupleExprAlias, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($TupleExprAlias, $.Cardinality.Many), null); + + + +export { AccessKind, AccessPolicyAction, Cardinality, MigrationGeneratedBy, OperatorKind, ParameterKind, RewriteKind, SourceDeleteAction, TargetDeleteAction, TriggerKind, TriggerScope, TriggerTiming, TypeModifier, Volatility, $Object_f6a2efd000ce11eebcd68fb1bad207a0, Object_f6a2efd000ce11eebcd68fb1bad207a0, $SubclassableObject, SubclassableObject, $InheritingObject, InheritingObject, $AnnotationSubject, AnnotationSubject, $AccessPolicy, AccessPolicy, $Alias, Alias, $Annotation, Annotation, $Type, Type, $PrimitiveType, PrimitiveType, $CollectionType, CollectionType, $Array, Array, $ArrayExprAlias, ArrayExprAlias, $CallableObject, CallableObject, $VolatilitySubject, VolatilitySubject, $Cast, Cast, $ConsistencySubject, ConsistencySubject, $Constraint, Constraint, $Delta, Delta, $Extension, Extension, $Function, Function, $FutureBehavior, FutureBehavior, $Global, Global, $Index, Index, $Pointer, Pointer, $Source, Source, $Link, Link, $Migration, Migration, $Module, Module, $ObjectType, ObjectType, $Operator, Operator, $Parameter, Parameter, $Property, Property, $PseudoType, PseudoType, $Range, Range, $RangeExprAlias, RangeExprAlias, $Rewrite, Rewrite, $ScalarType, ScalarType, $Trigger, Trigger, $Tuple, Tuple, $TupleElement, TupleElement, $TupleExprAlias, TupleExprAlias }; + +type __defaultExports = { + "AccessKind": typeof AccessKind; + "AccessPolicyAction": typeof AccessPolicyAction; + "Cardinality": typeof Cardinality; + "MigrationGeneratedBy": typeof MigrationGeneratedBy; + "OperatorKind": typeof OperatorKind; + "ParameterKind": typeof ParameterKind; + "RewriteKind": typeof RewriteKind; + "SourceDeleteAction": typeof SourceDeleteAction; + "TargetDeleteAction": typeof TargetDeleteAction; + "TriggerKind": typeof TriggerKind; + "TriggerScope": typeof TriggerScope; + "TriggerTiming": typeof TriggerTiming; + "TypeModifier": typeof TypeModifier; + "Volatility": typeof Volatility; + "Object": typeof Object_f6a2efd000ce11eebcd68fb1bad207a0; + "SubclassableObject": typeof SubclassableObject; + "InheritingObject": typeof InheritingObject; + "AnnotationSubject": typeof AnnotationSubject; + "AccessPolicy": typeof AccessPolicy; + "Alias": typeof Alias; + "Annotation": typeof Annotation; + "Type": typeof Type; + "PrimitiveType": typeof PrimitiveType; + "CollectionType": typeof CollectionType; + "Array": typeof Array; + "ArrayExprAlias": typeof ArrayExprAlias; + "CallableObject": typeof CallableObject; + "VolatilitySubject": typeof VolatilitySubject; + "Cast": typeof Cast; + "ConsistencySubject": typeof ConsistencySubject; + "Constraint": typeof Constraint; + "Delta": typeof Delta; + "Extension": typeof Extension; + "Function": typeof Function; + "FutureBehavior": typeof FutureBehavior; + "Global": typeof Global; + "Index": typeof Index; + "Pointer": typeof Pointer; + "Source": typeof Source; + "Link": typeof Link; + "Migration": typeof Migration; + "Module": typeof Module; + "ObjectType": typeof ObjectType; + "Operator": typeof Operator; + "Parameter": typeof Parameter; + "Property": typeof Property; + "PseudoType": typeof PseudoType; + "Range": typeof Range; + "RangeExprAlias": typeof RangeExprAlias; + "Rewrite": typeof Rewrite; + "ScalarType": typeof ScalarType; + "Trigger": typeof Trigger; + "Tuple": typeof Tuple; + "TupleElement": typeof TupleElement; + "TupleExprAlias": typeof TupleExprAlias +}; +const __defaultExports: __defaultExports = { + "AccessKind": AccessKind, + "AccessPolicyAction": AccessPolicyAction, + "Cardinality": Cardinality, + "MigrationGeneratedBy": MigrationGeneratedBy, + "OperatorKind": OperatorKind, + "ParameterKind": ParameterKind, + "RewriteKind": RewriteKind, + "SourceDeleteAction": SourceDeleteAction, + "TargetDeleteAction": TargetDeleteAction, + "TriggerKind": TriggerKind, + "TriggerScope": TriggerScope, + "TriggerTiming": TriggerTiming, + "TypeModifier": TypeModifier, + "Volatility": Volatility, + "Object": Object_f6a2efd000ce11eebcd68fb1bad207a0, + "SubclassableObject": SubclassableObject, + "InheritingObject": InheritingObject, + "AnnotationSubject": AnnotationSubject, + "AccessPolicy": AccessPolicy, + "Alias": Alias, + "Annotation": Annotation, + "Type": Type, + "PrimitiveType": PrimitiveType, + "CollectionType": CollectionType, + "Array": Array, + "ArrayExprAlias": ArrayExprAlias, + "CallableObject": CallableObject, + "VolatilitySubject": VolatilitySubject, + "Cast": Cast, + "ConsistencySubject": ConsistencySubject, + "Constraint": Constraint, + "Delta": Delta, + "Extension": Extension, + "Function": Function, + "FutureBehavior": FutureBehavior, + "Global": Global, + "Index": Index, + "Pointer": Pointer, + "Source": Source, + "Link": Link, + "Migration": Migration, + "Module": Module, + "ObjectType": ObjectType, + "Operator": Operator, + "Parameter": Parameter, + "Property": Property, + "PseudoType": PseudoType, + "Range": Range, + "RangeExprAlias": RangeExprAlias, + "Rewrite": Rewrite, + "ScalarType": ScalarType, + "Trigger": Trigger, + "Tuple": Tuple, + "TupleElement": TupleElement, + "TupleExprAlias": TupleExprAlias +}; +export default __defaultExports; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/std.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/std.ts new file mode 100644 index 000000000..da7d7a0f0 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/std.ts @@ -0,0 +1,4493 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _cfg from "./cfg"; +import type * as _cal from "./cal"; +import type * as _schema from "./schema"; +type $anyscalar = $anypoint | $anyreal | $.EnumType | $bool | $bytes | $uuid | $str | $json | _cfg.$memory | _cal.$local_time | _cal.$relative_duration | _cal.$date_duration; + +type $anypoint = $anydiscrete | $anycontiguous; + +type $anydiscrete = $number | _cal.$local_date; + +type $anycontiguous = $anyfloat | $datetime | $duration | $decimal | _cal.$local_datetime; + +export type $JsonEmpty = { + "ReturnEmpty": $.$expr_Literal<$JsonEmpty>; + "ReturnTarget": $.$expr_Literal<$JsonEmpty>; + "Error": $.$expr_Literal<$JsonEmpty>; + "UseNull": $.$expr_Literal<$JsonEmpty>; + "DeleteKey": $.$expr_Literal<$JsonEmpty>; +} & $.EnumType<"std::JsonEmpty", ["ReturnEmpty", "ReturnTarget", "Error", "UseNull", "DeleteKey"]>; +const JsonEmpty: $JsonEmpty = $.makeType<$JsonEmpty>(_.spec, "f5605612-00ce-11ee-a03c-edc23ae8c3f9", _.syntax.literal); + +type $anyreal = $anyint | $anyfloat | $anynumeric; + +type $anyfloat = $number; + +type $anyint = $number | $bigint; + +type $anynumeric = $decimal | $bigint; + +export type $bigint = $.ScalarType<"std::bigint", bigint>; +const bigint: $.scalarTypeWithConstructor<$bigint, never> = $.makeType<$.scalarTypeWithConstructor<$bigint, never>>(_.spec, "00000000-0000-0000-0000-000000000110", _.syntax.literal); + +export type $bool = $.ScalarType<"std::bool", boolean>; +const bool: $.scalarTypeWithConstructor<$bool, never> = $.makeType<$.scalarTypeWithConstructor<$bool, never>>(_.spec, "00000000-0000-0000-0000-000000000109", _.syntax.literal); + +export type $bytes = $.ScalarType<"std::bytes", Uint8Array>; +const bytes: $.scalarTypeWithConstructor<$bytes, never> = $.makeType<$.scalarTypeWithConstructor<$bytes, never>>(_.spec, "00000000-0000-0000-0000-000000000102", _.syntax.literal); + +export type $datetime = $.ScalarType<"std::datetime", Date>; +const datetime: $.scalarTypeWithConstructor<$datetime, string> = $.makeType<$.scalarTypeWithConstructor<$datetime, string>>(_.spec, "00000000-0000-0000-0000-00000000010a", _.syntax.literal); + +export type $decimal = $.ScalarType<"std::decimal", string>; +const decimal: $.scalarTypeWithConstructor<$decimal, never> = $.makeType<$.scalarTypeWithConstructor<$decimal, never>>(_.spec, "00000000-0000-0000-0000-000000000108", _.syntax.literal); +export type $decimalλICastableTo = $decimal | $bigint; +export type $decimalλIAssignableBy = $decimal | $bigint; + +export type $duration = $.ScalarType<"std::duration", _.edgedb.Duration>; +const duration: $.scalarTypeWithConstructor<$duration, string> = $.makeType<$.scalarTypeWithConstructor<$duration, string>>(_.spec, "00000000-0000-0000-0000-00000000010e", _.syntax.literal); + +export type $float32 = $.ScalarType<"std::number", number>; +const float32: $.scalarTypeWithConstructor<$number, string> = $.makeType<$.scalarTypeWithConstructor<$number, string>>(_.spec, "00000000-0000-0000-0000-000000000106", _.syntax.literal); + +export type $float64 = $.ScalarType<"std::number", number>; +const float64: $.scalarTypeWithConstructor<$number, string> = $.makeType<$.scalarTypeWithConstructor<$number, string>>(_.spec, "00000000-0000-0000-0000-000000000107", _.syntax.literal); + +export type $int16 = $.ScalarType<"std::number", number>; +const int16: $.scalarTypeWithConstructor<$number, string> = $.makeType<$.scalarTypeWithConstructor<$number, string>>(_.spec, "00000000-0000-0000-0000-000000000103", _.syntax.literal); + +export type $int32 = $.ScalarType<"std::number", number>; +const int32: $.scalarTypeWithConstructor<$number, string> = $.makeType<$.scalarTypeWithConstructor<$number, string>>(_.spec, "00000000-0000-0000-0000-000000000104", _.syntax.literal); + +export type $int64 = $.ScalarType<"std::number", number>; +const int64: $.scalarTypeWithConstructor<$number, string> = $.makeType<$.scalarTypeWithConstructor<$number, string>>(_.spec, "00000000-0000-0000-0000-000000000105", _.syntax.literal); + +export type $json = $.ScalarType<"std::json", unknown>; +const json: $.scalarTypeWithConstructor<$json, never> = $.makeType<$.scalarTypeWithConstructor<$json, never>>(_.spec, "00000000-0000-0000-0000-00000000010f", _.syntax.literal); + +interface $sequence extends $int64 {} +const $sequence: $sequence = $.makeType<$sequence>(_.spec, "f2728a56-00ce-11ee-a0f8-bb42d858e819", _.syntax.literal); + +export type $str = $.ScalarType<"std::str", string>; +const str: $.scalarTypeWithConstructor<$str, never> = $.makeType<$.scalarTypeWithConstructor<$str, never>>(_.spec, "00000000-0000-0000-0000-000000000101", _.syntax.literal); + +export type $uuid = $.ScalarType<"std::uuid", string>; +const uuid: $.scalarTypeWithConstructor<$uuid, never> = $.makeType<$.scalarTypeWithConstructor<$uuid, never>>(_.spec, "00000000-0000-0000-0000-000000000100", _.syntax.literal); + +export type $number = $.ScalarType<"std::number", number>; +const number: $.scalarTypeWithConstructor<$number, string> = $.makeType<$.scalarTypeWithConstructor<$number, string>>(_.spec, "00000000-0000-0000-0000-0000000001ff", _.syntax.literal); + +export type $BaseObjectλShape = $.typeutil.flatten<{ + "__type__": $.LinkDesc<_schema.$ObjectType, $.Cardinality.One, {}, false, false, true, false>; + "id": $.PropertyDesc<$uuid, $.Cardinality.One, true, false, true, true>; +}>; +type $BaseObject = $.ObjectType<"std::BaseObject", $BaseObjectλShape, null, [ + {id: {__element__: $uuid, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $BaseObject = $.makeType<$BaseObject>(_.spec, "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", _.syntax.literal); + +const BaseObject: $.$expr_PathNode<$.TypeSet<$BaseObject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($BaseObject, $.Cardinality.Many), null); + +export type $Object_f65d226600ce11ee81279554e3ef2585λShape = $.typeutil.flatten<$BaseObjectλShape & { +}>; +type $Object_f65d226600ce11ee81279554e3ef2585 = $.ObjectType<"std::Object", $Object_f65d226600ce11ee81279554e3ef2585λShape, null, [ + ...$BaseObject['__exclusives__'], +]>; +export type $Object = $Object_f65d226600ce11ee81279554e3ef2585 +const $Object_f65d226600ce11ee81279554e3ef2585 = $.makeType<$Object_f65d226600ce11ee81279554e3ef2585>(_.spec, "f65d2266-00ce-11ee-8127-9554e3ef2585", _.syntax.literal); + +const Object_f65d226600ce11ee81279554e3ef2585: $.$expr_PathNode<$.TypeSet<$Object_f65d226600ce11ee81279554e3ef2585, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Object_f65d226600ce11ee81279554e3ef2585, $.Cardinality.Many), null); + +export type $FreeObjectλShape = $.typeutil.flatten<$BaseObjectλShape & { +}>; +type $FreeObject = $.ObjectType<"std::FreeObject", $FreeObjectλShape, null, [ + ...$BaseObject['__exclusives__'], +]>; +const $FreeObject = $.makeType<$FreeObject>(_.spec, "f660a864-00ce-11ee-bd14-a57f5f2fee33", _.syntax.literal); + +const FreeObject: $.$expr_PathNode<$.TypeSet<$FreeObject, $.Cardinality.One>, null> = _.syntax.$PathNode($.$toSet($FreeObject, $.Cardinality.One), null); + +type assert_singleλFuncExpr< + NamedArgs extends { + "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.multiplyCardinalities<$.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One">, $.cardutil.optionalParamCardinality> +>; +type assert_singleλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +/** + * Check that the input set contains at most one element, raise + CardinalityViolationError otherwise. + */ +function assert_single< + NamedArgs extends { + "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + namedArgs: NamedArgs, + input: P1, +): assert_singleλFuncExpr; +/** + * Check that the input set contains at most one element, raise + CardinalityViolationError otherwise. + */ +function assert_single< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + input: P1, +): assert_singleλFuncExpr2; +function assert_single(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::assert_single', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], namedArgs: {"message": {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "OptionalType", preservesOptionality: true}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::assert_single", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type assert_existsλFuncExpr< + NamedArgs extends { + "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, "One"> +>; +type assert_existsλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, "One"> +>; +/** + * Check that the input set contains at least one element, raise + CardinalityViolationError otherwise. + */ +function assert_exists< + NamedArgs extends { + "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + namedArgs: NamedArgs, + input: P1, +): assert_existsλFuncExpr; +/** + * Check that the input set contains at least one element, raise + CardinalityViolationError otherwise. + */ +function assert_exists< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + input: P1, +): assert_existsλFuncExpr2; +function assert_exists(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::assert_exists', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], namedArgs: {"message": {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::assert_exists", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type assert_distinctλFuncExpr< + NamedArgs extends { + "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.Cardinality.Many +>; +type assert_distinctλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.Cardinality.Many +>; +/** + * Check that the input set is a proper set, i.e. all elements + are unique + */ +function assert_distinct< + NamedArgs extends { + "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + namedArgs: NamedArgs, + input: P1, +): assert_distinctλFuncExpr; +/** + * Check that the input set is a proper set, i.e. all elements + are unique + */ +function assert_distinct< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + input: P1, +): assert_distinctλFuncExpr2; +function assert_distinct(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::assert_distinct', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], namedArgs: {"message": {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType", preservesOptionality: true}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::assert_distinct", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type assertλFuncExpr< + NamedArgs extends { + "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type assertλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +> = $.$expr_Function< + $bool, $.cardutil.paramCardinality +>; +/** + * Assert that a boolean value is true. + */ +function assert< + NamedArgs extends { + "message"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +>( + namedArgs: NamedArgs, + input: P1, +): assertλFuncExpr; +/** + * Assert that a boolean value is true. + */ +function assert< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +>( + input: P1, +): assertλFuncExpr2; +function assert(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::assert', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], namedArgs: {"message": {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::assert", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type lenλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, $.cardutil.paramCardinality +>; +type lenλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +> = $.$expr_Function< + $number, $.cardutil.paramCardinality +>; +type lenλFuncExpr3< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, +> = $.$expr_Function< + $number, $.cardutil.paramCardinality +>; +/** + * A polymorphic function to calculate a "length" of its first argument. + */ +function len< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + str: P1, +): lenλFuncExpr; +/** + * A polymorphic function to calculate a "length" of its first argument. + */ +function len< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +>( + bytes: P1, +): lenλFuncExpr2; +/** + * A polymorphic function to calculate a "length" of its first argument. + */ +function len< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, +>( + array: P1, +): lenλFuncExpr3; +function len(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::len', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::len", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type sumλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, +> = $.$expr_Function< + $bigint, $.Cardinality.One +>; +type sumλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.Cardinality.One +>; +type sumλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +> = $.$expr_Function< + $decimal, $.Cardinality.One +>; +/** + * Return the sum of the set of numbers. + */ +function sum< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, +>( + s: P1, +): sumλFuncExpr; +/** + * Return the sum of the set of numbers. + */ +function sum< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + s: P1, +): sumλFuncExpr2; +/** + * Return the sum of the set of numbers. + */ +function sum< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +>( + s: P1, +): sumλFuncExpr3; +function sum(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::sum', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::sum", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type countλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $number, $.Cardinality.One +>; +/** + * Return the number of elements in a set. + */ +function count< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + s: P1, +): countλFuncExpr; +function count(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::count', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::count", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type randomλFuncExpr = $.$expr_Function< + $number, $.Cardinality.One +>; +/** + * Return a pseudo-random number in the range `0.0 <= x < 1.0` + */ +function random(): randomλFuncExpr; +function random(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::random', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::random", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type minλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$anyreal>>, +> = $.$expr_Function< + $anyreal, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +> = $.$expr_Function< + $.EnumType, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, +> = $.$expr_Function< + $datetime, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr5< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +> = $.$expr_Function< + $duration, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr6< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +> = $.$expr_Function< + _cal.$local_date, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr7< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +> = $.$expr_Function< + _cal.$local_time, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr8< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +> = $.$expr_Function< + _cal.$date_duration, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr9< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +> = $.$expr_Function< + $.ArrayType<_cal.$local_datetime>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr10< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_date>>, +> = $.$expr_Function< + $.ArrayType<_cal.$local_date>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr11< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_time>>, +> = $.$expr_Function< + $.ArrayType<_cal.$local_time>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr12< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +> = $.$expr_Function< + $.ArrayType<_cal.$relative_duration>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr13< + P1 extends $.TypeSet<$.ArrayType<_cal.$date_duration>>, +> = $.$expr_Function< + $.ArrayType<_cal.$date_duration>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr14< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +> = $.$expr_Function< + _cal.$local_datetime, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr15< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +> = $.$expr_Function< + _cal.$relative_duration, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr16< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$anyreal>>, +>( + vals: P1, +): minλFuncExpr; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + vals: P1, +): minλFuncExpr2; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + vals: P1, +): minλFuncExpr3; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, +>( + vals: P1, +): minλFuncExpr4; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +>( + vals: P1, +): minλFuncExpr5; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + vals: P1, +): minλFuncExpr6; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + vals: P1, +): minλFuncExpr7; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +>( + vals: P1, +): minλFuncExpr8; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + vals: P1, +): minλFuncExpr9; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_date>>, +>( + vals: P1, +): minλFuncExpr10; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_time>>, +>( + vals: P1, +): minλFuncExpr11; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + vals: P1, +): minλFuncExpr12; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends $.TypeSet<$.ArrayType<_cal.$date_duration>>, +>( + vals: P1, +): minλFuncExpr13; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + vals: P1, +): minλFuncExpr14; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + vals: P1, +): minλFuncExpr15; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + vals: P1, +): minλFuncExpr16; +function min(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::min', args, _.spec, [ + {args: [{typeId: "f26e79f2-00ce-11ee-9118-f1407ce497dc", optional: false, setoftype: true, variadic: false}], returnTypeId: "f26e79f2-00ce-11ee-9118-f1407ce497dc", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: true, variadic: false}], returnTypeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010e", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000112", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd1bc2d8-00ce-11ee-8b70-7dd6dc2c48b6", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd1bc2d8-00ce-11ee-8b70-7dd6dc2c48b6", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd1d7376-00ce-11ee-b763-413434491d30", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd1d7376-00ce-11ee-b763-413434491d30", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd1f277a-00ce-11ee-b99d-b53ad971bf10", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd1f277a-00ce-11ee-b99d-b53ad971bf10", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd20d958-00ce-11ee-8cac-8b65221a1976", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd20d958-00ce-11ee-8cac-8b65221a1976", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd2299a0-00ce-11ee-99a8-13f657817dd3", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd2299a0-00ce-11ee-99a8-13f657817dd3", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "OptionalType", preservesOptionality: true}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::min", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type maxλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$anyreal>>, +> = $.$expr_Function< + $anyreal, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +> = $.$expr_Function< + $.EnumType, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, +> = $.$expr_Function< + $datetime, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr5< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +> = $.$expr_Function< + $duration, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr6< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +> = $.$expr_Function< + _cal.$local_date, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr7< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +> = $.$expr_Function< + _cal.$local_time, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr8< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +> = $.$expr_Function< + _cal.$date_duration, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr9< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +> = $.$expr_Function< + $.ArrayType<_cal.$local_datetime>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr10< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_date>>, +> = $.$expr_Function< + $.ArrayType<_cal.$local_date>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr11< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_time>>, +> = $.$expr_Function< + $.ArrayType<_cal.$local_time>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr12< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +> = $.$expr_Function< + $.ArrayType<_cal.$relative_duration>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr13< + P1 extends $.TypeSet<$.ArrayType<_cal.$date_duration>>, +> = $.$expr_Function< + $.ArrayType<_cal.$date_duration>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr14< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +> = $.$expr_Function< + _cal.$relative_duration, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr15< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +> = $.$expr_Function< + _cal.$local_datetime, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr16< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$anyreal>>, +>( + vals: P1, +): maxλFuncExpr; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + vals: P1, +): maxλFuncExpr2; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + vals: P1, +): maxλFuncExpr3; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, +>( + vals: P1, +): maxλFuncExpr4; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +>( + vals: P1, +): maxλFuncExpr5; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + vals: P1, +): maxλFuncExpr6; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + vals: P1, +): maxλFuncExpr7; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +>( + vals: P1, +): maxλFuncExpr8; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + vals: P1, +): maxλFuncExpr9; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_date>>, +>( + vals: P1, +): maxλFuncExpr10; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_time>>, +>( + vals: P1, +): maxλFuncExpr11; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + vals: P1, +): maxλFuncExpr12; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends $.TypeSet<$.ArrayType<_cal.$date_duration>>, +>( + vals: P1, +): maxλFuncExpr13; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + vals: P1, +): maxλFuncExpr14; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + vals: P1, +): maxλFuncExpr15; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + vals: P1, +): maxλFuncExpr16; +function max(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::max', args, _.spec, [ + {args: [{typeId: "f26e79f2-00ce-11ee-9118-f1407ce497dc", optional: false, setoftype: true, variadic: false}], returnTypeId: "f26e79f2-00ce-11ee-9118-f1407ce497dc", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: true, variadic: false}], returnTypeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010e", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000112", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd1bc2d8-00ce-11ee-8b70-7dd6dc2c48b6", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd1bc2d8-00ce-11ee-8b70-7dd6dc2c48b6", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd1d7376-00ce-11ee-b763-413434491d30", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd1d7376-00ce-11ee-b763-413434491d30", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd1f277a-00ce-11ee-b99d-b53ad971bf10", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd1f277a-00ce-11ee-b99d-b53ad971bf10", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd20d958-00ce-11ee-8cac-8b65221a1976", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd20d958-00ce-11ee-8cac-8b65221a1976", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "fd2299a0-00ce-11ee-99a8-13f657817dd3", optional: false, setoftype: true, variadic: false}], returnTypeId: "fd2299a0-00ce-11ee-99a8-13f657817dd3", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b", returnTypemod: "OptionalType", preservesOptionality: true}, + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "OptionalType", preservesOptionality: true}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::max", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type allλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +> = $.$expr_Function< + $bool, $.Cardinality.One +>; +/** + * Generalized boolean `AND` applied to the set of *values*. + */ +function all< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +>( + vals: P1, +): allλFuncExpr; +function all(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::all', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::all", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type anyλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +> = $.$expr_Function< + $bool, $.Cardinality.One +>; +/** + * Generalized boolean `OR` applied to the set of *values*. + */ +function any< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +>( + vals: P1, +): anyλFuncExpr; +function any(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::any', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::any", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type enumerateλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.TupleType<[$int64, $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>]>, $.Cardinality.Many +>; +/** + * Return a set of tuples of the form `(index, element)`. + */ +function enumerate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + vals: P1, +): enumerateλFuncExpr; +function enumerate(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::enumerate', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "f2a95c0c-00ce-11ee-897b-b386845887d1", returnTypemod: "SetOfType", preservesOptionality: true}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::enumerate", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type roundλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.paramCardinality +>; +type roundλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, +> = $.$expr_Function< + $bigint, $.cardutil.paramCardinality +>; +type roundλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +> = $.$expr_Function< + $decimal, $.cardutil.paramCardinality +>; +type roundλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Round to the nearest value. + */ +function round< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, +): roundλFuncExpr; +/** + * Round to the nearest value. + */ +function round< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, +>( + val: P1, +): roundλFuncExpr2; +/** + * Round to the nearest value. + */ +function round< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +>( + val: P1, +): roundλFuncExpr3; +/** + * Round to the nearest value. + */ +function round< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, + d: P2, +): roundλFuncExpr4; +function round(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::round', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::round", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type containsλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr3< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr4< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr5< + P1 extends $.TypeSet<$.RangeType<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr7< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr8< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr9< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr10< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type containsλFuncExpr11< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr2; +function contains< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr3; +function contains< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType>>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr4; +function contains< + P1 extends $.TypeSet<$.RangeType<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr5; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr6; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr7; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr8; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr9; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr10; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, +>( + haystack: P1, + needle: P2, +): containsλFuncExpr11; +function contains(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::contains', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f26af408-00ce-11ee-af2f-d38fb8cba865", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {args: [{typeId: "fd33903e-00ce-11ee-abdc-7f2265b9cb35", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::contains", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type findλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type findλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type findλFuncExpr3< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +type findλFuncExpr4< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +type findλFuncExpr5< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +type findλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +type findλFuncExpr7< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +type findλFuncExpr8< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + haystack: P1, + needle: P2, +): findλFuncExpr; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +>( + haystack: P1, + needle: P2, +): findλFuncExpr2; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>( + haystack: P1, + needle: P2, + from_pos?: P3, +): findλFuncExpr3; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>( + haystack: P1, + needle: P2, + from_pos?: P3, +): findλFuncExpr4; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>( + haystack: P1, + needle: P2, + from_pos?: P3, +): findλFuncExpr5; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>( + haystack: P1, + needle: P2, + from_pos?: P3, +): findλFuncExpr6; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>( + haystack: P1, + needle: P2, + from_pos?: P3, +): findλFuncExpr7; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>( + haystack: P1, + needle: P2, + from_pos?: P3, +): findλFuncExpr8; +function find(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::find', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::find", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type bit_andλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Bitwise AND operator for 16-bit integers. + */ +function bit_and< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + l: P1, + r: P2, +): bit_andλFuncExpr; +function bit_and(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::bit_and', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_and", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type bit_orλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Bitwise OR operator for 16-bit integers. + */ +function bit_or< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + l: P1, + r: P2, +): bit_orλFuncExpr; +function bit_or(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::bit_or', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_or", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type bit_xorλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Bitwise exclusive OR operator for 16-bit integers. + */ +function bit_xor< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + l: P1, + r: P2, +): bit_xorλFuncExpr; +function bit_xor(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::bit_xor', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_xor", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type bit_notλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.paramCardinality +>; +/** + * Bitwise NOT operator for 16-bit integers. + */ +function bit_not< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + r: P1, +): bit_notλFuncExpr; +function bit_not(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::bit_not', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_not", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type bit_rshiftλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Bitwise right-shift operator for 16-bit integers. + */ +function bit_rshift< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, + n: P2, +): bit_rshiftλFuncExpr; +function bit_rshift(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::bit_rshift', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_rshift", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type bit_lshiftλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Bitwise left-shift operator for 16-bit integers. + */ +function bit_lshift< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, + n: P2, +): bit_lshiftλFuncExpr; +function bit_lshift(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::bit_lshift', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_lshift", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type array_aggλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.NonArrayType>>, +> = $.$expr_Function< + $.ArrayType<$.getPrimitiveNonArrayBaseType<_.castMaps.literalToTypeSet["__element__"]>>, $.Cardinality.One +>; +/** + * Return the array made from all of the input set elements. + */ +function array_agg< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.NonArrayType>>, +>( + s: P1, +): array_aggλFuncExpr; +function array_agg(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::array_agg', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_agg", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type array_unpackλFuncExpr< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, +> = $.$expr_Function< + $.getPrimitiveNonArrayBaseType, $.Cardinality.Many +>; +/** + * Return array elements as a set. + */ +function array_unpack< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, +>( + array: P1, +): array_unpackλFuncExpr; +function array_unpack(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::array_unpack', args, _.spec, [ + {args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type array_fillλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $.ArrayType<$.getPrimitiveNonArrayBaseType<_.castMaps.literalToTypeSet["__element__"]>>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Return an array filled with the given value repeated as many times as specified. + */ +function array_fill< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, + n: P2, +): array_fillλFuncExpr; +function array_fill(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::array_fill', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_fill", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type array_replaceλFuncExpr< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P3 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +> = $.$expr_Function< + $.ArrayType<_.syntax.getSharedParentPrimitive<_.syntax.getSharedParentPrimitive, P3["__element__"]>>, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +type array_replaceλFuncExpr2< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P3 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +> = $.$expr_Function< + $.ArrayType<_.syntax.getSharedParentPrimitive<_.syntax.getSharedParentPrimitive, P3["__element__"]>>, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +type array_replaceλFuncExpr3< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, + P3 extends $.TypeSet<$decimalλICastableTo>, +> = $.$expr_Function< + $.ArrayType<_.syntax.getSharedParentPrimitive<_.syntax.getSharedParentPrimitive, P3["__element__"]>>, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +type array_replaceλFuncExpr4< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, + P3 extends $.TypeSet<$.ObjectType>, +> = $.$expr_Function< + $.ArrayType<_.syntax.mergeObjectTypes<_.syntax.mergeObjectTypes, P3["__element__"]>>, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +type array_replaceλFuncExpr5< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, + P3 extends $.TypeSet<$.AnyTupleType>, +> = $.$expr_Function< + $.ArrayType<_.syntax.getSharedParentPrimitive<_.syntax.getSharedParentPrimitive, P3["__element__"]>>, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +type array_replaceλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, +> = $.$expr_Function< + $.ArrayType<$.getPrimitiveNonArrayBaseType>, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P3 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + array: P1, + old: P2, + new_2: P3, +): array_replaceλFuncExpr; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P3 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + array: P1, + old: P2, + new_2: P3, +): array_replaceλFuncExpr2; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, + P3 extends $.TypeSet<$decimalλICastableTo>, +>( + array: P1, + old: P2, + new_2: P3, +): array_replaceλFuncExpr3; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, + P3 extends $.TypeSet<$.ObjectType>, +>( + array: P1, + old: P2, + new_2: P3, +): array_replaceλFuncExpr4; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, + P3 extends $.TypeSet<$.AnyTupleType>, +>( + array: P1, + old: P2, + new_2: P3, +): array_replaceλFuncExpr5; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, +>( + array: P1, + old: P2, + new_2: P3, +): array_replaceλFuncExpr6; +function array_replace(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::array_replace', args, _.spec, [ + {args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: false, variadic: false}], returnTypeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_replace", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type array_getλFuncExpr< + NamedArgs extends { + "default"?: $.TypeSet<_cal.$relative_durationλICastableTo>, + }, + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.getSharedParentPrimitive, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality>, 'Zero'> +>; +type array_getλFuncExpr2< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, 'Zero'> +>; +type array_getλFuncExpr3< + NamedArgs extends { + "default"?: $.TypeSet<_cal.$local_datetimeλICastableTo>, + }, + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.getSharedParentPrimitive, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality>, 'Zero'> +>; +type array_getλFuncExpr4< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, 'Zero'> +>; +type array_getλFuncExpr5< + NamedArgs extends { + "default"?: $.TypeSet<$decimalλICastableTo>, + }, + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.getSharedParentPrimitive, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality>, 'Zero'> +>; +type array_getλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, 'Zero'> +>; +type array_getλFuncExpr7< + NamedArgs extends { + "default"?: $.TypeSet<$.ObjectType>, + }, + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.mergeObjectTypes, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality>, 'Zero'> +>; +type array_getλFuncExpr8< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, 'Zero'> +>; +type array_getλFuncExpr9< + NamedArgs extends { + "default"?: $.TypeSet<$.AnyTupleType>, + }, + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.getSharedParentPrimitive, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality>, 'Zero'> +>; +type array_getλFuncExpr10< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, 'Zero'> +>; +type array_getλFuncExpr11< + NamedArgs extends { + "default"?: _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, + }, + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $.getPrimitiveNonArrayBaseType, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality>, 'Zero'> +>; +type array_getλFuncExpr12< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $.getPrimitiveNonArrayBaseType, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, 'Zero'> +>; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + "default"?: $.TypeSet<_cal.$relative_durationλICastableTo>, + }, + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + array: P1, + idx: P2, +): array_getλFuncExpr2; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + "default"?: $.TypeSet<_cal.$local_datetimeλICastableTo>, + }, + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr3; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + array: P1, + idx: P2, +): array_getλFuncExpr4; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + "default"?: $.TypeSet<$decimalλICastableTo>, + }, + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr5; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + array: P1, + idx: P2, +): array_getλFuncExpr6; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + "default"?: $.TypeSet<$.ObjectType>, + }, + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr7; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + array: P1, + idx: P2, +): array_getλFuncExpr8; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + "default"?: $.TypeSet<$.AnyTupleType>, + }, + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr9; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + array: P1, + idx: P2, +): array_getλFuncExpr10; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + "default"?: _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveNonArrayBaseType>>, + }, + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr11; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + array: P1, + idx: P2, +): array_getλFuncExpr12; +function array_get(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::array_get', args, _.spec, [ + {args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], namedArgs: {"default": {typeId: "00000000-0000-0000-0000-000000000001", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "OptionalType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type array_joinλFuncExpr< + P1 extends $.TypeSet<$.ArrayType<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Render an array to a string. + */ +function array_join< + P1 extends $.TypeSet<$.ArrayType<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + array: P1, + delimiter: P2, +): array_joinλFuncExpr; +function array_join(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::array_join', args, _.spec, [ + {args: [{typeId: "f4f119e6-00ce-11ee-9a0b-934fb014cd5d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_join", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type bytes_get_bitλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Get the *nth* bit of the *bytes* value. + */ +function bytes_get_bit< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + bytes: P1, + num: P2, +): bytes_get_bitλFuncExpr; +function bytes_get_bit(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::bytes_get_bit', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bytes_get_bit", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type datetime_currentλFuncExpr = $.$expr_Function< + $datetime, $.Cardinality.One +>; +/** + * Return the current server date and time. + */ +function datetime_current(): datetime_currentλFuncExpr; +function datetime_current(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::datetime_current', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_current", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type datetime_of_transactionλFuncExpr = $.$expr_Function< + $datetime, $.Cardinality.One +>; +/** + * Return the date and time of the start of the current transaction. + */ +function datetime_of_transaction(): datetime_of_transactionλFuncExpr; +function datetime_of_transaction(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::datetime_of_transaction', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_of_transaction", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type datetime_of_statementλFuncExpr = $.$expr_Function< + $datetime, $.Cardinality.One +>; +/** + * Return the date and time of the start of the current statement. + */ +function datetime_of_statement(): datetime_of_statementλFuncExpr; +function datetime_of_statement(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::datetime_of_statement', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_of_statement", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type datetime_getλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type datetime_getλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Extract a specific element of input datetime by name. + */ +function datetime_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + el: P2, +): datetime_getλFuncExpr; +/** + * Extract a specific element of input datetime by name. + */ +function datetime_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + el: P2, +): datetime_getλFuncExpr2; +function datetime_get(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::datetime_get', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type datetime_truncateλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Truncate the input datetime to a particular precision. + */ +function datetime_truncate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + unit: P2, +): datetime_truncateλFuncExpr; +function datetime_truncate(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::datetime_truncate', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_truncate", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type duration_getλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type duration_getλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type duration_getλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Extract a specific element of input duration by name. + */ +function duration_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + el: P2, +): duration_getλFuncExpr; +/** + * Extract a specific element of input duration by name. + */ +function duration_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + el: P2, +): duration_getλFuncExpr2; +/** + * Extract a specific element of input duration by name. + */ +function duration_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + el: P2, +): duration_getλFuncExpr3; +function duration_get(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::duration_get', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::duration_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type duration_truncateλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type duration_truncateλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + _cal.$date_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type duration_truncateλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + _cal.$relative_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Truncate the input duration to a particular precision. + */ +function duration_truncate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + unit: P2, +): duration_truncateλFuncExpr; +/** + * Truncate the input duration to a particular precision. + */ +function duration_truncate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + unit: P2, +): duration_truncateλFuncExpr2; +/** + * Truncate the input duration to a particular precision. + */ +function duration_truncate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + dt: P1, + unit: P2, +): duration_truncateλFuncExpr3; +function duration_truncate(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::duration_truncate', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010e"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000112"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::duration_truncate", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type duration_to_secondsλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +> = $.$expr_Function< + $decimal, $.cardutil.paramCardinality +>; +/** + * Return duration as total number of seconds in interval. + */ +function duration_to_seconds< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +>( + dur: P1, +): duration_to_secondsλFuncExpr; +function duration_to_seconds(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::duration_to_seconds', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::duration_to_seconds", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type json_typeofλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +> = $.$expr_Function< + $str, $.cardutil.paramCardinality +>; +/** + * Return the type of the outermost JSON value as a string. + */ +function json_typeof< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +>( + json: P1, +): json_typeofλFuncExpr; +function json_typeof(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::json_typeof', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_typeof", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type json_array_unpackλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +> = $.$expr_Function< + $json, $.Cardinality.Many +>; +/** + * Return elements of JSON array as a set of `json`. + */ +function json_array_unpack< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +>( + array: P1, +): json_array_unpackλFuncExpr; +function json_array_unpack(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::json_array_unpack', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010f", returnTypemod: "SetOfType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_array_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type json_object_unpackλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +> = $.$expr_Function< + $.TupleType<[$str, $json]>, $.Cardinality.Many +>; +/** + * Return set of key/value tuples that make up the JSON object. + */ +function json_object_unpack< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +>( + obj: P1, +): json_object_unpackλFuncExpr; +function json_object_unpack(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::json_object_unpack', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "f5635eac-00ce-11ee-8ccc-473c87d15381", returnTypemod: "SetOfType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_object_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type json_object_packλFuncExpr< + P1 extends $.TypeSet<$.TupleType<[$str, $json]>>, +> = $.$expr_Function< + $json, $.Cardinality.One +>; +/** + * Return a JSON object with set key/value pairs. + */ +function json_object_pack< + P1 extends $.TypeSet<$.TupleType<[$str, $json]>>, +>( + pairs: P1, +): json_object_packλFuncExpr; +function json_object_pack(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::json_object_pack', args, _.spec, [ + {args: [{typeId: "f5635eac-00ce-11ee-8ccc-473c87d15381", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010f"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_object_pack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type json_getλFuncExpr< + NamedArgs extends { + "default"?: _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [_.castMaps.orScalarLiteral<$.TypeSet<$str>>, ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[]], +> = $.$expr_Function< + $json, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramArrayCardinality>, $.cardutil.optionalParamCardinality>, 'Zero'> +>; +type json_getλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [_.castMaps.orScalarLiteral<$.TypeSet<$str>>, ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[]], +> = $.$expr_Function< + $json, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramArrayCardinality>, 'Zero'> +>; +/** + * Return the JSON value at the end of the specified path or an empty set. + */ +function json_get< + NamedArgs extends { + "default"?: _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [_.castMaps.orScalarLiteral<$.TypeSet<$str>>, ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[]], +>( + namedArgs: NamedArgs, + json: P1, + ...path: P2 +): json_getλFuncExpr; +/** + * Return the JSON value at the end of the specified path or an empty set. + */ +function json_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [_.castMaps.orScalarLiteral<$.TypeSet<$str>>, ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[]], +>( + json: P1, + ...path: P2 +): json_getλFuncExpr2; +function json_get(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::json_get', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: true}], namedArgs: {"default": {typeId: "00000000-0000-0000-0000-00000000010f", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-00000000010f", returnTypemod: "OptionalType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type json_setλFuncExpr< + NamedArgs extends { + "value"?: _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + "create_if_missing"?: _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, + "empty_treatment"?: _.castMaps.orScalarLiteral<$.TypeSet<$JsonEmpty>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [_.castMaps.orScalarLiteral<$.TypeSet<$str>>, ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[]], +> = $.$expr_Function< + $json, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramArrayCardinality>, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality>, 'Zero'> +>; +type json_setλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [_.castMaps.orScalarLiteral<$.TypeSet<$str>>, ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[]], +> = $.$expr_Function< + $json, $.cardutil.overrideLowerBound<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramArrayCardinality>, 'Zero'> +>; +/** + * Return an updated JSON target with a new value. + */ +function json_set< + NamedArgs extends { + "value"?: _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + "create_if_missing"?: _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, + "empty_treatment"?: _.castMaps.orScalarLiteral<$.TypeSet<$JsonEmpty>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [_.castMaps.orScalarLiteral<$.TypeSet<$str>>, ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[]], +>( + namedArgs: NamedArgs, + target: P1, + ...path: P2 +): json_setλFuncExpr; +/** + * Return an updated JSON target with a new value. + */ +function json_set< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [_.castMaps.orScalarLiteral<$.TypeSet<$str>>, ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[]], +>( + target: P1, + ...path: P2 +): json_setλFuncExpr2; +function json_set(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::json_set', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: true}], namedArgs: {"value": {typeId: "00000000-0000-0000-0000-00000000010f", optional: true, setoftype: false, variadic: false}, "create_if_missing": {typeId: "00000000-0000-0000-0000-000000000109", optional: true, setoftype: false, variadic: false}, "empty_treatment": {typeId: "f5605612-00ce-11ee-a03c-edc23ae8c3f9", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-00000000010f", returnTypemod: "OptionalType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_set", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type re_matchλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $.ArrayType<$str>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Find the first regular expression match in a string. + */ +function re_match< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + pattern: P1, + str: P2, +): re_matchλFuncExpr; +function re_match(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::re_match', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "f4f119e6-00ce-11ee-9a0b-934fb014cd5d"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::re_match", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type re_match_allλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $.ArrayType<$str>, $.Cardinality.Many +>; +/** + * Find all regular expression matches in a string. + */ +function re_match_all< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + pattern: P1, + str: P2, +): re_match_allλFuncExpr; +function re_match_all(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::re_match_all', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "f4f119e6-00ce-11ee-9a0b-934fb014cd5d", returnTypemod: "SetOfType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::re_match_all", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type re_testλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Test if a regular expression has a match in a string. + */ +function re_test< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + pattern: P1, + str: P2, +): re_testλFuncExpr; +function re_test(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::re_test', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::re_test", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type re_replaceλFuncExpr< + NamedArgs extends { + "flags"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +type re_replaceλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** + * Replace matching substrings in a given string. + */ +function re_replace< + NamedArgs extends { + "flags"?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + namedArgs: NamedArgs, + pattern: P1, + sub: P2, + str: P3, +): re_replaceλFuncExpr; +/** + * Replace matching substrings in a given string. + */ +function re_replace< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + pattern: P1, + sub: P2, + str: P3, +): re_replaceλFuncExpr2; +function re_replace(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::re_replace', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], namedArgs: {"flags": {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::re_replace", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_repeatλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Repeat the input *string* *n* times. + */ +function str_repeat< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + s: P1, + n: P2, +): str_repeatλFuncExpr; +function str_repeat(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_repeat', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_repeat", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_lowerλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.paramCardinality +>; +/** + * Return a lowercase copy of the input *string*. + */ +function str_lower< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + s: P1, +): str_lowerλFuncExpr; +function str_lower(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_lower', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_lower", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_upperλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.paramCardinality +>; +/** + * Return an uppercase copy of the input *string*. + */ +function str_upper< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + s: P1, +): str_upperλFuncExpr; +function str_upper(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_upper', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_upper", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_titleλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.paramCardinality +>; +/** + * Return a titlecase copy of the input *string*. + */ +function str_title< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + s: P1, +): str_titleλFuncExpr; +function str_title(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_title', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_title", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_pad_startλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string padded at the start to the length *n*. + */ +function str_pad_start< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + n: P2, + fill?: P3, +): str_pad_startλFuncExpr; +function str_pad_start(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_pad_start', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_pad_start", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_lpadλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string left-padded to the length *n*. + */ +function str_lpad< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + n: P2, + fill?: P3, +): str_lpadλFuncExpr; +function str_lpad(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_lpad', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_lpad", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_pad_endλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string padded at the end to the length *n*. + */ +function str_pad_end< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + n: P2, + fill?: P3, +): str_pad_endλFuncExpr; +function str_pad_end(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_pad_end', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_pad_end", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_rpadλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string right-padded to the length *n*. + */ +function str_rpad< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + n: P2, + fill?: P3, +): str_rpadλFuncExpr; +function str_rpad(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_rpad', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_rpad", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_trim_startλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string with all *trim* characters removed from its start. + */ +function str_trim_start< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + tr?: P2, +): str_trim_startλFuncExpr; +function str_trim_start(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_trim_start', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_trim_start", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_ltrimλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string with all leftmost *trim* characters removed. + */ +function str_ltrim< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + tr?: P2, +): str_ltrimλFuncExpr; +function str_ltrim(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_ltrim', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_ltrim", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_trim_endλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string with all *trim* characters removed from its end. + */ +function str_trim_end< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + tr?: P2, +): str_trim_endλFuncExpr; +function str_trim_end(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_trim_end', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_trim_end", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_rtrimλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string with all rightmost *trim* characters removed. + */ +function str_rtrim< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + tr?: P2, +): str_rtrimλFuncExpr; +function str_rtrim(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_rtrim', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_rtrim", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_trimλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Return the input string with *trim* characters removed from both ends. + */ +function str_trim< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + tr?: P2, +): str_trimλFuncExpr; +function str_trim(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_trim', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_trim", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_splitλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $.ArrayType<$str>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Split string into array elements using the supplied delimiter. + */ +function str_split< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + s: P1, + delimiter: P2, +): str_splitλFuncExpr; +function str_split(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_split', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "f4f119e6-00ce-11ee-9a0b-934fb014cd5d"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_split", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_replaceλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** + * Given a string, find a matching substring and replace all its occurrences with a new substring. + */ +function str_replace< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + s: P1, + old: P2, + new_2: P3, +): str_replaceλFuncExpr; +function str_replace(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_replace', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_replace", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type str_reverseλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.paramCardinality +>; +/** + * Reverse the order of the characters in the string. + */ +function str_reverse< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + s: P1, +): str_reverseλFuncExpr; +function str_reverse(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::str_reverse', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_reverse", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type uuid_generate_v1mcλFuncExpr = $.$expr_Function< + $uuid, $.Cardinality.One +>; +/** + * Return a version 1 UUID. + */ +function uuid_generate_v1mc(): uuid_generate_v1mcλFuncExpr; +function uuid_generate_v1mc(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::uuid_generate_v1mc', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-000000000100"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::uuid_generate_v1mc", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type uuid_generate_v4λFuncExpr = $.$expr_Function< + $uuid, $.Cardinality.One +>; +/** + * Return a version 4 UUID. + */ +function uuid_generate_v4(): uuid_generate_v4λFuncExpr; +function uuid_generate_v4(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::uuid_generate_v4', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-000000000100"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::uuid_generate_v4", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +const range = _.syntax.$range; + +type range_is_emptyλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +> = $.$expr_Function< + $bool, $.cardutil.paramCardinality +>; +function range_is_empty< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +>( + val: P1, +): range_is_emptyλFuncExpr; +function range_is_empty(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::range_is_empty', args, _.spec, [ + {args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_is_empty", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type range_unpackλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$number>>, +> = $.$expr_Function< + $number, $.Cardinality.Many +>; +type range_unpackλFuncExpr2< + P1 extends $.TypeSet<$.RangeType<$number>>, +> = $.$expr_Function< + $number, $.Cardinality.Many +>; +type range_unpackλFuncExpr3< + P1 extends $.TypeSet<$.RangeType<_cal.$local_date>>, +> = $.$expr_Function< + _cal.$local_date, $.Cardinality.Many +>; +type range_unpackλFuncExpr4< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.Cardinality.Many +>; +type range_unpackλFuncExpr5< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.Cardinality.Many +>; +type range_unpackλFuncExpr6< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.Cardinality.Many +>; +type range_unpackλFuncExpr7< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.Cardinality.Many +>; +type range_unpackλFuncExpr8< + P1 extends $.TypeSet<$.RangeType<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +> = $.$expr_Function< + $datetime, $.Cardinality.Many +>; +type range_unpackλFuncExpr9< + P1 extends $.TypeSet<$.RangeType<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +> = $.$expr_Function< + _cal.$local_date, $.Cardinality.Many +>; +type range_unpackλFuncExpr10< + P1 extends $.TypeSet<$.RangeType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +> = $.$expr_Function< + $decimal, $.Cardinality.Many +>; +type range_unpackλFuncExpr11< + P1 extends $.TypeSet<$.RangeType<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +> = $.$expr_Function< + _cal.$local_datetime, $.Cardinality.Many +>; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, +>( + val: P1, +): range_unpackλFuncExpr; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, +>( + val: P1, +): range_unpackλFuncExpr2; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<_cal.$local_date>>, +>( + val: P1, +): range_unpackλFuncExpr3; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, + step: P2, +): range_unpackλFuncExpr4; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, + step: P2, +): range_unpackλFuncExpr5; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, + step: P2, +): range_unpackλFuncExpr6; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + val: P1, + step: P2, +): range_unpackλFuncExpr7; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +>( + val: P1, + step: P2, +): range_unpackλFuncExpr8; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +>( + val: P1, + step: P2, +): range_unpackλFuncExpr9; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +>( + val: P1, + step: P2, +): range_unpackλFuncExpr10; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + val: P1, + step: P2, +): range_unpackλFuncExpr11; +function range_unpack(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::range_unpack', args, _.spec, [ + {args: [{typeId: "f6174f20-00ce-11ee-a153-9b9f22def034", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff", returnTypemod: "SetOfType"}, + {args: [{typeId: "f619b030-00ce-11ee-9d90-51e116555ee0", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff", returnTypemod: "SetOfType"}, + {args: [{typeId: "fd33903e-00ce-11ee-abdc-7f2265b9cb35", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c", returnTypemod: "SetOfType"}, + {args: [{typeId: "f6174f20-00ce-11ee-a153-9b9f22def034", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff", returnTypemod: "SetOfType"}, + {args: [{typeId: "f619b030-00ce-11ee-9d90-51e116555ee0", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff", returnTypemod: "SetOfType"}, + {args: [{typeId: "f61c1514-00ce-11ee-b758-2ba0294a9d4f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff", returnTypemod: "SetOfType"}, + {args: [{typeId: "f61d9498-00ce-11ee-bf51-ab3d54bc8377", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff", returnTypemod: "SetOfType"}, + {args: [{typeId: "f6208ce8-00ce-11ee-8be1-d5f03cecbcf6", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a", returnTypemod: "SetOfType"}, + {args: [{typeId: "fd33903e-00ce-11ee-abdc-7f2265b9cb35", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c", returnTypemod: "SetOfType"}, + {args: [{typeId: "f61f12b4-00ce-11ee-9255-77c974b57987", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108", returnTypemod: "SetOfType"}, + {args: [{typeId: "fd31fd82-00ce-11ee-9af0-41d37e070021", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b", returnTypemod: "SetOfType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type range_get_upperλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +> = $.$expr_Function< + $.getPrimitiveBaseType, $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, 'Zero'> +>; +function range_get_upper< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +>( + r: P1, +): range_get_upperλFuncExpr; +function range_get_upper(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::range_get_upper', args, _.spec, [ + {args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "f26af408-00ce-11ee-af2f-d38fb8cba865", returnTypemod: "OptionalType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_get_upper", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type range_get_lowerλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +> = $.$expr_Function< + $.getPrimitiveBaseType, $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, 'Zero'> +>; +function range_get_lower< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +>( + r: P1, +): range_get_lowerλFuncExpr; +function range_get_lower(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::range_get_lower', args, _.spec, [ + {args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "f26af408-00ce-11ee-af2f-d38fb8cba865", returnTypemod: "OptionalType"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_get_lower", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type range_is_inclusive_upperλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +> = $.$expr_Function< + $bool, $.cardutil.paramCardinality +>; +function range_is_inclusive_upper< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +>( + r: P1, +): range_is_inclusive_upperλFuncExpr; +function range_is_inclusive_upper(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::range_is_inclusive_upper', args, _.spec, [ + {args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_is_inclusive_upper", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type range_is_inclusive_lowerλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +> = $.$expr_Function< + $bool, $.cardutil.paramCardinality +>; +function range_is_inclusive_lower< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +>( + r: P1, +): range_is_inclusive_lowerλFuncExpr; +function range_is_inclusive_lower(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::range_is_inclusive_lower', args, _.spec, [ + {args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_is_inclusive_lower", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type overlapsλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +> = $.$expr_Function< + $bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +function overlaps< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, + r: P2, +): overlapsλFuncExpr; +function overlaps(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::overlaps', args, _.spec, [ + {args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::overlaps", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_strλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr5< + P1 extends $.TypeSet<$.ArrayType<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +type to_strλFuncExpr6< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr7< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr8< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr9< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr10< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_strλFuncExpr11< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + dt: P1, + fmt?: P2, +): to_strλFuncExpr; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + td: P1, + fmt?: P2, +): to_strλFuncExpr2; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + i: P1, + fmt?: P2, +): to_strλFuncExpr3; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + d: P1, + fmt?: P2, +): to_strλFuncExpr4; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends $.TypeSet<$.ArrayType<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + array: P1, + delimiter: P2, +): to_strλFuncExpr5; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + json: P1, + fmt?: P2, +): to_strλFuncExpr6; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + d: P1, + fmt?: P2, +): to_strλFuncExpr7; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + nt: P1, + fmt?: P2, +): to_strλFuncExpr8; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + d: P1, + fmt?: P2, +): to_strλFuncExpr9; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + dt: P1, + fmt?: P2, +): to_strλFuncExpr10; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + rd: P1, + fmt?: P2, +): to_strλFuncExpr11; +function to_str(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_str', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "f4f119e6-00ce-11ee-9a0b-934fb014cd5d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_str", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_jsonλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $json, $.cardutil.paramCardinality +>; +/** + * Return JSON value represented by the input *string*. + */ +function to_json< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + str: P1, +): to_jsonλFuncExpr; +function to_json(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_json', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010f"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_json", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_datetimeλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $datetime, $.cardutil.paramCardinality +>; +type to_datetimeλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +type to_datetimeλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P4 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P5 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P6 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P7 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $datetime, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality>, $.cardutil.paramCardinality>, $.cardutil.paramCardinality>, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +type to_datetimeλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +> = $.$expr_Function< + $datetime, $.cardutil.paramCardinality +>; +type to_datetimeλFuncExpr5< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + epochseconds: P1, +): to_datetimeλFuncExpr; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_datetimeλFuncExpr2; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P4 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P5 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P6 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P7 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + year: P1, + month: P2, + day: P3, + hour: P4, + min: P5, + sec: P6, + timezone: P7, +): to_datetimeλFuncExpr3; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +>( + epochseconds: P1, +): to_datetimeλFuncExpr4; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + local: P1, + zone: P2, +): to_datetimeλFuncExpr5; +function to_datetime(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_datetime', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + {args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + {args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + {args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_datetime", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_durationλFuncExpr< + NamedArgs extends { + "hours"?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + "minutes"?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + "seconds"?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + "microseconds"?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + }, +> = $.$expr_Function< + $duration, $.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality>, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `duration` value. + */ +function to_duration< + NamedArgs extends { + "hours"?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + "minutes"?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + "seconds"?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + "microseconds"?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + }, +>( + namedArgs: NamedArgs, +): to_durationλFuncExpr; +function to_duration(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_duration', args, _.spec, [ + {args: [], namedArgs: {"hours": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "minutes": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "seconds": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, "microseconds": {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}}, returnTypeId: "00000000-0000-0000-0000-00000000010e"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_duration", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_bigintλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $bigint, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `bigint` value. + */ +function to_bigint< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_bigintλFuncExpr; +function to_bigint(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_bigint', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_bigint", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_decimalλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `decimal` value. + */ +function to_decimal< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_decimalλFuncExpr; +function to_decimal(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_decimal', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_decimal", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_int64λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `int64` value. + */ +function to_int64< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_int64λFuncExpr; +function to_int64(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_int64', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_int64", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_int32λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `int32` value. + */ +function to_int32< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_int32λFuncExpr; +function to_int32(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_int32', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_int32", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_int16λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `int16` value. + */ +function to_int16< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_int16λFuncExpr; +function to_int16(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_int16', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_int16", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_float64λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `float64` value. + */ +function to_float64< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_float64λFuncExpr; +function to_float64(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_float64', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_float64", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type to_float32λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.optionalParamCardinality> +>; +/** + * Create a `float32` value. + */ +function to_float32< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>( + s: P1, + fmt?: P2, +): to_float32λFuncExpr; +function to_float32(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::to_float32', args, _.spec, [ + {args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_float32", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type sequence_resetλFuncExpr< + P1 extends $.TypeSet<_schema.$ScalarType>, +> = $.$expr_Function< + $number, $.cardutil.paramCardinality +>; +type sequence_resetλFuncExpr2< + P1 extends $.TypeSet<_schema.$ScalarType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +function sequence_reset< + P1 extends $.TypeSet<_schema.$ScalarType>, +>( + seq: P1, +): sequence_resetλFuncExpr; +function sequence_reset< + P1 extends $.TypeSet<_schema.$ScalarType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + seq: P1, + value: P2, +): sequence_resetλFuncExpr2; +function sequence_reset(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::sequence_reset', args, _.spec, [ + {args: [{typeId: "f88af61c-00ce-11ee-b035-cb29f59d0ddd", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {args: [{typeId: "f88af61c-00ce-11ee-b035-cb29f59d0ddd", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::sequence_reset", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type sequence_nextλFuncExpr< + P1 extends $.TypeSet<_schema.$ScalarType>, +> = $.$expr_Function< + $number, $.cardutil.paramCardinality +>; +function sequence_next< + P1 extends $.TypeSet<_schema.$ScalarType>, +>( + seq: P1, +): sequence_nextλFuncExpr; +function sequence_next(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('std::sequence_next', args, _.spec, [ + {args: [{typeId: "f88af61c-00ce-11ee-b035-cb29f59d0ddd", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::sequence_next", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + + + +export { JsonEmpty, bigint, bool, bytes, datetime, decimal, duration, float32, float64, int16, int32, int64, json, $sequence, str, uuid, number, $BaseObject, BaseObject, $Object_f65d226600ce11ee81279554e3ef2585, Object_f65d226600ce11ee81279554e3ef2585, $FreeObject, FreeObject }; + +export type { $anyscalar, $anypoint, $anydiscrete, $anycontiguous, $anyreal, $anyfloat, $anyint, $anynumeric }; + +type __defaultExports = { + "JsonEmpty": typeof JsonEmpty; + "bigint": typeof bigint; + "bool": typeof bool; + "bytes": typeof bytes; + "datetime": typeof datetime; + "decimal": typeof decimal; + "duration": typeof duration; + "float32": typeof float32; + "float64": typeof float64; + "int16": typeof int16; + "int32": typeof int32; + "int64": typeof int64; + "json": typeof json; + "str": typeof str; + "uuid": typeof uuid; + "BaseObject": typeof BaseObject; + "Object": typeof Object_f65d226600ce11ee81279554e3ef2585; + "FreeObject": typeof FreeObject; + "assert_single": typeof assert_single; + "assert_exists": typeof assert_exists; + "assert_distinct": typeof assert_distinct; + "assert": typeof assert; + "len": typeof len; + "sum": typeof sum; + "count": typeof count; + "random": typeof random; + "min": typeof min; + "max": typeof max; + "all": typeof all; + "any": typeof any; + "enumerate": typeof enumerate; + "round": typeof round; + "contains": typeof contains; + "find": typeof find; + "bit_and": typeof bit_and; + "bit_or": typeof bit_or; + "bit_xor": typeof bit_xor; + "bit_not": typeof bit_not; + "bit_rshift": typeof bit_rshift; + "bit_lshift": typeof bit_lshift; + "array_agg": typeof array_agg; + "array_unpack": typeof array_unpack; + "array_fill": typeof array_fill; + "array_replace": typeof array_replace; + "array_get": typeof array_get; + "array_join": typeof array_join; + "bytes_get_bit": typeof bytes_get_bit; + "datetime_current": typeof datetime_current; + "datetime_of_transaction": typeof datetime_of_transaction; + "datetime_of_statement": typeof datetime_of_statement; + "datetime_get": typeof datetime_get; + "datetime_truncate": typeof datetime_truncate; + "duration_get": typeof duration_get; + "duration_truncate": typeof duration_truncate; + "duration_to_seconds": typeof duration_to_seconds; + "json_typeof": typeof json_typeof; + "json_array_unpack": typeof json_array_unpack; + "json_object_unpack": typeof json_object_unpack; + "json_object_pack": typeof json_object_pack; + "json_get": typeof json_get; + "json_set": typeof json_set; + "re_match": typeof re_match; + "re_match_all": typeof re_match_all; + "re_test": typeof re_test; + "re_replace": typeof re_replace; + "str_repeat": typeof str_repeat; + "str_lower": typeof str_lower; + "str_upper": typeof str_upper; + "str_title": typeof str_title; + "str_pad_start": typeof str_pad_start; + "str_lpad": typeof str_lpad; + "str_pad_end": typeof str_pad_end; + "str_rpad": typeof str_rpad; + "str_trim_start": typeof str_trim_start; + "str_ltrim": typeof str_ltrim; + "str_trim_end": typeof str_trim_end; + "str_rtrim": typeof str_rtrim; + "str_trim": typeof str_trim; + "str_split": typeof str_split; + "str_replace": typeof str_replace; + "str_reverse": typeof str_reverse; + "uuid_generate_v1mc": typeof uuid_generate_v1mc; + "uuid_generate_v4": typeof uuid_generate_v4; + "range": typeof range; + "range_is_empty": typeof range_is_empty; + "range_unpack": typeof range_unpack; + "range_get_upper": typeof range_get_upper; + "range_get_lower": typeof range_get_lower; + "range_is_inclusive_upper": typeof range_is_inclusive_upper; + "range_is_inclusive_lower": typeof range_is_inclusive_lower; + "overlaps": typeof overlaps; + "to_str": typeof to_str; + "to_json": typeof to_json; + "to_datetime": typeof to_datetime; + "to_duration": typeof to_duration; + "to_bigint": typeof to_bigint; + "to_decimal": typeof to_decimal; + "to_int64": typeof to_int64; + "to_int32": typeof to_int32; + "to_int16": typeof to_int16; + "to_float64": typeof to_float64; + "to_float32": typeof to_float32; + "sequence_reset": typeof sequence_reset; + "sequence_next": typeof sequence_next +}; +const __defaultExports: __defaultExports = { + "JsonEmpty": JsonEmpty, + "bigint": bigint, + "bool": bool, + "bytes": bytes, + "datetime": datetime, + "decimal": decimal, + "duration": duration, + "float32": float32, + "float64": float64, + "int16": int16, + "int32": int32, + "int64": int64, + "json": json, + "str": str, + "uuid": uuid, + "BaseObject": BaseObject, + "Object": Object_f65d226600ce11ee81279554e3ef2585, + "FreeObject": FreeObject, + "assert_single": assert_single, + "assert_exists": assert_exists, + "assert_distinct": assert_distinct, + "assert": assert, + "len": len, + "sum": sum, + "count": count, + "random": random, + "min": min, + "max": max, + "all": all, + "any": any, + "enumerate": enumerate, + "round": round, + "contains": contains, + "find": find, + "bit_and": bit_and, + "bit_or": bit_or, + "bit_xor": bit_xor, + "bit_not": bit_not, + "bit_rshift": bit_rshift, + "bit_lshift": bit_lshift, + "array_agg": array_agg, + "array_unpack": array_unpack, + "array_fill": array_fill, + "array_replace": array_replace, + "array_get": array_get, + "array_join": array_join, + "bytes_get_bit": bytes_get_bit, + "datetime_current": datetime_current, + "datetime_of_transaction": datetime_of_transaction, + "datetime_of_statement": datetime_of_statement, + "datetime_get": datetime_get, + "datetime_truncate": datetime_truncate, + "duration_get": duration_get, + "duration_truncate": duration_truncate, + "duration_to_seconds": duration_to_seconds, + "json_typeof": json_typeof, + "json_array_unpack": json_array_unpack, + "json_object_unpack": json_object_unpack, + "json_object_pack": json_object_pack, + "json_get": json_get, + "json_set": json_set, + "re_match": re_match, + "re_match_all": re_match_all, + "re_test": re_test, + "re_replace": re_replace, + "str_repeat": str_repeat, + "str_lower": str_lower, + "str_upper": str_upper, + "str_title": str_title, + "str_pad_start": str_pad_start, + "str_lpad": str_lpad, + "str_pad_end": str_pad_end, + "str_rpad": str_rpad, + "str_trim_start": str_trim_start, + "str_ltrim": str_ltrim, + "str_trim_end": str_trim_end, + "str_rtrim": str_rtrim, + "str_trim": str_trim, + "str_split": str_split, + "str_replace": str_replace, + "str_reverse": str_reverse, + "uuid_generate_v1mc": uuid_generate_v1mc, + "uuid_generate_v4": uuid_generate_v4, + "range": range, + "range_is_empty": range_is_empty, + "range_unpack": range_unpack, + "range_get_upper": range_get_upper, + "range_get_lower": range_get_lower, + "range_is_inclusive_upper": range_is_inclusive_upper, + "range_is_inclusive_lower": range_is_inclusive_lower, + "overlaps": overlaps, + "to_str": to_str, + "to_json": to_json, + "to_datetime": to_datetime, + "to_duration": to_duration, + "to_bigint": to_bigint, + "to_decimal": to_decimal, + "to_int64": to_int64, + "to_int32": to_int32, + "to_int16": to_int16, + "to_float64": to_float64, + "to_float32": to_float32, + "sequence_reset": sequence_reset, + "sequence_next": sequence_next +}; +export default __defaultExports; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/sys.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/sys.ts new file mode 100644 index 000000000..93a05fa1e --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/modules/sys.ts @@ -0,0 +1,223 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _schema from "./schema"; +import type * as _std from "./std"; +export type $TransactionIsolation = { + "RepeatableRead": $.$expr_Literal<$TransactionIsolation>; + "Serializable": $.$expr_Literal<$TransactionIsolation>; +} & $.EnumType<"sys::TransactionIsolation", ["RepeatableRead", "Serializable"]>; +const TransactionIsolation: $TransactionIsolation = $.makeType<$TransactionIsolation>(_.spec, "fad74df8-00ce-11ee-b14d-37b5872d6037", _.syntax.literal); + +export type $VersionStage = { + "dev": $.$expr_Literal<$VersionStage>; + "alpha": $.$expr_Literal<$VersionStage>; + "beta": $.$expr_Literal<$VersionStage>; + "rc": $.$expr_Literal<$VersionStage>; + "final": $.$expr_Literal<$VersionStage>; +} & $.EnumType<"sys::VersionStage", ["dev", "alpha", "beta", "rc", "final"]>; +const VersionStage: $VersionStage = $.makeType<$VersionStage>(_.spec, "fad7b478-00ce-11ee-8f6a-b399c8e7e5f7", _.syntax.literal); + +export type $SystemObjectλShape = $.typeutil.flatten<_schema.$Object_f6a2efd000ce11eebcd68fb1bad207a0λShape & { +}>; +type $SystemObject = $.ObjectType<"sys::SystemObject", $SystemObjectλShape, null, [ + ..._schema.$Object_f6a2efd000ce11eebcd68fb1bad207a0['__exclusives__'], +]>; +const $SystemObject = $.makeType<$SystemObject>(_.spec, "fad81936-00ce-11ee-938b-6f0e269822b6", _.syntax.literal); + +const SystemObject: $.$expr_PathNode<$.TypeSet<$SystemObject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($SystemObject, $.Cardinality.Many), null); + +export type $ExternalObjectλShape = $.typeutil.flatten<$SystemObjectλShape & { +}>; +type $ExternalObject = $.ObjectType<"sys::ExternalObject", $ExternalObjectλShape, null, [ + ...$SystemObject['__exclusives__'], +]>; +const $ExternalObject = $.makeType<$ExternalObject>(_.spec, "fae255c2-00ce-11ee-a357-216fac507eb4", _.syntax.literal); + +const ExternalObject: $.$expr_PathNode<$.TypeSet<$ExternalObject, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($ExternalObject, $.Cardinality.Many), null); + +export type $DatabaseλShape = $.typeutil.flatten<$ExternalObjectλShape & _schema.$AnnotationSubjectλShape & { + "name": $.PropertyDesc<_std.$str, $.Cardinality.One, true, false, false, false>; +}>; +type $Database = $.ObjectType<"sys::Database", $DatabaseλShape, null, [ + ...$ExternalObject['__exclusives__'], + ..._schema.$AnnotationSubject['__exclusives__'], + {name: {__element__: _std.$str, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $Database = $.makeType<$Database>(_.spec, "faec9e6a-00ce-11ee-8dfb-198ae83511a5", _.syntax.literal); + +const Database: $.$expr_PathNode<$.TypeSet<$Database, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Database, $.Cardinality.Many), null); + +export type $ExtensionPackageλShape = $.typeutil.flatten<$SystemObjectλShape & _schema.$AnnotationSubjectλShape & { + "script": $.PropertyDesc<_std.$str, $.Cardinality.One, false, false, false, false>; + "version": $.PropertyDesc<$.NamedTupleType<{major: _std.$int64, minor: _std.$int64, stage: $VersionStage, stage_no: _std.$int64, local: $.ArrayType<_std.$str>}>, $.Cardinality.One, false, false, false, false>; + "; + "; +}>; +type $ExtensionPackage = $.ObjectType<"sys::ExtensionPackage", $ExtensionPackageλShape, null, [ + ...$SystemObject['__exclusives__'], + ..._schema.$AnnotationSubject['__exclusives__'], +]>; +const $ExtensionPackage = $.makeType<$ExtensionPackage>(_.spec, "faff4d80-00ce-11ee-b86d-f1043a4b6a59", _.syntax.literal); + +const ExtensionPackage: $.$expr_PathNode<$.TypeSet<$ExtensionPackage, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($ExtensionPackage, $.Cardinality.Many), null); + +export type $RoleλShape = $.typeutil.flatten<$SystemObjectλShape & _schema.$InheritingObjectλShape & _schema.$AnnotationSubjectλShape & { + "member_of": $.LinkDesc<$Role, $.Cardinality.Many, {}, false, false, false, false>; + "name": $.PropertyDesc<_std.$str, $.Cardinality.One, true, false, false, false>; + "superuser": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, false, false, false>; + "is_superuser": $.PropertyDesc<_std.$bool, $.Cardinality.One, false, true, false, false>; + "password": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne, false, false, false, false>; + "; + "; +}>; +type $Role = $.ObjectType<"sys::Role", $RoleλShape, null, [ + ...$SystemObject['__exclusives__'], + ..._schema.$InheritingObject['__exclusives__'], + ..._schema.$AnnotationSubject['__exclusives__'], + {name: {__element__: _std.$str, __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne },}, +]>; +const $Role = $.makeType<$Role>(_.spec, "fb158c1c-00ce-11ee-9686-e593693c7533", _.syntax.literal); + +const Role: $.$expr_PathNode<$.TypeSet<$Role, $.Cardinality.Many>, null> = _.syntax.$PathNode($.$toSet($Role, $.Cardinality.Many), null); + +type get_versionλFuncExpr = $.$expr_Function< + $.NamedTupleType<{major: _std.$int64, minor: _std.$int64, stage: $VersionStage, stage_no: _std.$int64, local: $.ArrayType<_std.$str>}>, $.Cardinality.One +>; +/** + * Return the server version as a tuple. + */ +function get_version(): get_versionλFuncExpr; +function get_version(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('sys::get_version', args, _.spec, [ + {args: [], returnTypeId: "fb021718-00ce-11ee-8d81-5d6f603eab62"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_version", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type get_version_as_strλFuncExpr = $.$expr_Function< + _std.$str, $.Cardinality.One +>; +/** + * Return the server version as a string. + */ +function get_version_as_str(): get_version_as_strλFuncExpr; +function get_version_as_str(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('sys::get_version_as_str', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_version_as_str", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type get_instance_nameλFuncExpr = $.$expr_Function< + _std.$str, $.Cardinality.One +>; +/** + * Return the server instance name. + */ +function get_instance_name(): get_instance_nameλFuncExpr; +function get_instance_name(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('sys::get_instance_name', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_instance_name", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type get_transaction_isolationλFuncExpr = $.$expr_Function< + $TransactionIsolation, $.Cardinality.One +>; +/** + * Return the isolation level of the current transaction. + */ +function get_transaction_isolation(): get_transaction_isolationλFuncExpr; +function get_transaction_isolation(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('sys::get_transaction_isolation', args, _.spec, [ + {args: [], returnTypeId: "fad74df8-00ce-11ee-b14d-37b5872d6037"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_transaction_isolation", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + +type get_current_databaseλFuncExpr = $.$expr_Function< + _std.$str, $.Cardinality.One +>; +/** + * Return the name of the current database as a string. + */ +function get_current_database(): get_current_databaseλFuncExpr; +function get_current_database(...args: any[]) { + const {returnType, cardinality, args: positionalArgs, namedArgs} = _.syntax.$resolveOverload('sys::get_current_database', args, _.spec, [ + {args: [], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_current_database", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +}; + + + +export { TransactionIsolation, VersionStage, $SystemObject, SystemObject, $ExternalObject, ExternalObject, $Database, Database, $ExtensionPackage, ExtensionPackage, $Role, Role }; + +type __defaultExports = { + "TransactionIsolation": typeof TransactionIsolation; + "VersionStage": typeof VersionStage; + "SystemObject": typeof SystemObject; + "ExternalObject": typeof ExternalObject; + "Database": typeof Database; + "ExtensionPackage": typeof ExtensionPackage; + "Role": typeof Role; + "get_version": typeof get_version; + "get_version_as_str": typeof get_version_as_str; + "get_instance_name": typeof get_instance_name; + "get_transaction_isolation": typeof get_transaction_isolation; + "get_current_database": typeof get_current_database +}; +const __defaultExports: __defaultExports = { + "TransactionIsolation": TransactionIsolation, + "VersionStage": VersionStage, + "SystemObject": SystemObject, + "ExternalObject": ExternalObject, + "Database": Database, + "ExtensionPackage": ExtensionPackage, + "Role": Role, + "get_version": get_version, + "get_version_as_str": get_version_as_str, + "get_instance_name": get_instance_name, + "get_transaction_isolation": get_transaction_isolation, + "get_current_database": get_current_database +}; +export default __defaultExports; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/operators.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/operators.ts new file mode 100644 index 000000000..b158e53e7 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/operators.ts @@ -0,0 +1,4289 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "./reflection"; +import * as _ from "./imports"; +import type * as _std from "./modules/std"; +import type * as _cal from "./modules/cal"; +import type * as _cfg from "./modules/cfg"; + +const overloadDefs: { + [opKind in 'Infix' | 'Prefix' | 'Postfix' | 'Ternary']: { + [opSymbol: string]: any[] + } +} = { + Infix: { + "=": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}, {typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}, {typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "f26eda5a-00ce-11ee-9f61-f5c763e0f8e5", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "?=": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000002", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000002", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: true, setoftype: false, variadic: false}, {typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: true, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000100", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000100", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: true, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: true, setoftype: false, variadic: false}, {typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000130", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000130", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: true, setoftype: false, variadic: false}, {typeId: "f26eda5a-00ce-11ee-9f61-f5c763e0f8e5", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "!=": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}, {typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}, {typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "f26eda5a-00ce-11ee-9f61-f5c763e0f8e5", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "?!=": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000002", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000002", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: true, setoftype: false, variadic: false}, {typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: true, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000100", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000100", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: true, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: true, setoftype: false, variadic: false}, {typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000130", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000130", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: true, setoftype: false, variadic: false}, {typeId: "f26eda5a-00ce-11ee-9f61-f5c763e0f8e5", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: true, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + ">=": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}, {typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}, {typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f26eda5a-00ce-11ee-9f61-f5c763e0f8e5", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + ">": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}, {typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}, {typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f26eda5a-00ce-11ee-9f61-f5c763e0f8e5", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "<=": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}, {typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}, {typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f26eda5a-00ce-11ee-9f61-f5c763e0f8e5", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "<": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000002", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}, {typeId: "f272ea46-00ce-11ee-a0b1-2545abfede14", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000100", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}, {typeId: "f65a09aa-00ce-11ee-a1aa-7f3b419ffb71", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000130", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "f26eda5a-00ce-11ee-9f61-f5c763e0f8e5", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "or": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "and": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "+": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010e"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000112"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + ], + "-": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010e"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010e"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010c"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000112"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000112", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000112"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010a", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010a"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010c", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010d", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010d"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010b"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010b", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + ], + "*": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {kind: "Infix", args: [{typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}, {typeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "f588212e-00ce-11ee-ac49-0dcbbf3b26ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ], + "/": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ], + "//": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ], + "%": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ], + "^": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ], + "in": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "not in": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "union": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType"}, + ], + "except": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType"}, + ], + "intersect": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType"}, + ], + "??": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: true, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType"}, + ], + "++": [ + {kind: "Infix", args: [{typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}, {typeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9", optional: false, setoftype: false, variadic: false}], returnTypeId: "f289fc54-00ce-11ee-b5b3-51abe3fbfdf9"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000102", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000102"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000101"}, + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-00000000010f", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010f"}, + ], + "like": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "ilike": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "not like": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "not ilike": [ + {kind: "Infix", args: [{typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000101", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + }, + Postfix: { + }, + Prefix: { + "not": [ + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "+": [ + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + ], + "-": [ + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-0000000001ff", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-0000000001ff"}, + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-000000000110", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000110"}, + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-00000000010e", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-00000000010e"}, + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-000000000108", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000108"}, + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-000000000111", optional: false, setoftype: false, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000111"}, + ], + "exists": [ + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000109"}, + ], + "distinct": [ + {kind: "Prefix", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType"}, + ], + }, + Ternary: { + "if_else": [ + {kind: "Ternary", args: [{typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000109", optional: false, setoftype: false, variadic: false}, {typeId: "00000000-0000-0000-0000-000000000001", optional: false, setoftype: true, variadic: false}], returnTypeId: "00000000-0000-0000-0000-000000000001", returnTypemod: "SetOfType"}, + ], + }, +}; + +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for equality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "?=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Compare two (potentially empty) values for inequality. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "?!=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.optionalParamCardinality, $.cardutil.optionalParamCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: ">=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Greater than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: ">", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than or equal. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "<=", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Less than. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "<", r: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Logical disjunction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + a: P1, op: "or", b: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Logical conjunction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + a: P1, op: "and", b: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Logical negation. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, +>( + op: "not", v: P1 +): $.$expr_Operator< + _std.$bool, $.cardutil.paramCardinality +>; +/** +* Arithmetic addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + op: "+", l: P1 +): $.$expr_Operator< + _std.$number, $.cardutil.paramCardinality +>; +/** +* Arithmetic addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + op: "+", l: P1 +): $.$expr_Operator< + _std.$bigint, $.cardutil.paramCardinality +>; +/** +* Arithmetic addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _std.$bigint, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _std.$datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _std.$duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Range union. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + $.RangeType<$.getPrimitiveBaseType>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$local_date, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$local_time, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$date_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _std.$datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$local_time, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$relative_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + op: "+", l: P1 +): $.$expr_Operator< + _std.$decimal, $.cardutil.paramCardinality +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval addition. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "+", r: P2 +): $.$expr_Operator< + _cal.$relative_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + op: "-", l: P1 +): $.$expr_Operator< + _std.$number, $.cardutil.paramCardinality +>; +/** +* Arithmetic subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + op: "-", l: P1 +): $.$expr_Operator< + _std.$bigint, $.cardutil.paramCardinality +>; +/** +* Time interval negation. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + op: "-", v: P1 +): $.$expr_Operator< + _std.$duration, $.cardutil.paramCardinality +>; +/** +* Arithmetic subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _std.$bigint, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _std.$datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _std.$duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _std.$duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Range difference. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + $.RangeType<$.getPrimitiveBaseType>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$local_date, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Date subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$date_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$local_time, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$relative_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$date_duration>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$date_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _std.$datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$local_time, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$relative_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + op: "-", l: P1 +): $.$expr_Operator< + _std.$decimal, $.cardutil.paramCardinality +>; +/** +* Time interval negation. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + op: "-", v: P1 +): $.$expr_Operator< + _cal.$relative_duration, $.cardutil.paramCardinality +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval and date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$local_datetime, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Date/time subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$relative_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Time interval subtraction. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "-", r: P2 +): $.$expr_Operator< + _cal.$relative_duration, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic multiplication. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "*", r: P2 +): $.$expr_Operator< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic multiplication. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + l: P1, op: "*", r: P2 +): $.$expr_Operator< + _std.$bigint, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Range intersection. +*/ +function op< + P1 extends $.TypeSet<$.RangeType<_std.$anypoint>>, + P2 extends $.TypeSet<$.RangeType<$.getPrimitiveBaseType>>, +>( + l: P1, op: "*", r: P2 +): $.$expr_Operator< + $.RangeType<$.getPrimitiveBaseType>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic multiplication. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "*", r: P2 +): $.$expr_Operator< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic division. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + l: P1, op: "/", r: P2 +): $.$expr_Operator< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Arithmetic division. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + l: P1, op: "/", r: P2 +): $.$expr_Operator< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Floor division. Result is rounded down to the nearest integer +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + n: P1, op: "//", d: P2 +): $.$expr_Operator< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Floor division. Result is rounded down to the nearest integer +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + n: P1, op: "//", d: P2 +): $.$expr_Operator< + _std.$bigint, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Floor division. Result is rounded down to the nearest integer +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + n: P1, op: "//", d: P2 +): $.$expr_Operator< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Remainder from division (modulo). +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + n: P1, op: "%", d: P2 +): $.$expr_Operator< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Remainder from division (modulo). +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + n: P1, op: "%", d: P2 +): $.$expr_Operator< + _std.$bigint, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Remainder from division (modulo). +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + n: P1, op: "%", d: P2 +): $.$expr_Operator< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Power operation. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + n: P1, op: "^", p: P2 +): $.$expr_Operator< + _std.$number, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Power operation. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +>( + n: P1, op: "^", p: P2 +): $.$expr_Operator< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Power operation. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>( + n: P1, op: "^", p: P2 +): $.$expr_Operator< + _std.$decimal, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<_std.$decimalλICastableTo>, + P2 extends $.TypeSet<_std.$decimalλICastableTo>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>>>, +>( + e: P1, op: "in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<_std.$decimalλICastableTo>, + P2 extends $.TypeSet<_std.$decimalλICastableTo>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test the membership of an element in a set. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>>>, +>( + e: P1, op: "not in", s: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.Cardinality.One> +>; +/** +* Test whether a set is not empty. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + op: "exists", s: P1 +): $.$expr_Operator< + _std.$bool, $.Cardinality.One +>; +/** +* Return a set without repeating any elements. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>( + op: "distinct", s: P1 +): $.$expr_Operator< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.paramCardinality +>; +/** +* Merge two sets. +*/ +function op< + P1 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Merge two sets. +*/ +function op< + P1 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Merge two sets. +*/ +function op< + P1 extends $.TypeSet<_std.$decimalλICastableTo>, + P2 extends $.TypeSet<_std.$decimalλICastableTo>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Merge two sets. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Merge two sets. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Merge two sets. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Merge two sets. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + _.syntax.mergeObjectTypes, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Merge two sets. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Merge two sets. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>>>, +>( + s1: P1, op: "union", s2: P2 +): $.$expr_Operator< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Multiset difference. +*/ +function op< + P1 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset difference. +*/ +function op< + P1 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset difference. +*/ +function op< + P1 extends $.TypeSet<_std.$decimalλICastableTo>, + P2 extends $.TypeSet<_std.$decimalλICastableTo>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset difference. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset difference. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset difference. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset difference. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + _.syntax.mergeObjectTypes, $.Cardinality.Many +>; +/** +* Multiset difference. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset difference. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>>>, +>( + s1: P1, op: "except", s2: P2 +): $.$expr_Operator< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends $.TypeSet<_std.$decimalλICastableTo>, + P2 extends $.TypeSet<_std.$decimalλICastableTo>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + _.syntax.mergeObjectTypes, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.Cardinality.Many +>; +/** +* Multiset intersection. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>>>, +>( + s1: P1, op: "intersect", s2: P2 +): $.$expr_Operator< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.Cardinality.Many +>; +/** +* Coalesce. +*/ +function op< + P1 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P2 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Coalesce. +*/ +function op< + P1 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P2 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Coalesce. +*/ +function op< + P1 extends $.TypeSet<_std.$decimalλICastableTo>, + P2 extends $.TypeSet<_std.$decimalλICastableTo>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Coalesce. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Coalesce. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Coalesce. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Coalesce. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends $.TypeSet<$.ObjectType>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + _.syntax.mergeObjectTypes, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Coalesce. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends $.TypeSet<$.AnyTupleType>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Coalesce. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>>>, +>( + l: P1, op: "??", r: P2 +): $.$expr_Operator< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends $.TypeSet<_cal.$relative_durationλICastableTo>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends $.TypeSet<_cal.$relative_durationλICastableTo>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends $.TypeSet<_cal.$local_datetimeλICastableTo>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends $.TypeSet<_std.$decimalλICastableTo>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends $.TypeSet<_std.$decimalλICastableTo>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends $.TypeSet<$.ObjectType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends $.TypeSet<$.ObjectType>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + _.syntax.mergeObjectTypes, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends $.TypeSet<$.AnyTupleType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends $.TypeSet<$.AnyTupleType>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Conditionally provide one or the other result. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>>>, +>( + if_true: P1, op: "if", condition: P2, op2: "else", if_false: P3 +): $.$expr_Operator< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, $.cardutil.multiplyCardinalities<$.cardutil.orCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality>, $.cardutil.paramCardinality> +>; +/** +* Array concatenation. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + $.ArrayType<_.syntax.getSharedParentPrimitive>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Array concatenation. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + $.ArrayType<_.syntax.getSharedParentPrimitive>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Array concatenation. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + P2 extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + $.ArrayType<_.syntax.getSharedParentPrimitive>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Array concatenation. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ArrayType<$.ObjectType>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + $.ArrayType<_.syntax.mergeObjectTypes>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Array concatenation. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + $.ArrayType<_.syntax.getSharedParentPrimitive>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Array concatenation. +*/ +function op< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends $.TypeSet<$.ArrayType<$.getPrimitiveNonArrayBaseType>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + $.ArrayType<$.getPrimitiveNonArrayBaseType>, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Bytes concatenation. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + _std.$bytes, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* String concatenation. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + _std.$str, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Concatenate two JSON values into a new JSON value. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>, +>( + l: P1, op: "++", r: P2 +): $.$expr_Operator< + _std.$json, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Case-sensitive simple string matching. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + string: P1, op: "like", pattern: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Case-insensitive simple string matching. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + string: P1, op: "ilike", pattern: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Case-sensitive simple string matching. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + string: P1, op: "not like", pattern: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +/** +* Case-insensitive simple string matching. +*/ +function op< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + string: P1, op: "not ilike", pattern: P2 +): $.$expr_Operator< + _std.$bool, $.cardutil.multiplyCardinalities<$.cardutil.paramCardinality, $.cardutil.paramCardinality> +>; +function op(...args: any[]) { + let op: string = ""; + let params: any[] = []; + let defs: any[] | null | undefined = null; + if (args.length === 2) { + if (typeof args[0] === "string" && overloadDefs.Prefix[args[0]]) { + op = args[0]; + params = [args[1]]; + defs = overloadDefs.Prefix[op]; + } else if (typeof args[1] === "string" && overloadDefs.Postfix[args[1]]) { + op = args[1]; + params = [args[0]]; + defs = overloadDefs.Postfix[op]; + } + } else if (args.length === 3) { + if (typeof args[1] === "string") { + op = args[1]; + params = [args[0], args[2]]; + defs = overloadDefs.Infix[op]; + } + } else if (args.length === 5) { + if (typeof args[1] === "string" && typeof args[3] === "string") { + op = `${args[1]}_${args[3]}`; + params = [args[0], args[2], args[4]]; + defs = overloadDefs.Ternary[op]; + } + } + + if (!defs) { + throw new Error(`No operator exists with signature: ${args.map(arg => `${arg}`).join(", ")}`); + } + + const {kind, returnType, cardinality, args: resolvedArgs} = _.syntax.$resolveOverload(op, params, _.spec, defs); + + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Operator, + __element__: returnType, + __cardinality__: cardinality, + __name__: op, + __opkind__: kind, + __args__: resolvedArgs, + }) as any; +}; + + +export { op }; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/params.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/params.ts new file mode 100644 index 000000000..d637f5e09 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/params.ts @@ -0,0 +1,151 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { Executor } from "edgedb"; +import { + ExpressionKind, + Cardinality, + TypeKind, +} from "edgedb/dist/reflection/index"; +import type { + Expression, + ParamType, + setToTsType, + TypeSet, + BaseTypeToTsType, +} from "./typesystem"; +import { $expressionify } from "./path"; +import { runnableExpressionKinds } from "./query"; +import { select } from "./select"; +import { complexParamKinds } from "./__spec__"; + +export type $expr_OptionalParam = { + __kind__: ExpressionKind.OptionalParam; + __type__: Type; +}; + +export function optional( + type: Type +): $expr_OptionalParam { + return { + __kind__: ExpressionKind.OptionalParam, + __type__: type, + }; +} + +export type QueryableWithParamsExpression< + Set extends TypeSet = TypeSet, + Params extends { + [key: string]: ParamType | $expr_OptionalParam; + } = {} +> = Expression & { + run( + cxn: Executor, + args: paramsToParamArgs + ): Promise>; + runJSON(cxn: Executor, args: paramsToParamArgs): Promise; +}; + +export type $expr_WithParams< + Params extends { + [key: string]: ParamType | $expr_OptionalParam; + } = {}, + Expr extends TypeSet = TypeSet +> = QueryableWithParamsExpression< + { + __kind__: ExpressionKind.WithParams; + __element__: Expr["__element__"]; + __cardinality__: Expr["__cardinality__"]; + __expr__: Expr; + __params__: $expr_Param[]; + }, + Params +>; + +type paramsToParamArgs< + Params extends { + [key: string]: ParamType | $expr_OptionalParam; + } +> = { + [key in keyof Params as Params[key] extends ParamType + ? key + : never]: Params[key] extends ParamType + ? Readonly> + : never; +} & { + [key in keyof Params as Params[key] extends $expr_OptionalParam + ? key + : never]?: Params[key] extends $expr_OptionalParam + ? Readonly | null> + : never; +}; + +export type $expr_Param< + Name extends string | number | symbol = string, + Type extends ParamType = ParamType, + Optional extends boolean = boolean +> = Expression<{ + __kind__: ExpressionKind.Param; + __element__: Type; + __cardinality__: Optional extends true + ? Cardinality.AtMostOne + : Cardinality.One; + __name__: Name; + __isComplex__: boolean; +}>; + +type paramsToParamExprs< + Params extends { + [key: string]: ParamType | $expr_OptionalParam; + } +> = { + [key in keyof Params]: Params[key] extends $expr_OptionalParam + ? $expr_Param + : Params[key] extends ParamType + ? $expr_Param + : never; +}; + +export function params< + Params extends { + [key: string]: ParamType | $expr_OptionalParam; + } = {}, + Expr extends Expression = Expression +>( + paramsDef: Params, + expr: (params: paramsToParamExprs) => Expr +): $expr_WithParams { + const paramExprs: { [key: string]: $expr_Param } = {}; + for (const [key, param] of Object.entries(paramsDef)) { + const paramType = + param.__kind__ === ExpressionKind.OptionalParam ? param.__type__ : param; + const isComplex = + complexParamKinds.has(paramType.__kind__) || + (paramType.__kind__ === TypeKind.array && + complexParamKinds.has(paramType.__element__.__kind__)); + paramExprs[key] = $expressionify({ + __kind__: ExpressionKind.Param, + __element__: paramType, + __cardinality__: + param.__kind__ === ExpressionKind.OptionalParam + ? Cardinality.AtMostOne + : Cardinality.One, + __name__: key, + __isComplex__: isComplex, + }) as any; + } + + let returnExpr = expr(paramExprs as any); + + if (!runnableExpressionKinds.has((returnExpr as any).__kind__)) { + returnExpr = select(returnExpr) as any; + } + + return $expressionify({ + __kind__: ExpressionKind.WithParams, + __element__: returnExpr.__element__, + __cardinality__: returnExpr.__cardinality__, + __expr__: returnExpr, + __params__: Object.values(paramExprs), + }) as any; +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/path.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/path.ts new file mode 100644 index 000000000..ba604381f --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/path.ts @@ -0,0 +1,477 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { + // cardutil, + // ObjectTypeSet, + // TypeSet, + // Expression, + ExpressionKind, + TypeKind, + // LinkDesc, + // PropertyDesc, + Cardinality, + // BaseType, + typeutil, +} from "edgedb/dist/reflection/index"; + +import { cardutil } from "./cardinality"; + +import { literalToTypeSet } from "./castMaps"; +import { $arrayLikeIndexify, $tuplePathify } from "./collections"; +import { $toEdgeQL } from "./toEdgeQL"; +import { $queryFunc, $queryFuncJSON } from "./query"; + +import type { + BaseType, + Expression, + LinkDesc, + ObjectType, + ObjectTypePointers, + ObjectTypeSet, + PropertyDesc, + PropertyShape, + TypeSet, +} from "./typesystem"; +// import {typeutil} from "./typeutil"; +// import {cardutil} from "./cardinality"; + +// get the set representing the result of a path traversal +// including cardinality merging +type getChildOfObjectTypeSet< + Root extends ObjectTypeSet, + ChildKey extends keyof Root["__element__"]["__pointers__"] +> = TypeSet< + Root["__element__"]["__pointers__"][ChildKey]["target"], + cardutil.multiplyCardinalities< + Root["__cardinality__"], + Root["__element__"]["__pointers__"][ChildKey]["cardinality"] + > +>; + +// path parent must be object expression +export interface PathParent< + Parent extends ObjectTypeSet = ObjectTypeSet, + L extends string = string +> { + type: Parent; + linkName: L; +} + +export type $linkPropify = Root extends { + __parent__: PathParent; +} + ? // tslint:disable-next-line + Parent["__element__"]["__pointers__"][L] extends LinkDesc< + any, + any, + infer LinkProps, + any, + any, + any, + any + > + ? pathifyLinkProps> + : {} + : unknown; + +export type $pathify< + Root extends TypeSet + // Parent extends PathParent | null = null +> = Root extends ObjectTypeSet + ? ObjectTypeSet extends Root + ? {} // Root is literally ObjectTypeSet + : pathifyPointers & pathifyShape & $linkPropify + : {}; // pathify does nothing on non-object types + +export type pathifyPointers< + Root extends ObjectTypeSet + // Parent extends PathParent | null = null +> = ObjectTypePointers extends Root["__element__"]["__pointers__"] + ? unknown + : { + // & string required to avoid typeError on linkName + [k in keyof Root["__element__"]["__pointers__"] & + string]: Root["__element__"]["__pointers__"][k] extends PropertyDesc + ? $expr_PathLeaf< + getChildOfObjectTypeSet, + { type: anonymizeObjectTypeSet; linkName: k } + // Root["__element__"]["__pointers__"][k]["exclusive"] + > + : Root["__element__"]["__pointers__"][k] extends LinkDesc + ? getChildOfObjectTypeSet extends ObjectTypeSet + ? $expr_PathNode< + getChildOfObjectTypeSet, + { type: anonymizeObjectTypeSet; linkName: k } + // Root["__element__"]["__pointers__"][k]["exclusive"] + > + : unknown + : unknown; + }; + +type anonymizeObjectTypeSet = typeutil.flatten<{ + __element__: ObjectType< + T["__element__"]["__name__"], + T["__element__"]["__pointers__"], + { id: true } + >; + __cardinality__: T["__cardinality__"]; +}>; + +export type pathifyShape< + Root extends ObjectTypeSet, + Shape extends { [k: string]: any } = Root["__element__"]["__shape__"] +> = string extends keyof Shape + ? {} + : { + [k in keyof Shape & string]: Shape[k] extends ObjectTypeSet + ? $expr_PathNode< + TypeSet< + Shape[k]["__element__"], + cardutil.multiplyCardinalities< + Root["__cardinality__"], + Shape[k]["__cardinality__"] + > + >, + { type: Root; linkName: k } + // false + > + : Shape[k] extends TypeSet + ? $expr_PathLeaf< + TypeSet< + Shape[k]["__element__"], + cardutil.multiplyCardinalities< + Root["__cardinality__"], + Shape[k]["__cardinality__"] + > + >, + { type: Root; linkName: k } + // false + > + : // must be unknown (not never) to avoid overriding + // a pointer with the same key + unknown; + }; + +type pathifyLinkProps< + Props extends PropertyShape, + Root extends ObjectTypeSet, + Parent extends PathParent | null = null +> = { + [k in keyof Props & string]: Props[k] extends PropertyDesc + ? $expr_PathLeaf< + TypeSet< + Props[k]["target"], + cardutil.multiplyCardinalities< + Root["__cardinality__"], + Props[k]["cardinality"] + > + >, + { type: $expr_PathNode; linkName: k } + // {type: $expr_PathNode; linkName: k}, + // Props[k]["exclusive"] + > + : unknown; +}; + +export type getPropsShape = typeutil.flatten< + typeutil.stripNever<{ + [k in keyof T["__pointers__"]]: T["__pointers__"][k]["__kind__"] extends "property" + ? true + : never; + }> +>; + +export type $expr_PathNode< + Root extends ObjectTypeSet = ObjectTypeSet, + Parent extends PathParent | null = PathParent | null + // Exclusive extends boolean = boolean +> = Expression<{ + __element__: Root["__element__"]; + __cardinality__: Root["__cardinality__"]; + __parent__: Parent; + __kind__: ExpressionKind.PathNode; + // __exclusive__: boolean; + "*": getPropsShape; +}>; + +export type $expr_TypeIntersection< + Card extends Cardinality = Cardinality, + Intersection extends ObjectType = ObjectType +> = Expression<{ + __element__: Intersection; + __cardinality__: Card; + __kind__: ExpressionKind.TypeIntersection; + __expr__: TypeSet; +}>; + +export type $expr_PathLeaf< + Root extends TypeSet = TypeSet, + Parent extends PathParent = PathParent + // Exclusive extends boolean = boolean +> = Expression<{ + __element__: Root["__element__"]; + __cardinality__: Root["__cardinality__"]; + __kind__: ExpressionKind.PathLeaf; + __parent__: Parent; + // __exclusive__: boolean; +}>; + +export type ExpressionRoot = { + __element__: BaseType; + __cardinality__: Cardinality; + __kind__: ExpressionKind; +}; + +function PathLeaf< + Root extends TypeSet, + Parent extends PathParent, + Exclusive extends boolean = boolean +>( + root: Root, + parent: Parent, + exclusive: Exclusive, + scopeRoot: TypeSet | null = null +): $expr_PathLeaf { + return $expressionify({ + __kind__: ExpressionKind.PathLeaf, + __element__: root.__element__, + __cardinality__: root.__cardinality__, + __parent__: parent, + // __exclusive__: exclusive, + __scopeRoot__: scopeRoot, + }) as any; +} + +function getStarShapeFromPointers(pointers: ObjectTypePointers) { + const shape: any = {}; + for (const [key, ptr] of Object.entries(pointers)) { + if (ptr.__kind__ === "property") { + shape[key] = true; + } + } + return shape; +} + +function PathNode< + Root extends ObjectTypeSet, + Parent extends PathParent | null + // Exclusive extends boolean = boolean +>( + root: Root, + parent: Parent, + // exclusive: boolean, + scopeRoot: TypeSet | null = null +): $expr_PathNode { + const obj = { + __kind__: ExpressionKind.PathNode, + __element__: root.__element__, + __cardinality__: root.__cardinality__, + __parent__: parent, + // __exclusive__: exclusive, + __scopeRoot__: scopeRoot, + }; + + Object.defineProperty(obj, "*", { + writable: false, + value: getStarShapeFromPointers(obj.__element__.__pointers__), + }); + return $expressionify(obj) as any; +} + +const _pathCache = Symbol(); +const _pointers = Symbol(); + +const pathifyProxyHandlers: ProxyHandler = { + get(target: any, prop: string | symbol, proxy: any) { + const ptr = target[_pointers][prop as any] as LinkDesc | PropertyDesc; + if (ptr) { + return ( + target[_pathCache][prop] ?? + (target[_pathCache][prop] = ( + (ptr.__kind__ === "property" ? PathLeaf : PathNode) as any + )( + { + __element__: ptr.target, + __cardinality__: cardutil.multiplyCardinalities( + target.__cardinality__, + ptr.cardinality + ), + }, + { + linkName: prop, + type: proxy, + }, + ptr.exclusive ?? false, + target.__scopeRoot__ ?? (scopeRoots.has(proxy) ? proxy : null) + )) + ); + } + return target[prop]; + }, +}; + +export function $pathify( + _root: Root +): $pathify { + if (_root.__element__.__kind__ !== TypeKind.object) { + return _root as any; + } + + const root: $expr_PathNode = _root as any; + + let pointers = { + ...root.__element__.__pointers__, + }; + + if (root.__parent__) { + const { type, linkName } = root.__parent__; + const parentPointer = type.__element__.__pointers__[linkName]; + if (parentPointer?.__kind__ === "link") { + pointers = { ...pointers, ...parentPointer.properties }; + } + } + + for (const [key, val] of Object.entries( + root.__element__.__shape__ || { id: true } + )) { + if (pointers[key]) continue; + const valType: BaseType = (val as any)?.__element__; + if (!valType) continue; + + pointers[key] = { + __kind__: valType.__kind__ === TypeKind.object ? "link" : "property", + properties: {}, + target: (val as any).__element__, + cardinality: (val as any).__cardinality__, + exclusive: false, + computed: true, + readonly: true, + hasDefault: false, + }; + } + + (root as any)[_pointers] = pointers; + (root as any)[_pathCache] = {}; + + return new Proxy(root, pathifyProxyHandlers); +} + +function isFunc(this: any, expr: ObjectTypeSet) { + return $expressionify({ + __kind__: ExpressionKind.TypeIntersection, + __cardinality__: this.__cardinality__, + __element__: { + ...expr.__element__, + __shape__: { id: true }, + } as any, + __expr__: this, + }); +} + +export function $assert_single(expr: Expression) { + return $expressionify({ + __kind__: ExpressionKind.Function, + __element__: expr.__element__, + __cardinality__: cardutil.overrideUpperBound(expr.__cardinality__, "One"), + __name__: "std::assert_single", + __args__: [expr], + __namedargs__: {}, + }) as any; +} + +const jsonDestructureProxyHandlers: ProxyHandler = { + get(target: ExpressionRoot, prop: string | symbol, proxy: any) { + if (typeof prop === "string" && !(prop in target)) { + const parsedProp = Number.isInteger(Number(prop)) ? Number(prop) : prop; + return jsonDestructure.call(proxy, parsedProp); + } + return (target as any)[prop]; + }, +}; + +function jsonDestructure(this: ExpressionRoot, path: any) { + const pathTypeSet = literalToTypeSet(path); + return $expressionify({ + __kind__: ExpressionKind.Operator, + __element__: this.__element__, + __cardinality__: cardutil.multiplyCardinalities( + this.__cardinality__, + pathTypeSet.__cardinality__ + ), + __name__: "[]", + __opkind__: "Infix", + __args__: [this, pathTypeSet], + }) as any; +} + +export function $jsonDestructure(_expr: ExpressionRoot) { + if ( + _expr.__element__.__kind__ === TypeKind.scalar && + _expr.__element__.__name__ === "std::json" + ) { + const expr = new Proxy(_expr, jsonDestructureProxyHandlers) as any; + + expr.destructure = jsonDestructure.bind(expr); + + return expr; + } + + return _expr; +} + +export function $expressionify( + _expr: T +): Expression { + const expr: Expression = $pathify( + $jsonDestructure($arrayLikeIndexify($tuplePathify(_expr))) + ) as any; + + expr.run = $queryFunc.bind(expr) as any; + expr.runJSON = $queryFuncJSON.bind(expr) as any; + expr.is = isFunc.bind(expr) as any; + expr.toEdgeQL = $toEdgeQL.bind(expr); + expr.assert_single = () => $assert_single(expr) as any; + + return Object.freeze(expr) as any; +} + +const scopedExprCache = new WeakMap(); +const scopeRoots = new WeakSet(); + +export function $getScopedExpr( + expr: T, + existingScopes?: Set +): Expression { + let scopedExpr = scopedExprCache.get(expr); + if (!scopedExpr || existingScopes?.has(scopedExpr)) { + // free objects should not be scopified + const isFreeObject = + expr.__cardinality__ === Cardinality.One && + expr.__element__.__name__ === "std::FreeObject"; + + scopedExpr = isFreeObject + ? (expr as any as Expression>) + : $expressionify({ + ...expr, + __cardinality__: Cardinality.One, + __scopedFrom__: expr, + ...(expr.__element__.__kind__ === TypeKind.object + ? { + "*": getStarShapeFromPointers( + (expr.__element__ as ObjectType).__pointers__ + ), + } + : {}), + }); + scopeRoots.add(scopedExpr); + const uncached = !scopedExpr; + if (uncached) { + scopedExprCache.set(expr, scopedExpr); + } + } + existingScopes?.add(scopedExpr); + return scopedExpr as any; +} + +export { PathLeaf as $PathLeaf, PathNode as $PathNode }; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/query.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/query.ts new file mode 100644 index 000000000..ac3dd239a --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/query.ts @@ -0,0 +1,63 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type * as edgedb from "edgedb"; +import { Cardinality, ExpressionKind } from "edgedb/dist/reflection/index"; +import { jsonifyComplexParams } from "./json"; +import { select } from "./select"; + +export const runnableExpressionKinds = new Set([ + ExpressionKind.Select, + ExpressionKind.Update, + ExpressionKind.Insert, + ExpressionKind.InsertUnlessConflict, + ExpressionKind.Delete, + ExpressionKind.Group, + ExpressionKind.For, + ExpressionKind.With, + ExpressionKind.WithParams, +]); + +const wrappedExprCache = new WeakMap(); + +export async function $queryFunc(this: any, cxn: edgedb.Executor, args: any) { + const expr = runnableExpressionKinds.has(this.__kind__) + ? this + : wrappedExprCache.get(this) ?? + wrappedExprCache.set(this, select(this)).get(this); + + const _args = jsonifyComplexParams(expr, args); + + const query = expr.toEdgeQL(); + + if ( + expr.__cardinality__ === Cardinality.One || + expr.__cardinality__ === Cardinality.AtMostOne || + expr.__cardinality__ === Cardinality.Empty + ) { + return cxn.querySingle(query, _args); + } else { + return cxn.query(query, _args); + } +} + +export async function $queryFuncJSON( + this: any, + cxn: edgedb.Executor, + args: any +) { + const expr = runnableExpressionKinds.has(this.__kind__) + ? this + : wrappedExprCache.get(this) ?? + wrappedExprCache.set(this, select(this)).get(this); + const _args = jsonifyComplexParams(expr, args); + + if ( + expr.__cardinality__ === Cardinality.One || + expr.__cardinality__ === Cardinality.AtMostOne + ) { + return cxn.querySingleJSON(expr.toEdgeQL(), _args); + } else { + return cxn.queryJSON(expr.toEdgeQL(), _args); + } +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/range.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/range.ts new file mode 100644 index 000000000..c8764495a --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/range.ts @@ -0,0 +1,202 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { LocalDate, LocalDateTime, Duration } from "edgedb"; +import { Range } from "edgedb"; +import { TypeKind, ExpressionKind } from "edgedb/dist/reflection/index"; + +import type { cardutil } from "./cardinality"; +import type { + RangeType, + getPrimitiveBaseType, + TypeSet, + BaseType, +} from "./typesystem"; +import type { $expr_Literal } from "./literal"; + +import type { + $number, + $decimal, + $datetime, + $duration, + $bool, +} from "./modules/std"; +import type { $local_date, $local_datetime } from "./modules/cal"; +import type { literalToScalarType, orScalarLiteral } from "./castMaps"; +import { literalToTypeSet } from "./castMaps"; +import { spec } from "./__spec__"; +import { literal, $nameMapping } from "./literal"; +import { $expr_Function, $resolveOverload } from "./funcops"; +import { $expressionify } from "./path"; + +type $anypoint = + | $number + | $local_date + | $decimal + | $datetime + | $local_datetime + | $duration; + +function range(element: Element): RangeType; +function range( + val: Range +): $expr_Literal>>>; +function range< + NamedArgs extends { + inc_lower?: orScalarLiteral>; + inc_upper?: orScalarLiteral>; + empty?: orScalarLiteral>; + }, + P1 extends orScalarLiteral> | undefined, + P2 extends + | orScalarLiteral< + TypeSet< + BaseType extends literalToScalarType + ? $anypoint + : getPrimitiveBaseType> + > + > + | undefined +>( + namedArgs: NamedArgs, + lower?: P1, + upper?: P2 +): $expr_Function< + // "std::range", + // mapLiteralToTypeSet<[P1, P2]>, + // mapLiteralToTypeSet, + // TypeSet< + RangeType< + literalToScalarType extends $anypoint + ? literalToScalarType + : literalToScalarType extends $anypoint + ? literalToScalarType + : $anypoint + >, + cardutil.multiplyCardinalities< + cardutil.multiplyCardinalities< + cardutil.multiplyCardinalities< + cardutil.multiplyCardinalities< + cardutil.optionalParamCardinality, + cardutil.optionalParamCardinality + >, + cardutil.optionalParamCardinality + >, + cardutil.optionalParamCardinality + >, + cardutil.optionalParamCardinality + > + // > +>; +function range< + P1 extends orScalarLiteral> | undefined, + P2 extends + | orScalarLiteral< + TypeSet< + BaseType extends literalToScalarType + ? $anypoint + : getPrimitiveBaseType> + > + > + | undefined +>( + lower?: P1, + upper?: P2 +): $expr_Function< + // "std::range", + // mapLiteralToTypeSet<[P1, P2]>, + // {}, + // TypeSet< + RangeType< + literalToScalarType extends $anypoint + ? literalToScalarType + : literalToScalarType extends $anypoint + ? literalToScalarType + : $anypoint + >, + cardutil.multiplyCardinalities< + cardutil.optionalParamCardinality, + cardutil.optionalParamCardinality + > + // > +>; +function range(...args: any[]): any { + if (args.length === 1) { + const arg = args[0]; + if (arg instanceof Range) { + if (arg.lower === null && arg.upper === null) { + throw new Error( + `Can't create literal expression from unbounded range. Try this instead:\n\n e.range(e.cast(e.int64, e.set()), e.cast(e.int64, e.set()))` + ); + } + if (arg.isEmpty) { + throw new Error(`Can't create literal expression from empty range.`); + } + return literal( + range(literalToTypeSet(arg.lower ?? arg.upper).__element__ as any), + arg + ); + } + if (arg.__kind__ && !arg.__element__) { + return { + __kind__: TypeKind.range, + __name__: `range<${arg.__name__}>`, + __element__: arg, + } as any; + } + } + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = $resolveOverload("std::range", args, spec, [ + { + args: [ + { + typeId: $nameMapping.get("std::anypoint")!, + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: $nameMapping.get("std::anypoint")!, + optional: true, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + inc_lower: { + typeId: $nameMapping.get("std::bool")!, + optional: true, + setoftype: false, + variadic: false, + }, + inc_upper: { + typeId: $nameMapping.get("std::bool")!, + optional: true, + setoftype: false, + variadic: false, + }, + empty: { + typeId: $nameMapping.get("std::bool")!, + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: $nameMapping.get("range")!, + }, + ]); + return $expressionify({ + __kind__: ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { range as $range }; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/reflection.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/reflection.ts new file mode 100644 index 000000000..fb225ffe7 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/reflection.ts @@ -0,0 +1,11 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +export * from "edgedb/dist/reflection/index"; +export * from "./typesystem"; +export { cardutil } from "./cardinality"; +export type { $expr_Literal } from "./literal"; +export type { $expr_PathNode, $expr_PathLeaf } from "./path"; +export type { $expr_Function, $expr_Operator } from "./funcops"; +export { makeType, $mergeObjectTypes } from "./hydrate"; +export type { mergeObjectTypes } from "./hydrate"; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/select.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/select.ts new file mode 100644 index 000000000..6d50f6f35 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/select.ts @@ -0,0 +1,1221 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { + LocalDateTime, + LocalDate, + LocalTime, + Duration, + RelativeDuration, + ConfigMemory, + DateDuration, +} from "edgedb"; +import type { $bool, $number } from "./modules/std"; + +import { + Cardinality, + ExpressionKind, + TypeKind, + OperatorKind, +} from "edgedb/dist/reflection/index"; +import { makeType } from "./hydrate"; + +import { cardutil } from "./cardinality"; +import type { + $expr_PolyShapeElement, + $scopify, + Expression, + LinkDesc, + ObjectType, + ObjectTypeExpression, + ObjectTypePointers, + ObjectTypeSet, + PrimitiveTypeSet, + PropertyDesc, + ScalarType, + stripSet, + TypeSet, + BaseType, + ExclusiveTuple, + orLiteralValue, +} from "./typesystem"; + +import { + $assert_single, + $expr_PathLeaf, + $expr_PathNode, + $linkPropify, + ExpressionRoot, +} from "./path"; +import type { anonymizeObject } from "./casting"; +import { $expressionify, $getScopedExpr } from "./path"; +import { $getTypeByName, literal } from "./literal"; +import { spec } from "./__spec__"; +import { + scalarLiterals, + literalToScalarType, + literalToTypeSet, +} from "./castMaps"; +import type { $expr_Operator } from "./funcops"; + +export const ASC: "ASC" = "ASC"; +export const DESC: "DESC" = "DESC"; +export const EMPTY_FIRST: "EMPTY FIRST" = "EMPTY FIRST"; +export const EMPTY_LAST: "EMPTY LAST" = "EMPTY LAST"; +export type OrderByDirection = "ASC" | "DESC"; +export type OrderByEmpty = "EMPTY FIRST" | "EMPTY LAST"; + +export type OrderByExpr = TypeSet; +export type OrderByObjExpr = { + expression: OrderByExpr; + direction?: OrderByDirection; + empty?: OrderByEmpty; +}; + +export type OrderByExpression = + | OrderByExpr + | OrderByObjExpr + | [OrderByExpr | OrderByObjExpr, ...(OrderByExpr | OrderByObjExpr)[]]; + +export type OffsetExpression = TypeSet< + $number, + Cardinality.Empty | Cardinality.One | Cardinality.AtMostOne +>; + +export type SelectFilterExpression = TypeSet<$bool, Cardinality>; +export type LimitOffsetExpression = TypeSet< + $number, + Cardinality.Empty | Cardinality.One | Cardinality.AtMostOne +>; +export type LimitExpression = TypeSet< + $number, + Cardinality.Empty | Cardinality.One | Cardinality.AtMostOne +>; + +export type SelectModifierNames = + | "filter" + | "filter_single" + | "order_by" + | "offset" + | "limit"; + +export type exclusivesToFilterSingle = + ExclusiveTuple extends E + ? never + : E extends [] + ? never + : { + [j in keyof E]: { + [k in keyof E[j]]: E[j][k] extends ObjectTypeSet + ? TypeSet< + anonymizeObject, + E[j][k]["__cardinality__"] + > + : orLiteralValue; + }; + }[number]; +export type SelectModifiers = { + // export type SelectModifiers = { + filter?: SelectFilterExpression; + filter_single?: // | Partial< + // typeutil.stripNever<{ + // [k in keyof T["__pointers__"]]: T["__pointers__"][k] + // extends PropertyDesc + // ? orScalarLiteral<{ + // __element__: T["__pointers__"][k]["target"]; + // __cardinality__: T["__pointers__"][k]["cardinality"]; + // }> + // : never; + // }> + // > + + // | (ObjectType extends T + // ? unknown + // : typeutil.stripNever<{ + // [k in keyof T["__pointers__"]]: T["__pointers__"][k] + // extends PropertyDesc< + // infer T, + // infer C, + // infer E + // > + // ? E extends true + // ? orScalarLiteral<{ + // __element__: T; + // __cardinality__: C; + // }> + // : never + // : never; + // }>) + exclusivesToFilterSingle | SelectFilterExpression; + + // | (ObjectType extends T + // ? unknown + // : typeutil.stripNever<{ + // [k in keyof T["__pointers__"]]: T["__pointers__"][k] + // extends PropertyDesc< + // infer T, + // infer C, + // infer E + // > + // ? E extends true + // ? orScalarLiteral<{ + // __element__: T; + // __cardinality__: C; + // }> + // : never + // : never; + // }>); + order_by?: OrderByExpression; + offset?: OffsetExpression | number; + limit?: LimitExpression | number; +}; + +export type UnknownSelectModifiers = { [k in keyof SelectModifiers]: unknown }; + +export type NormalisedSelectModifiers = { + filter?: SelectFilterExpression; + order_by?: OrderByObjExpr[]; + offset?: OffsetExpression; + limit?: LimitExpression; + singleton: boolean; +}; + +// type NormaliseOrderByModifier = +// Mods extends OrderByExpr +// ? [{expression: Mods}] +// : Mods extends OrderByObjExpr +// ? [Mods] +// : Mods extends (OrderByExpr | OrderByObjExpr)[] +// ? { +// [K in keyof Mods]: Mods[K] extends OrderByExpr +// ? {expression: Mods[K]} +// : Mods[K]; +// } +// : []; + +// type NormaliseSelectModifiers = { +// filter: Mods["filter"]; +// order_by: Mods["order_by"] extends OrderByExpression +// ? NormaliseOrderByModifier +// : []; +// offset: Mods["offset"] extends number +// ? $expr_Literal> +// : Mods["offset"]; +// limit: Mods["offset"] extends number +// ? $expr_Literal> +// : Mods["offset"]; +// }; + +export type $expr_Select = Expression<{ + __element__: Set["__element__"]; + __cardinality__: Set["__cardinality__"]; + __expr__: TypeSet; + __kind__: ExpressionKind.Select; + __modifiers__: NormalisedSelectModifiers; + __scope__?: ObjectTypeExpression; +}>; +// Modifier methods removed for now, until we can fix typescript inference +// problems / excessively deep errors +// & SelectModifierMethods>; + +export interface SelectModifierMethods { + filter( + filter: + | Filter + | (( + scope: Root extends ObjectTypeSet + ? $scopify + : stripSet + ) => Filter) + ): this; + order_by( + order_by: + | OrderByExpression + | (( + scope: Root extends ObjectTypeSet + ? $scopify + : stripSet + ) => OrderByExpression) + ): this; + offset( + offset: + | OffsetExpression + | number + | (( + scope: Root extends ObjectTypeSet + ? $scopify + : stripSet + ) => OffsetExpression | number) + ): this; + // $expr_Select<{ + // __element__: Root["__element__"]; + // __cardinality__: cardutil.overrideLowerBound< + // Root["__cardinality__"], + // "Zero" + // >; + // }>; + limit( + limit: + | LimitExpression + | number + | (( + scope: Root extends ObjectTypeSet + ? $scopify + : stripSet + ) => LimitExpression | number) + ): this; + // $expr_Select<{ + // __element__: Root["__element__"]; + // __cardinality__: cardutil.overrideLowerBound< + // Root["__cardinality__"], + // "Zero" + // >; + // }>; +} +// Base is ObjectTypeSet & +// Filter is equality & +// Filter.args[0] is PathLeaf +// Filter.args[0] is __exclusive__ & +// Filter.args[0].parent.__element__ === Base.__element__ +// Filter.args[1].__cardinality__ is AtMostOne or One +// if Filter.args[0] is PathNode: +// Filter.args[0] is __exclusive__ & +// if Filter.args[0].parent === null +// Filter.args[0].parent.__element__ === Base.__element__ +// Filter.args[1].__cardinality__ is AtMostOne or One +// else +// Filter.args[0].type.__element__ === Base.__element__ & +// Filter.args[1].__cardinality__ is AtMostOne or One + +// type argCardToResultCard< +// OpCard extends Cardinality, +// BaseCase extends Cardinality +// > = [OpCard] extends [Cardinality.AtMostOne | Cardinality.One] +// ? Cardinality.AtMostOne +// : [OpCard] extends [Cardinality.Empty] +// ? Cardinality.Empty +// : BaseCase; + +// export type InferFilterCardinality< +// Base extends TypeSet, +// Filter +// > = Filter extends TypeSet +// ? // Base is ObjectTypeExpression & +// Base extends ObjectTypeSet // $expr_PathNode +// ? // Filter is equality +// Filter extends $expr_Operator<"=", any, infer Args, any> +// ? // Filter.args[0] is PathLeaf +// Args[0] extends $expr_PathLeaf +// ? // Filter.args[0] is unique +// Args[0]["__exclusive__"] extends true +// ? // Filter.args[0].parent.__element__ === Base.__element__ +// typeutil.assertEqual extends true +// ? // Filter.args[1].__cardinality__ is AtMostOne or One +// argCardToResultCard< +// Args[1]["__cardinality__"], +// Base["__cardinality__"] +// > +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Args[0] extends $expr_PathNode +// ? Args[0]["__exclusive__"] extends true +// ? // Filter.args[0].parent.__element__ === Base.__element__ +// Args[0]["__parent__"] extends null +// ? typeutil.assertEqual< +// Args[0]["__element__"]["__name__"], +// Base["__element__"]["__name__"] +// > extends true +// ? // Filter.args[1].__cardinality__ is AtMostOne or One +// argCardToResultCard< +// Args[1]["__cardinality__"], +// Base["__cardinality__"] +// > +// : Base["__cardinality__"] +// : Args[0]["__parent__"] extends infer Parent +// ? Parent extends PathParent +// ? typeutil.assertEqual< +// Parent["type"]["__element__"]["__name__"], +// Base["__element__"]["__name__"] +// > extends true +// ? // Filter.args[1].__cardinality__ is AtMostOne or One +// argCardToResultCard< +// Args[1]["__cardinality__"], +// Base["__cardinality__"] +// > +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"]; + +export type InferOffsetLimitCardinality< + Card extends Cardinality, + Modifers extends UnknownSelectModifiers +> = Modifers["limit"] extends number | LimitExpression + ? cardutil.overrideLowerBound + : Modifers["offset"] extends number | OffsetExpression + ? cardutil.overrideLowerBound + : Card; + +// export type ComputeSelectCardinality< +// Expr extends ObjectTypeExpression, +// Modifiers extends UnknownSelectModifiers +// > = InferOffsetLimitCardinality< +// InferFilterCardinality, +// Modifiers +// >; +export type ComputeSelectCardinality< + Expr extends ObjectTypeExpression, + Modifiers extends UnknownSelectModifiers +> = InferOffsetLimitCardinality< + undefined extends Modifiers["filter_single"] + ? Expr["__cardinality__"] + : cardutil.overrideUpperBound, + Modifiers +>; + +export function is< + Expr extends ObjectTypeExpression, + Shape extends objectTypeToSelectShape +>( + expr: Expr, + shape: Shape +): { + [k in Exclude< + keyof Shape, + SelectModifierNames | "id" + >]: $expr_PolyShapeElement>; +} { + const mappedShape: any = {}; + for (const [key, value] of Object.entries(shape)) { + if (key === "id") continue; + mappedShape[key] = { + __kind__: ExpressionKind.PolyShapeElement, + __polyType__: expr, + __shapeElement__: value, + }; + } + return mappedShape; +} + +// function computeFilterCardinality( +// expr: SelectFilterExpression, +// cardinality: Cardinality, +// base: TypeSet +// ) { +// let card = cardinality; + +// const filter: any = expr; +// // Base is ObjectExpression +// const baseIsObjectExpr = base?.__element__?.__kind__ === TypeKind.object; +// const filterExprIsEq = +// filter.__kind__ === ExpressionKind.Operator && filter.__name__ === "="; +// const arg0: $expr_PathLeaf | $expr_PathNode = filter?.__args__?.[0]; +// const arg1: TypeSet = filter?.__args__?.[1]; +// const argsExist = !!arg0 && !!arg1 && !!arg1.__cardinality__; +// const arg0IsUnique = arg0?.__exclusive__ === true; + +// if (baseIsObjectExpr && filterExprIsEq && argsExist && arg0IsUnique) { +// const newCard = +// arg1.__cardinality__ === Cardinality.One || +// arg1.__cardinality__ === Cardinality.AtMostOne +// ? Cardinality.AtMostOne +// : arg1.__cardinality__ === Cardinality.Empty +// ? Cardinality.Empty +// : cardinality; + +// if (arg0.__kind__ === ExpressionKind.PathLeaf) { +// const arg0ParentMatchesBase = +// arg0.__parent__.type.__element__.__name__ === +// base.__element__.__name__; +// if (arg0ParentMatchesBase) { +// card = newCard; +// } +// } else if (arg0.__kind__ === ExpressionKind.PathNode) { +// // if Filter.args[0] is PathNode: +// // Filter.args[0] is __exclusive__ & +// // if Filter.args[0].parent === null +// // Filter.args[0].__element__ === Base.__element__ +// // Filter.args[1].__cardinality__ is AtMostOne or One +// // else +// // Filter.args[0].type.__element__ === Base.__element__ & +// // Filter.args[1].__cardinality__ is AtMostOne or One +// const parent = arg0.__parent__; +// if (parent === null) { +// const arg0MatchesBase = +// arg0.__element__.__name__ === base.__element__.__name__; +// if (arg0MatchesBase) { +// card = newCard; +// } +// } else { +// const arg0ParentMatchesBase = +// parent?.type.__element__.__name__ === base.__element__.__name__; +// if (arg0ParentMatchesBase) { +// card = newCard; +// } +// } +// } +// } + +// return card; +// } + +export function $handleModifiers( + modifiers: SelectModifiers, + params: { root: TypeSet; scope: TypeSet } +): { + modifiers: NormalisedSelectModifiers; + cardinality: Cardinality; + needsAssertSingle: boolean; +} { + const { root, scope } = params; + const mods: NormalisedSelectModifiers = { + singleton: !!modifiers["filter_single"], + }; + + let card = root.__cardinality__; + let needsAssertSingle = false; + + if (modifiers.filter) { + mods.filter = modifiers.filter; + // card = computeFilterCardinality(mods.filter, card, rootExpr); + } + + if (modifiers.filter_single) { + if (root.__element__.__kind__ !== TypeKind.object) { + throw new Error("filter_single can only be used with object types"); + } + card = Cardinality.AtMostOne; + // mods.filter = modifiers.filter_single; + const fs: any = modifiers.filter_single; + if (fs.__element__) { + mods.filter = modifiers.filter_single as any; + needsAssertSingle = true; + } else { + const exprs = Object.keys(fs).map((key) => { + const val = fs[key].__element__ + ? fs[key] + : (literal as any)( + (root.__element__ as any as ObjectType)["__pointers__"][key]![ + "target" + ], + fs[key] + ); + return $expressionify({ + __element__: { + __name__: "std::bool", + __kind__: TypeKind.scalar, + } as any, + __cardinality__: Cardinality.One, + __kind__: ExpressionKind.Operator, + __opkind__: OperatorKind.Infix, + __name__: "=", + __args__: [(scope as any)[key], val], + }) as $expr_Operator; + }); + if (exprs.length === 1) { + mods.filter = exprs[0] as any; + } else { + mods.filter = exprs.reduce((a, b) => { + return $expressionify({ + __element__: { + __name__: "std::bool", + __kind__: TypeKind.scalar, + } as any, + __cardinality__: Cardinality.One, + __kind__: ExpressionKind.Operator, + __opkind__: OperatorKind.Infix, + __name__: "and", + __args__: [a, b], + }) as $expr_Operator; + }) as any; + } + } + } + if (modifiers.order_by) { + const orderExprs = Array.isArray(modifiers.order_by) + ? modifiers.order_by + : [modifiers.order_by]; + mods.order_by = orderExprs.map((expr) => + typeof (expr as any).__element__ === "undefined" + ? expr + : { expression: expr } + ) as any; + } + if (modifiers.offset) { + mods.offset = + typeof modifiers.offset === "number" + ? ($getTypeByName("std::number")(modifiers.offset) as any) + : modifiers.offset; + card = cardutil.overrideLowerBound(card, "Zero"); + } + if (modifiers.limit) { + let expr: LimitExpression; + if (typeof modifiers.limit === "number") { + expr = $getTypeByName("std::number")(modifiers.limit) as any; + } else { + const type = + (modifiers.limit.__element__ as any).__casttype__ ?? + modifiers.limit.__element__; + if ( + type.__kind__ === TypeKind.scalar && + type.__name__ === "std::number" + ) { + expr = modifiers.limit; + } else { + throw new Error("Invalid value for `limit` modifier"); + } + } + mods.limit = expr; + card = cardutil.overrideLowerBound(card, "Zero"); + } + + return { + modifiers: mods as NormalisedSelectModifiers, + cardinality: card, + needsAssertSingle, + }; +} + +export type $expr_Delete = + Expression<{ + __kind__: ExpressionKind.Delete; + __element__: Root["__element__"]; + __cardinality__: Root["__cardinality__"]; + __expr__: ObjectTypeSet; + }>; + +function deleteExpr< + Expr extends ObjectTypeExpression, + Modifiers extends SelectModifiers +>( + expr: Expr, + modifiers?: (scope: $scopify) => Readonly +): $expr_Delete<{ + __element__: ObjectType< + Expr["__element__"]["__name__"], + Expr["__element__"]["__pointers__"], + { id: true } + >; + __cardinality__: ComputeSelectCardinality; +}>; +function deleteExpr(expr: any, modifiersGetter: any) { + const selectExpr = select(expr, modifiersGetter); + + return $expressionify({ + __kind__: ExpressionKind.Delete, + __element__: selectExpr.__element__, + __cardinality__: selectExpr.__cardinality__, + __expr__: selectExpr, + }) as any; +} + +export { deleteExpr as delete }; + +// Modifier methods removed for now, until we can fix typescript inference +// problems / excessively deep errors + +// function resolveModifierGetter(parent: any, modGetter: any) { +// if (typeof modGetter === "function" && !modGetter.__kind__) { +// if (parent.__expr__.__element__.__kind__ === TypeKind.object) { +// const shape = parent.__element__.__shape__; +// const _scope = +// parent.__scope__ ?? $getScopedExpr(parent.__expr__, +// $existingScopes); +// const scope = new Proxy(_scope, { +// get(target: any, prop: string) { +// if (shape[prop] && shape[prop] !== true) { +// return shape[prop]; +// } +// return target[prop]; +// }, +// }); +// return { +// scope: _scope, +// modExpr: modGetter(scope), +// }; +// } else { +// return { +// scope: undefined, +// modExpr: modGetter(parent.__expr__), +// }; +// } +// } else { +// return {scope: parent.__scope__, modExpr: modGetter}; +// } +// } + +// function updateModifier( +// parent: any, +// modName: "filter" | "order_by" | "offset" | "limit", +// modGetter: any +// ) { +// const modifiers = { +// ...parent.__modifiers__, +// }; +// const cardinality = parent.__cardinality__; + +// const {modExpr, scope} = resolveModifierGetter(parent, modGetter); + +// switch (modName) { +// case "filter": +// modifiers.filter = modifiers.filter +// ? op(modifiers.filter, "and", modExpr) +// : modExpr; + +// // methods no longer change cardinality +// // cardinality = computeFilterCardinality( +// // modExpr, +// // cardinality, +// // parent.__expr__ +// // ); +// break; +// case "order_by": +// const ordering = +// typeof (modExpr as any).__element__ === "undefined" +// ? modExpr +// : {expression: modExpr}; +// modifiers.order_by = modifiers.order_by +// ? [...modifiers.order_by, ordering] +// : [ordering]; +// break; +// case "offset": +// modifiers.offset = +// typeof modExpr === "number" ? _std.number(modExpr) : modExpr; +// // methods no longer change cardinality +// // cardinality = cardutil +// .overrideLowerBound(cardinality, "Zero"); +// break; +// case "limit": +// modifiers.limit = +// typeof modExpr === "number" +// ? _std.number(modExpr) +// : (modExpr as any).__kind__ === ExpressionKind.Set +// ? (modExpr as any).__exprs__[0] +// : modExpr; +// // methods no longer change cardinality +// // cardinality = cardutil +// .overrideLowerBound(cardinality, "Zero"); +// break; +// } + +// return $expressionify( +// $selectify({ +// __kind__: ExpressionKind.Select, +// __element__: parent.__element__, +// __cardinality__: cardinality, +// __expr__: parent.__expr__, +// __modifiers__: modifiers, +// __scope__: scope, +// }) +// ); +// } + +export function $selectify(expr: Expr) { + // Object.assign(expr, { + // filter: (filter: any) => updateModifier(expr, "filter", filter), + // order_by: (order_by: any) => updateModifier(expr, "order_by", order_by), + // offset: (offset: any) => updateModifier(expr, "offset", offset), + // limit: (limit: any) => updateModifier(expr, "limit", limit), + // }); + return expr; +} + +export type linkDescToLinkProps = { + [k in keyof Desc["properties"] & string]: $expr_PathLeaf< + TypeSet< + Desc["properties"][k]["target"], + Desc["properties"][k]["cardinality"] + > + // { + // type: $scopify; + // linkName: k; + // }, + // Desc["properties"][k]["exclusive"] + >; +}; + +export type pointersToObjectType

= ObjectType< + string, + P, + {} +>; + +type linkDescToShape = objectTypeToSelectShape< + L["target"] +> & + objectTypeToSelectShape> & + SelectModifiers; +export type linkDescToSelectElement = + | boolean + // | pointerToCastableExpression + | TypeSet, cardutil.assignable> + | linkDescToShape + | (( + scope: $scopify & linkDescToLinkProps + ) => linkDescToShape); + +// object types -> pointers +// pointers -> links +// links -> target object type +// links -> link properties +export type objectTypeToSelectShape = + // ObjectType extends T + // ? {[k: string]: unknown} + // : + Partial<{ + [k in keyof T["__pointers__"]]: T["__pointers__"][k] extends PropertyDesc + ? + | boolean + | TypeSet< + T["__pointers__"][k]["target"], + cardutil.assignable + > + | $expr_PolyShapeElement + : T["__pointers__"][k] extends LinkDesc + ? linkDescToSelectElement + : any; + }> & { [k: string]: unknown }; + +// incorporate __shape__ (computeds) on selection shapes +// this works but a major rewrite of setToTsType is required +// to incorporate __shape__-based selection shapes into +// result type inference +// & [k in keyof T["__shape__"]]: +// string | number | symbol extends k // Partial<{ // & +// ? unknown +// : T["__shape__"][k] extends infer U +// ? U extends ObjectTypeSet +// ? +// | boolean +// | TypeSet< +// anonymizeObject, +// cardutil.assignable +// > +// | objectTypeToSelectShape +// | (( +// scope: $scopify +// ) => objectTypeToSelectShape & +// SelectModifiers) +// : U extends TypeSet +// ? +// | boolean +// | TypeSet< +// U["__element__"], +// cardutil.assignable +// > +// : unknown +// : unknown; +// }> + +export type normaliseElement = El extends boolean + ? El + : El extends TypeSet + ? stripSet + : El extends (...scope: any[]) => any + ? normaliseShape> + : El extends object + ? normaliseShape> + : stripSet; + +export type normaliseShape< + Shape extends object, + Strip = SelectModifierNames +> = { + [k in Exclude]: normaliseElement; +}; + +const $FreeObject = makeType( + spec, + [...spec.values()].find((s) => s.name === "std::FreeObject")!.id, + literal +); +const FreeObject: $expr_PathNode = { + __kind__: ExpressionKind.PathNode, + __element__: $FreeObject as any, + __cardinality__: Cardinality.One, + __parent__: null, + __exclusive__: true, + __scopeRoot__: null, +} as any; + +export const $existingScopes = new Set< + Expression> +>(); + +function $shape< + Expr extends ObjectTypeExpression, + Shape extends objectTypeToSelectShape & + SelectModifiers // +>( + expr: Expr, + _shape: ( + scope: $scopify & + $linkPropify<{ + [k in keyof Expr]: k extends "__cardinality__" + ? Cardinality.One + : Expr[k]; + }> + ) => Readonly +): (scope: unknown) => Readonly; +function $shape(_a: unknown, b: (...args: any) => any) { + return b; +} +export { $shape as shape }; + +export function select( + expr: Expr +): $expr_Select<{ + __element__: ObjectType< + `${Expr["__element__"]["__name__"]}`, // _shape + Expr["__element__"]["__pointers__"], + Expr["__element__"]["__shape__"] // {id: true} + >; + __cardinality__: Expr["__cardinality__"]; +}>; +export function select( + expr: Expr +): $expr_Select>; +export function select< + Expr extends ObjectTypeExpression, + Shape extends objectTypeToSelectShape & + SelectModifiers, + Modifiers extends UnknownSelectModifiers = Pick +>( + expr: Expr, + shape: ( + scope: $scopify & + $linkPropify<{ + [k in keyof Expr]: k extends "__cardinality__" + ? Cardinality.One + : Expr[k]; + }> + ) => Readonly +): $expr_Select<{ + __element__: ObjectType< + `${Expr["__element__"]["__name__"]}`, // _shape + Expr["__element__"]["__pointers__"], + Omit, SelectModifierNames> + >; + __cardinality__: ComputeSelectCardinality; +}>; +/* + +For the moment is isn't possible to implement both closure-based and plain +object overloads without breaking autocomplete on one or the other. +This is due to a limitation in TS: + +https://github.com/microsoft/TypeScript/issues/26892 +https://github.com/microsoft/TypeScript/issues/47081 + +*/ + +export function select< + Expr extends PrimitiveTypeSet, + Modifiers extends SelectModifiers +>( + expr: Expr, + modifiers: (expr: Expr) => Readonly +): $expr_Select<{ + __element__: Expr["__element__"]; + __cardinality__: InferOffsetLimitCardinality< + Expr["__cardinality__"], + Modifiers + >; +}>; +export function select( + shape: Shape +): $expr_Select<{ + __element__: ObjectType< + `std::FreeObject`, + { + [k in keyof Shape]: Shape[k]["__element__"] extends ObjectType + ? LinkDesc< + Shape[k]["__element__"], + Shape[k]["__cardinality__"], + {}, + false, + true, + true, + false + > + : PropertyDesc< + Shape[k]["__element__"], + Shape[k]["__cardinality__"], + false, + true, + true, + false + >; + }, + Shape + >; // _shape + __cardinality__: Cardinality.One; +}>; +export function select( + expr: Expr +): $expr_Select<{ + __element__: literalToScalarType; + __cardinality__: Cardinality.One; +}>; +export function select(...args: any[]) { + const firstArg = args[0]; + + if ( + typeof firstArg !== "object" || + firstArg instanceof Uint8Array || + firstArg instanceof Date || + firstArg instanceof Duration || + firstArg instanceof LocalDateTime || + firstArg instanceof LocalDate || + firstArg instanceof LocalTime || + firstArg instanceof RelativeDuration || + firstArg instanceof DateDuration || + firstArg instanceof ConfigMemory + ) { + const literalExpr = literalToTypeSet(firstArg); + return $expressionify( + $selectify({ + __kind__: ExpressionKind.Select, + __element__: literalExpr.__element__, + __cardinality__: literalExpr.__cardinality__, + __expr__: literalExpr, + __modifiers__: {}, + }) + ) as any; + } + + const exprPair: [TypeSet, (scope: any) => any] = + typeof args[0].__element__ !== "undefined" + ? (args as any) + : [FreeObject, () => args[0]]; + + let expr = exprPair[0]; + const shapeGetter = exprPair[1]; + if (expr === FreeObject) { + const freeObjectPtrs: ObjectTypePointers = {}; + for (const [k, v] of Object.entries(args[0]) as [string, TypeSet][]) { + freeObjectPtrs[k] = { + __kind__: + v.__element__.__kind__ === TypeKind.object ? "link" : "property", + target: v.__element__, + + cardinality: v.__cardinality__, + exclusive: false, + computed: true, + readonly: true, + hasDefault: false, + properties: {}, + }; + } + expr = { + ...FreeObject, + __element__: { + ...FreeObject.__element__, + __pointers__: { + ...FreeObject.__element__.__pointers__, + ...freeObjectPtrs, + }, + } as any, + }; + } + if (!shapeGetter) { + if (expr.__element__.__kind__ === TypeKind.object) { + const objectExpr: ObjectTypeSet = expr as any; + return $expressionify( + $selectify({ + __kind__: ExpressionKind.Select, + __element__: { + __kind__: TypeKind.object, + __name__: `${objectExpr.__element__.__name__}`, // _shape + __pointers__: objectExpr.__element__.__pointers__, + __shape__: objectExpr.__element__.__shape__, + } as any, + __cardinality__: objectExpr.__cardinality__, + __expr__: objectExpr, + __modifiers__: {}, + }) + ) as any; + } else { + return $expressionify( + $selectify({ + __kind__: ExpressionKind.Select, + __element__: expr.__element__, + __cardinality__: expr.__cardinality__, + __expr__: expr, + __modifiers__: {}, + }) + ) as any; + } + } + + const cleanScopedExprs = $existingScopes.size === 0; + + const { modifiers: mods, shape, scope } = resolveShape(shapeGetter, expr); + + if (cleanScopedExprs) { + $existingScopes.clear(); + } + + const { modifiers, cardinality, needsAssertSingle } = $handleModifiers(mods, { + root: expr, + scope, + }); + const selectExpr = $selectify({ + __kind__: ExpressionKind.Select, + __element__: + expr.__element__.__kind__ === TypeKind.object + ? { + __kind__: TypeKind.object, + __name__: `${expr.__element__.__name__}`, // _shape + __pointers__: (expr.__element__ as ObjectType).__pointers__, + __shape__: shape, + } + : expr.__element__, + __cardinality__: cardinality, + __expr__: expr, + __modifiers__: modifiers, + __scope__: expr !== scope ? scope : undefined, + }) as any; + + return needsAssertSingle + ? $assert_single(selectExpr) + : $expressionify(selectExpr); +} + +function resolveShape( + shapeGetter: ((scope: any) => any) | any, + expr: TypeSet +): { modifiers: any; shape: any; scope: TypeSet } { + const modifiers: any = {}; + const shape: any = {}; + + // get scoped object if expression is objecttypeset + const scope = + expr.__element__.__kind__ === TypeKind.object + ? $getScopedExpr(expr as any, $existingScopes) + : expr; + + // execute getter with scope + const selectShape = + typeof shapeGetter === "function" ? shapeGetter(scope) : shapeGetter; + + for (const [key, value] of Object.entries(selectShape)) { + // handle modifier keys + if ( + key === "filter" || + key === "filter_single" || + key === "order_by" || + key === "offset" || + key === "limit" + ) { + modifiers[key] = value; + } else { + // for scalar expressions, scope === expr + // shape keys are not allowed + if (expr.__element__.__kind__ !== TypeKind.object) { + throw new Error( + `Invalid select shape key '${key}' on scalar expression, ` + + `only modifiers are allowed (filter, order_by, offset and limit)` + ); + } + shape[key] = resolveShapeElement(key, value, scope); + } + } + return { shape, modifiers, scope }; +} + +export function resolveShapeElement( + key: any, + value: any, + scope: ObjectTypeExpression +): any { + // if value is a nested closure + // or a nested shape object + const isSubshape = + typeof value === "object" && typeof (value as any).__kind__ === "undefined"; + const isClosure = + typeof value === "function" && + scope.__element__.__pointers__[key]?.__kind__ === "link"; + // if (isSubshape) { + // // return value; + // const childExpr = (scope as any)[key]; + // const { + // shape: childShape, + // // scope: childScope, + // // modifiers: mods, + // } = resolveShape(value as any, childExpr); + // return childShape; + // } + if (isSubshape || isClosure) { + // get child node expression + // this relies on Proxy-based getters + const childExpr = (scope as any)[key]; + if (!childExpr) { + throw new Error( + `Invalid shape element "${key}" for type ${scope.__element__.__name__}` + ); + } + const { + shape: childShape, + scope: childScope, + modifiers: mods, + } = resolveShape(value as any, childExpr); + + // extracts normalized modifiers + const { modifiers, needsAssertSingle } = $handleModifiers(mods, { + root: childExpr, + scope: childScope, + }); + + const selectExpr = { + __kind__: ExpressionKind.Select, + __element__: { + __kind__: TypeKind.object, + __name__: `${childExpr.__element__.__name__}`, + __pointers__: childExpr.__element__.__pointers__, + __shape__: childShape, + }, + __cardinality__: + scope.__element__.__pointers__?.[key]?.cardinality || + scope.__element__.__shape__?.[key]?.__cardinality__, + __expr__: childExpr, + __modifiers__: modifiers, + __scope__: childExpr !== childScope ? childScope : undefined, + }; + return needsAssertSingle ? $assert_single(selectExpr as any) : selectExpr; + } else if ((value as any)?.__kind__ === ExpressionKind.PolyShapeElement) { + const polyElement = value as $expr_PolyShapeElement; + + const polyScope = (scope as any).is(polyElement.__polyType__); + return { + __kind__: ExpressionKind.PolyShapeElement, + __polyType__: polyScope, + __shapeElement__: resolveShapeElement( + key, + polyElement.__shapeElement__, + polyScope + ), + }; + } else if (typeof value === "boolean" && key.startsWith("@")) { + const linkProp = (scope as any)[key]; + if (!linkProp) { + throw new Error( + (scope as any).__parent__ + ? `link property '${key}' does not exist on link ${ + (scope as any).__parent__.linkName + }` + : `cannot select link property '${key}' on an object (${scope.__element__.__name__})` + ); + } + return value ? linkProp : false; + } else { + return value; + } +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/set.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/set.ts new file mode 100644 index 000000000..479261822 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/set.ts @@ -0,0 +1,222 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { ExpressionKind, Cardinality } from "edgedb/dist/reflection/index"; +import { TypeKind } from "edgedb/dist/reflection/index"; +import type { + ArrayType, + BaseTypeTuple, + BaseType, + NamedTupleType, + ObjectTypeSet, + TypeSet, + TupleType, + Expression, + ObjectType, + getPrimitiveBaseType, + SomeType, +} from "./typesystem"; + +import { $mergeObjectTypes, mergeObjectTypes } from "./hydrate"; + +import * as castMaps from "./castMaps"; + +export function getSharedParent(a: SomeType, b: SomeType): SomeType { + if (a.__kind__ !== b.__kind__) { + throw new Error( + `Incompatible array types: ${a.__name__} and ${b.__name__}` + ); + } + if (a.__kind__ === TypeKind.scalar && b.__kind__ === TypeKind.scalar) { + return castMaps.getSharedParentScalar(a, b); + } else if (a.__kind__ === TypeKind.object && b.__kind__ === TypeKind.object) { + return $mergeObjectTypes(a, b); + } else if (a.__kind__ === TypeKind.tuple && b.__kind__ === TypeKind.tuple) { + if (a.__items__.length !== b.__items__.length) { + throw new Error( + `Incompatible tuple types: ${a.__name__} and ${b.__name__}` + ); + } + try { + const items = a.__items__.map((_, i) => { + if (!a.__items__[i] || !b.__items__[i]) { + throw new Error(); + } + return getSharedParent( + a.__items__[i] as SomeType, + b.__items__[i] as SomeType + ); + }); + + return { + __kind__: TypeKind.tuple, + __name__: `tuple<${items.map((item) => item.__name__).join(", ")}>`, + __items__: items as BaseTypeTuple, + }; + } catch (err) { + throw new Error( + `Incompatible tuple types: ${a.__name__} and ${b.__name__}` + ); + } + } else if ( + a.__kind__ === TypeKind.namedtuple && + b.__kind__ === TypeKind.namedtuple + ) { + const aKeys = Object.keys(a); + const bKeys = new Set(Object.keys(b)); + const sameKeys = + aKeys.length === bKeys.size && aKeys.every((k) => bKeys.has(k)); + if (!sameKeys) { + throw new Error( + `Incompatible tuple types: ${a.__name__} and ${b.__name__}` + ); + } + try { + const items: { [k: string]: BaseType } = {}; + for (const [i] of Object.entries(a.__shape__)) { + if (!a.__shape__[i] || !b.__shape__[i]) { + throw new Error(); + } + items[i] = getSharedParent( + a.__shape__[i] as SomeType, + b.__shape__[i] as SomeType + ); + } + + return { + __kind__: TypeKind.namedtuple, + __name__: `tuple<${Object.entries(items) + .map(([key, val]: [string, any]) => `${key}: ${val.__name__}`) + .join(", ")}>`, + __shape__: items, + }; + } catch (err) { + throw new Error( + `Incompatible tuple types: ${a.__name__} and ${b.__name__}` + ); + } + } else if (a.__kind__ === TypeKind.array && b.__kind__ === TypeKind.array) { + try { + const mergedEl: any = getSharedParent( + a.__element__ as any, + b.__element__ as any + ); + return { + __kind__: TypeKind.array, + __name__: a.__name__, + __element__: mergedEl, + } as ArrayType; + } catch (err) { + throw new Error( + `Incompatible array types: ${a.__name__} and ${b.__name__}` + ); + } + } else if (a.__kind__ === TypeKind.enum && b.__kind__ === TypeKind.enum) { + if (a.__name__ === b.__name__) return a; + throw new Error( + `Incompatible array types: ${a.__name__} and ${b.__name__}` + ); + } else { + throw new Error( + `Incompatible array types: ${a.__name__} and ${b.__name__}` + ); + } +} + +export { set } from "./setImpl"; + +// export type $expr_Set = Expression< +export type $expr_Set = Expression<{ + __element__: Set["__element__"]; + __cardinality__: Set["__cardinality__"]; + __exprs__: TypeSet[]; + __kind__: ExpressionKind.Set; +}>; + +type mergeTypeTuples = { + [k in keyof AItems]: k extends keyof BItems + ? getSharedParentPrimitive + : never; +}; + +// find shared parent of two primitives +export type getSharedParentPrimitive = A extends undefined + ? B extends undefined + ? undefined + : B + : B extends undefined + ? A + : A extends ArrayType + ? B extends ArrayType + ? ArrayType> + : never + : A extends NamedTupleType + ? B extends NamedTupleType + ? NamedTupleType<{ + [k in keyof AShape & keyof BShape]: castMaps.getSharedParentScalar< + AShape[k], + BShape[k] + >; + }> + : never + : A extends TupleType + ? B extends TupleType + ? mergeTypeTuples extends BaseTypeTuple + ? TupleType> + : never + : never + : castMaps.getSharedParentScalar; + +type _getSharedParentPrimitiveVariadic = + Types extends [infer U] + ? U + : Types extends [infer A, infer B, ...infer Rest] + ? _getSharedParentPrimitiveVariadic< + [getSharedParentPrimitive, ...Rest] + > + : never; + +export type getSharedParentPrimitiveVariadic = + _getSharedParentPrimitiveVariadic; + +export type LooseTypeSet< + T extends any = any, + C extends Cardinality = Cardinality +> = { + __element__: T; + __cardinality__: C; +}; + +export type { mergeObjectTypes }; + +type _mergeObjectTypesVariadic = + Types extends [infer U] + ? U + : Types extends [infer A, infer B, ...infer Rest] + ? A extends ObjectType + ? B extends ObjectType + ? mergeObjectTypes extends BaseType + ? mergeObjectTypesVariadic<[mergeObjectTypes, ...Rest]> + : never + : never + : never + : never; + +export type mergeObjectTypesVariadic = + _mergeObjectTypesVariadic; + +export type getTypesFromExprs = { + [k in keyof Exprs]: Exprs[k] extends TypeSet + ? getPrimitiveBaseType + : never; +}; + +export type getTypesFromObjectExprs< + Exprs extends [ObjectTypeSet, ...ObjectTypeSet[]] +> = { + [k in keyof Exprs]: Exprs[k] extends TypeSet ? El : never; +}; + +export type getCardsFromExprs = { + [k in keyof Exprs]: Exprs[k] extends TypeSet ? Card : never; +}; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/setImpl.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/setImpl.ts new file mode 100644 index 000000000..6dbb249ea --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/setImpl.ts @@ -0,0 +1,114 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import * as $ from "./reflection"; +import * as castMaps from "./castMaps"; +import { $expressionify } from "./path"; +import type { $expr_Set, mergeObjectTypesVariadic, getTypesFromExprs, getTypesFromObjectExprs, getCardsFromExprs, getSharedParentPrimitiveVariadic, LooseTypeSet } from "./set"; +import { getSharedParent } from "./set"; +import type * as _cal from "./modules/cal"; +import type * as _std from "./modules/std"; + +type getSetTypeFromExprs< + Exprs extends [$.TypeSet, ...$.TypeSet[]] +> = LooseTypeSet< + getSharedParentPrimitiveVariadic>, + $.cardutil.mergeCardinalitiesVariadic> +>; + +function set(): null; +function set< + Expr extends castMaps.orScalarLiteral<$.TypeSet> +>(expr: Expr): $expr_Set>; +function set< + Expr extends castMaps.orScalarLiteral<$.TypeSet<_cal.$relative_durationλICastableTo>>, + Exprs extends [Expr, ...Expr[]] +>(...exprs: Exprs): $expr_Set>>; +function set< + Expr extends $.TypeSet<$.ArrayType<_cal.$relative_durationλICastableTo>>, + Exprs extends [Expr, ...Expr[]] +>(...exprs: Exprs): $expr_Set>; +function set< + Expr extends castMaps.orScalarLiteral<$.TypeSet<_cal.$local_datetimeλICastableTo>>, + Exprs extends [Expr, ...Expr[]] +>(...exprs: Exprs): $expr_Set>>; +function set< + Expr extends $.TypeSet<$.ArrayType<_cal.$local_datetimeλICastableTo>>, + Exprs extends [Expr, ...Expr[]] +>(...exprs: Exprs): $expr_Set>; +function set< + Expr extends castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + Exprs extends [Expr, ...Expr[]] +>(...exprs: Exprs): $expr_Set>>; +function set< + Expr extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + Exprs extends [Expr, ...Expr[]] +>(...exprs: Exprs): $expr_Set>; +function set< + Expr extends $.ObjectTypeSet, + Exprs extends [Expr, ...Expr[]] +>( + ...exprs: Exprs +): $expr_Set< + LooseTypeSet< + mergeObjectTypesVariadic>, + $.cardutil.mergeCardinalitiesVariadic> + > +>; +function set< + Expr extends $.TypeSet<$.AnyTupleType>, + Exprs extends [Expr, ...Expr[]] +>(...exprs: Exprs): $expr_Set>; +function set< + Expr extends $.TypeSet<$.BaseType> | castMaps.scalarLiterals, + Exprs extends castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveBaseType["__element__"]>> + >[] +>( + expr: Expr, + ...exprs: Exprs +): $expr_Set< + $.TypeSet< + $.getPrimitiveBaseType["__element__"]>, + $.cardutil.mergeCardinalitiesVariadic< + getCardsFromExprs> + > + > +>; +function set | castMaps.scalarLiterals>( + ...exprs: Expr[] +): $expr_Set< + $.TypeSet< + $.getPrimitiveBaseType["__element__"]>, + $.Cardinality.Many + > +>; +function set(..._exprs: any[]) { + // if no arg + // if arg + // return empty set + // if object set + // merged objects + // if primitive + // return shared parent of scalars + if(_exprs.length === 0){ + return null; + } + + const exprs: $.TypeSet[] = _exprs.map(expr => castMaps.literalToTypeSet(expr)); + + return $expressionify({ + __kind__: $.ExpressionKind.Set, + __element__: exprs + .map(expr => expr.__element__ as any) + .reduce(getSharedParent), + __cardinality__: $.cardutil.mergeCardinalitiesVariadic( + exprs.map(expr => expr.__cardinality__) as any + ), + __exprs__: exprs, + }) as any; + +} + + +export { set }; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/syntax.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/syntax.ts new file mode 100644 index 000000000..5bb7db95d --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/syntax.ts @@ -0,0 +1,24 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { TypeSet, setToTsType } from "./typesystem"; + +export * from "./literal"; +export * from "./path"; +export * from "./set"; +export * from "./cast"; +export * from "./select"; +export * from "./update"; +export * from "./insert"; +export * from "./group"; +export * from "./collections"; +export * from "./funcops"; +export * from "./for"; +export * from "./with"; +export * from "./params"; +export * from "./globals"; +export * from "./detached"; +export * from "./toEdgeQL"; +export * from "./range"; + +export type $infer = setToTsType; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/toEdgeQL.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/toEdgeQL.ts new file mode 100644 index 000000000..b2ba4a34c --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/toEdgeQL.ts @@ -0,0 +1,1669 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { + Duration, + LocalDate, + LocalDateTime, + LocalTime, + RelativeDuration, + DateDuration, + Range, +} from "edgedb"; +import { + Cardinality, + ExpressionKind, + OperatorKind, + TypeKind, + util, +} from "edgedb/dist/reflection/index"; +import { + $expr_Array, + $expr_NamedTuple, + $expr_Tuple, + $expr_TuplePath, + BaseType, + EnumType, + isArrayType, + isNamedTupleType, + isObjectType, + isTupleType, + ObjectType, + ObjectTypeSet, + RangeType, + TypeSet, +} from "./typesystem"; +import type { $expr_Literal } from "./literal"; +import type { + $expr_PathLeaf, + $expr_PathNode, + $expr_TypeIntersection, +} from "./path"; +import { reservedKeywords } from "edgedb/dist/reflection/index"; +import type { $expr_Cast } from "./cast"; +import type { $expr_Detached } from "./detached"; +import type { $expr_For, $expr_ForVar } from "./for"; +import type { $expr_Function, $expr_Operator } from "./funcops"; +import type { $expr_Insert, $expr_InsertUnlessConflict } from "./insert"; +import type { $expr_Param, $expr_WithParams } from "./params"; +import type { + $expr_Delete, + $expr_Select, + LimitExpression, + OffsetExpression, +} from "./select"; +import type { $expr_Set } from "./set"; +import type { $expr_Update } from "./update"; +import type { $expr_Alias, $expr_With } from "./with"; +import type { $expr_Group, GroupingSet } from "./group"; +import type { $expr_Global } from "./globals"; + +export type SomeExpression = + | $expr_PathNode + | $expr_PathLeaf + | $expr_Literal + | $expr_Set + | $expr_Array + | $expr_Tuple + | $expr_NamedTuple + | $expr_TuplePath + | $expr_Cast + | $expr_Select + | $expr_Delete + | $expr_Update + | $expr_Insert + | $expr_InsertUnlessConflict + | $expr_Function + | $expr_Operator + | $expr_For + | $expr_ForVar + | $expr_TypeIntersection + | $expr_Alias + | $expr_With + | $expr_WithParams + | $expr_Param + | $expr_Detached + | $expr_Group + | $expr_Global; + +type WithScopeExpr = + | $expr_Select + | $expr_Update + | $expr_Insert + | $expr_InsertUnlessConflict + | $expr_For + | $expr_Group; + +interface RenderCtx { + // mapping withable expr to list of with vars + withBlocks: Map>; + // metadata about each with var + withVars: Map< + SomeExpression, + { + name: string; + scope: WithScopeExpr; + childExprs: Set; + scopedExpr?: SomeExpression; // scope vars only + } + >; + renderWithVar?: SomeExpression; + forVars: Map<$expr_ForVar, string>; + linkProps: Map; +} + +const toEdgeQLCache = new WeakMap(); + +export function $toEdgeQL(this: any) { + if (toEdgeQLCache.has(this)) { + return toEdgeQLCache.get(this)!; + } + + const walkExprCtx: WalkExprTreeCtx = { + seen: new Map(), + rootScope: null, + }; + + walkExprTree(this, null, walkExprCtx); + + // get variables by block + const withBlocks: RenderCtx["withBlocks"] = new Map(); + // get per-variable metadata + const withVars: RenderCtx["withVars"] = new Map(); + const seen = new Map(walkExprCtx.seen); + const linkProps: RenderCtx["linkProps"] = new Map(); + + // iterate over all expressions + for (const [expr, refData] of seen) { + // delete from seen after visitinng + seen.delete(expr); + + // convert referenced link props to simple string array + if (refData.linkProps.length) { + linkProps.set( + expr, + refData.linkProps.map((linkProp) => + linkProp.__parent__.linkName.slice(1) + ) + ); + } + + // already extracted + if (withVars.has(expr)) { + continue; + } + + // ignore unbound leaves, nodes, and intersections + // these should be rendered as is + if ( + !refData.boundScope && + (expr.__kind__ === ExpressionKind.PathLeaf || + expr.__kind__ === ExpressionKind.PathNode || + expr.__kind__ === ExpressionKind.TypeIntersection) + ) { + continue; + } + + // forvars and params should not be hoisted + if ( + expr.__kind__ === ExpressionKind.ForVar || + expr.__kind__ === ExpressionKind.Param + ) { + continue; + } + + // pull out scope variables + // from select, update, and group expressions. + // these are always rendered in with blocks + if ( + (expr.__kind__ === ExpressionKind.Select || + expr.__kind__ === ExpressionKind.Update || + expr.__kind__ === ExpressionKind.Group) && + expr.__scope__ && + // with var not previously registered + !withVars.has(expr.__scope__ as any) + ) { + const withBlock = expr; + const scopeVar = expr.__scope__ as SomeExpression; + const scopeVarName = `__scope_${ + withVars.size + }_${scopeVar.__element__.__name__.replace(/[^A-Za-z]/g, "")}`; + + withVars.set(scopeVar, { + name: scopeVarName, + scope: withBlock, + childExprs: new Set(), + scopedExpr: + expr.__element__.__kind__ === TypeKind.object + ? (expr.__expr__ as any) + : undefined, + }); + } + + // expression should be extracted to with block if + // - bound with e.with + // - refcount > 1 + // - aliased with e.alias + if ( + refData.refCount > 1 || + refData.boundScope || + refData.aliases.length > 0 + ) { + // first, check if expr is bound to scope + let withBlock = refData.boundScope; + + const parentScopes = [...refData.parentScopes]; + + // if expression is unbound + if (!withBlock) { + // if parent scopes haven't all been resolved, + // re-add current expr to `seen` to be resolved later + if ( + parentScopes.some( + (parentScope) => parentScope && seen.has(parentScope) + ) + ) { + seen.set(expr, refData); + continue; + } + + if (parentScopes.some((scope) => scope == null)) { + throw new Error( + `Cannot extract repeated expression into 'WITH' block, ` + + `expression used outside of 'WITH'able expression` + ); + } + + const [firstParentScopeChain, ...parentScopeChains] = parentScopes.map( + (scope) => { + const scopes: WithScopeExpr[] = [scope!]; + const pendingScopes = [scope]; + while (pendingScopes.length) { + const currentScope = pendingScopes.shift()!; + pendingScopes.push( + ...[...walkExprCtx.seen.get(currentScope)!.parentScopes].filter( + (s) => s !== null + ) + ); + if (!scopes.includes(currentScope)) { + scopes.push(currentScope); + } + } + return scopes; + } + ); + const commonParentScope = firstParentScopeChain + ? firstParentScopeChain.find((scope) => + // find the first parent scope in the chain that is shared by + // the other parent scope chains + parentScopeChains.every((otherScope) => + otherScope.includes(scope) + ) + ) + : null; + + withBlock = commonParentScope ?? walkExprCtx.rootScope; + } + + if (!withBlock) { + throw new Error( + `Cannot extract repeated expression into 'WITH' block, ` + + `expression does not appear within common 'WITH'able expression` + ); + } + + if (!withBlocks.has(withBlock)) { + withBlocks.set(withBlock, new Set()); + } + + // check all references and aliases are within this block + const validScopes = new Set([ + withBlock, + ...walkExprCtx.seen.get(withBlock)!.childExprs, + ]); + for (const scope of [ + ...refData.parentScopes, + ...util.flatMap(refData.aliases, (alias) => [ + ...walkExprCtx.seen.get(alias)!.parentScopes, + ]), + ]) { + if (scope === null || !validScopes.has(scope)) { + throw new Error( + refData.boundScope + ? `Expr or its aliases used outside of declared 'WITH' block scope` + : `Cannot extract repeated or aliased expression into 'WITH' block, ` + + `expression or its aliases appear outside root scope` + ); + } + } + + for (const withVar of [expr, ...refData.aliases]) { + // withVar is an alias already explicitly bound + // to an inner WITH block + const withVarBoundScope = walkExprCtx.seen.get(withVar)!.boundScope; + if (withVarBoundScope && withVarBoundScope !== refData.boundScope) { + continue; + } + + const withVarName = `__withVar_${withVars.size}`; + + withBlocks.get(withBlock)!.add(withVar); + withVars.set(withVar, { + name: withVarName, + scope: withBlock, + childExprs: new Set(walkExprCtx.seen.get(withVar)!.childExprs), + }); + } + } + } + + let edgeQL = renderEdgeQL(this, { + withBlocks, + withVars, + forVars: new Map(), + linkProps, + }); + if ( + edgeQL.startsWith("(") && + edgeQL.endsWith(")") && + !( + this.__kind__ === ExpressionKind.Tuple || + this.__kind__ === ExpressionKind.NamedTuple || + this.__kind__ === ExpressionKind.Literal + ) + ) { + edgeQL = edgeQL.slice(1, -1); + } + toEdgeQLCache.set(this, edgeQL); + + return edgeQL; +} + +interface WalkExprTreeCtx { + seen: Map< + SomeExpression, + { + refCount: number; + // tracks all withable ancestors + parentScopes: Set; + // tracks all child exprs + childExprs: SomeExpression[]; + // tracks bound scope from e.with + boundScope: WithScopeExpr | null; + // tracks aliases from e.alias + aliases: SomeExpression[]; + linkProps: $expr_PathLeaf[]; + } + >; + rootScope: WithScopeExpr | null; +} + +// walks entire expression tree +// populates +function walkExprTree( + _expr: TypeSet, + parentScope: WithScopeExpr | null, + ctx: WalkExprTreeCtx +): SomeExpression[] { + if (!(_expr as any).__kind__) { + throw new Error( + `Expected a valid querybuilder expression, ` + + `instead received ${typeof _expr}${ + typeof _expr !== "undefined" ? `: '${_expr}'` : "" + }.` + + getErrorHint(_expr) + ); + } + + const expr = _expr as SomeExpression; + + function walkShape(shape: object) { + for (let param of Object.values(shape)) { + if (param.__kind__ === ExpressionKind.PolyShapeElement) { + param = param.__shapeElement__; + } + if (typeof param === "object") { + if (!!(param as any).__kind__) { + // param is expression + childExprs.push(...walkExprTree(param as any, expr as any, ctx)); + } else { + walkShape(param); + } + } + } + } + + // set root scope + if (!ctx.rootScope && parentScope) { + ctx.rootScope = parentScope; + } + + // return without walking if expression has been seen + const seenExpr = ctx.seen.get(expr); + if (seenExpr) { + seenExpr.refCount += 1; + // if (seenExpr.refCount > 1) { + // console.log(`###########\nSEEN ${seenExpr.refCount} times`); + // console.log(expr.__kind__); + // console.log(expr.__element__.__name__); + // const arg = (expr as any)?.__parent__ || (expr as any)?.__name__; + // if (arg) console.log(arg); + // } + seenExpr.parentScopes.add(parentScope); + return [expr, ...seenExpr.childExprs]; + } + + const childExprs: SomeExpression[] = []; + ctx.seen.set(expr, { + refCount: 1, + parentScopes: new Set([parentScope]), + childExprs, + boundScope: null, + aliases: [], + linkProps: [], + }); + + switch (expr.__kind__) { + case ExpressionKind.Alias: + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + ctx.seen.get(expr.__expr__ as any)!.aliases.push(expr); + break; + case ExpressionKind.With: + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + for (const refExpr of expr.__refs__) { + walkExprTree(refExpr, expr.__expr__, ctx); + const seenRef = ctx.seen.get(refExpr as any)!; + if (seenRef.boundScope) { + throw new Error(`Expression bound to multiple 'WITH' blocks`); + } + seenRef.boundScope = expr.__expr__; + } + break; + case ExpressionKind.Literal: + case ExpressionKind.ForVar: + case ExpressionKind.Param: + break; + case ExpressionKind.PathLeaf: + case ExpressionKind.PathNode: + if (expr.__parent__) { + if ((expr.__parent__.type as any).__scopedFrom__) { + // if parent is scoped expr then don't walk expr + // since it will already be walked by enclosing select/update + + childExprs.push(expr.__parent__.type as any); + } else { + childExprs.push( + ...walkExprTree(expr.__parent__.type, parentScope, ctx) + ); + } + + if ( + // is link prop + expr.__kind__ === ExpressionKind.PathLeaf && + expr.__parent__.linkName.startsWith("@") + ) { + // don't hoist a linkprop that isn't scoped from parentScope + const parentScopeVar = (parentScope as any).__scope__; + if (parentScopeVar === expr.__parent__.type) { + ctx.seen.get(parentScope!)?.linkProps.push(expr); + } + } + } + break; + case ExpressionKind.Cast: + if (expr.__expr__ === null) break; + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + case ExpressionKind.Set: + for (const subExpr of expr.__exprs__) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + break; + case ExpressionKind.Array: + for (const subExpr of expr.__items__) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + break; + case ExpressionKind.Tuple: + for (const subExpr of expr.__items__) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + break; + case ExpressionKind.NamedTuple: + for (const subExpr of Object.values(expr.__shape__)) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + break; + case ExpressionKind.TuplePath: + childExprs.push(...walkExprTree(expr.__parent__, parentScope, ctx)); + break; + case ExpressionKind.Select: + case ExpressionKind.Update: { + const modifiers = expr.__modifiers__; + if (modifiers.filter) { + childExprs.push(...walkExprTree(modifiers.filter, expr, ctx)); + } + if (modifiers.order_by) { + for (const orderExpr of modifiers.order_by) { + childExprs.push(...walkExprTree(orderExpr.expression, expr, ctx)); + } + } + if (modifiers.offset) { + childExprs.push(...walkExprTree(modifiers.offset!, expr, ctx)); + } + if (modifiers.limit) { + childExprs.push(...walkExprTree(modifiers.limit!, expr, ctx)); + } + + if (expr.__kind__ === ExpressionKind.Select) { + if ( + isObjectType(expr.__element__) && + // don't walk shape twice if select expr justs wrap another object + // type expr with the same shape + expr.__element__.__shape__ !== + (expr.__expr__ as ObjectTypeSet).__element__.__shape__ + ) { + walkShape(expr.__element__.__shape__ ?? {}); + } + } else { + // Update + const shape: any = expr.__shape__ ?? {}; + + for (const _element of Object.values(shape)) { + let element: any = _element; + if (!element.__element__) { + if (element["+="]) element = element["+="]; + else if (element["-="]) element = element["-="]; + } + childExprs.push(...walkExprTree(element as any, expr, ctx)); + } + } + + childExprs.push(...walkExprTree(expr.__expr__, expr, ctx)); + break; + } + case ExpressionKind.Delete: { + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + } + case ExpressionKind.Insert: { + const shape: any = expr.__shape__ ?? {}; + + for (const element of Object.values(shape)) { + childExprs.push(...walkExprTree(element as any, expr, ctx)); + } + + childExprs.push(...walkExprTree(expr.__expr__, expr, ctx)); + break; + } + case ExpressionKind.InsertUnlessConflict: { + // InsertUnlessConflict doesn't create a new scope, the parent scope of + // child expressions is the wrapped Insert expr + const insertChildExprs: SomeExpression[] = []; + if (expr.__conflict__.on) { + insertChildExprs.push( + ...walkExprTree( + expr.__conflict__.on, + expr.__expr__ as $expr_Insert, + ctx + ) + ); + } + if (expr.__conflict__.else) { + insertChildExprs.push( + ...walkExprTree( + expr.__conflict__.else, + expr.__expr__ as $expr_Insert, + ctx + ) + ); + } + + walkExprTree(expr.__expr__, parentScope, ctx); + ctx.seen + .get(expr.__expr__ as $expr_Insert)! + .childExprs.push(...insertChildExprs); + break; + } + case ExpressionKind.Group: { + const groupingSet = expr.__modifiers__.by as any as GroupingSet; + // const groupingSet = expr.__grouping__ as any as GroupingSet; + for (const [_k, groupExpr] of groupingSet.__exprs__) { + // this prevents recurring grouping elements from being walked twice + // this way, these won't get pulled into with blocks, + // which is good because they need to be rendered in `using` + const seen: Set = new Set(); + if (!seen.has(expr)) { + childExprs.push(...walkExprTree(groupExpr, expr, ctx)); + seen.add(expr); + } + } + + if (!expr.__element__.__shape__.elements.__element__.__shape__) { + throw new Error("Missing shape in GROUP statement"); + } + walkShape(expr.__element__.__shape__.elements.__element__.__shape__); + childExprs.push(...walkExprTree(expr.__expr__, expr, ctx)); + break; + } + case ExpressionKind.TypeIntersection: + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + case ExpressionKind.Operator: + case ExpressionKind.Function: + for (const subExpr of expr.__args__) { + if (Array.isArray(subExpr)) { + for (const arg of subExpr) { + if (arg) childExprs.push(...walkExprTree(arg, parentScope, ctx)); + } + } else { + childExprs.push(...walkExprTree(subExpr!, parentScope, ctx)); + } + } + if (expr.__kind__ === ExpressionKind.Function) { + for (const subExpr of Object.values(expr.__namedargs__)) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + } + break; + case ExpressionKind.For: { + childExprs.push(...walkExprTree(expr.__iterSet__ as any, expr, ctx)); + childExprs.push(...walkExprTree(expr.__expr__, expr, ctx)); + break; + } + case ExpressionKind.WithParams: { + if (parentScope !== null) { + throw new Error( + `'withParams' does not support being used as a nested expression` + ); + } + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + } + case ExpressionKind.Detached: { + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + } + case ExpressionKind.Global: + break; + default: + util.assertNever( + expr, + new Error(`Unrecognized expression kind: "${(expr as any).__kind__}"`) + ); + } + + return [expr, ...childExprs]; +} + +function renderEdgeQL( + _expr: TypeSet, + ctx: RenderCtx, + renderShape: boolean = true, + noImplicitDetached: boolean = false +): string { + if (!(_expr as any).__kind__) { + throw new Error("Invalid expression."); + } + const expr = _expr as SomeExpression; + + // if expression is in a with block + // render its name + const withVar = ctx.withVars.get(expr); + + if (withVar && ctx.renderWithVar !== expr) { + return renderShape && + expr.__kind__ === ExpressionKind.Select && + isObjectType(expr.__element__) + ? `(${withVar.name} ${shapeToEdgeQL( + (expr.__element__.__shape__ || {}) as object, + ctx, + null, + true // render shape only + )})` + : withVar.name; + } + + // render with block expression + function renderWithBlockExpr( + varExpr: SomeExpression, + _noImplicitDetached?: boolean + ) { + const withBlockElement = ctx.withVars.get(varExpr)!; + let renderedExpr = renderEdgeQL( + withBlockElement.scopedExpr ?? varExpr, + { + ...ctx, + renderWithVar: varExpr, + }, + !withBlockElement.scopedExpr, // render shape if no scopedExpr exists + _noImplicitDetached + ); + const renderedExprNoDetached = renderEdgeQL( + withBlockElement.scopedExpr ?? varExpr, + { + ...ctx, + renderWithVar: varExpr, + }, + !withBlockElement.scopedExpr, // render shape if no scopedExpr exists + true + ); + + if (ctx.linkProps.has(expr)) { + renderedExpr = `(SELECT ${renderedExpr} {\n${ctx.linkProps + .get(expr)! + .map( + (linkPropName) => + ` __linkprop_${linkPropName} := ${renderedExprNoDetached}@${linkPropName}` + ) + .join(",\n")}\n})`; + } + return ` ${withBlockElement.name} := ${ + renderedExpr.includes("\n") + ? `(\n${indent( + renderedExpr[0] === "(" && + renderedExpr[renderedExpr.length - 1] === ")" + ? renderedExpr.slice(1, -1) + : renderedExpr, + 4 + )}\n )` + : renderedExpr + }`; + } + + // extract scope expression from select/update if exists + const scopeExpr = + (expr.__kind__ === ExpressionKind.Select || + expr.__kind__ === ExpressionKind.Update || + expr.__kind__ === ExpressionKind.Group) && + ctx.withVars.has(expr.__scope__ as any) + ? (expr.__scope__ as SomeExpression) + : undefined; + + const scopeExprVar: string[] = []; + const unscopedWithBlock: string[] = []; + const scopedWithBlock: string[] = []; + + // generate with block if needed + if (ctx.withBlocks.has(expr as any) || scopeExpr) { + // sort associated vars + const sortedBlockVars = topoSortWithVars( + ctx.withBlocks.get(expr as any) ?? new Set(), + ctx + ); + + if (!scopeExpr) { + // if no scope expression exists, all variables are unscoped + unscopedWithBlock.push( + ...sortedBlockVars.map((blockVar) => renderWithBlockExpr(blockVar)) + ); + } + // else if (expr.__kind__ === ExpressionKind.Group) { + // // add all vars into scoped with block + // // this is rendered inside the `using` clause later + // // no need for the with/for trick + // scopeExprVar.push(renderWithBlockExpr(scopeExpr, noImplicitDetached)); + // scopedWithBlock.push( + // ...sortedBlockVars.map(blockVar => renderWithBlockExpr(blockVar)) + // ); + // } + else { + // get scope variable + const scopeVar = ctx.withVars.get(scopeExpr)!; + + // get list of with vars that reference scope + const scopedVars = sortedBlockVars.filter((blockVarExpr) => + ctx.withVars.get(blockVarExpr)?.childExprs.has(scopeExpr) + ); + // filter blockvars to only include vars that don't reference scope + unscopedWithBlock.push( + ...sortedBlockVars + .filter((blockVar) => !scopedVars.includes(blockVar)) + .map((blockVar) => renderWithBlockExpr(blockVar)) + ); + + // when rendering `with` variables that reference current scope + // they are extracted into computed properties defining in a for loop + if (!scopedVars.length) { + scopeExprVar.push(renderWithBlockExpr(scopeExpr, noImplicitDetached)); + } else { + const scopeName = scopeVar.name; + + // render a reference to scoped path (e.g. ".nemesis") + scopeVar.name = scopeName + "_expr"; + scopeExprVar.push(renderWithBlockExpr(scopeExpr, noImplicitDetached)); + // scopedWithBlock.push( + // renderWithBlockExpr(scopeExpr, noImplicitDetached) + // ); + + // render a for loop containing all scoped block vars + // as computed properties + scopeVar.name = scopeName + "_inner"; + scopeExprVar.push( + ` ${scopeName} := (FOR ${scopeVar.name} IN {${ + scopeName + "_expr" + }} UNION (\n WITH\n${indent( + scopedVars + .map((blockVar) => renderWithBlockExpr(blockVar)) + .join(",\n"), + 4 + )}\n SELECT ${scopeVar.name} {\n${scopedVars + .map((blockVar) => { + const name = ctx.withVars.get(blockVar)!.name; + return ` ${name} := ${name}`; + }) + .join(",\n")}\n }\n ))` + ); + + // change var name back to original value + scopeVar.name = scopeName; + + // reassign name for all scoped block vars + for (const blockVarExpr of scopedVars) { + const blockVar = ctx.withVars.get(blockVarExpr)!; + blockVar.name = `${scopeName}.${blockVar.name}`; + } + } + } + } + + const withBlockElements = [ + ...unscopedWithBlock, + ...scopeExprVar, + ...scopedWithBlock, + ]; + const withBlock = withBlockElements.length + ? `WITH\n${withBlockElements.join(",\n")}\n` + : ""; + + if (expr.__kind__ === ExpressionKind.With) { + return renderEdgeQL(expr.__expr__, ctx); + } else if (expr.__kind__ === ExpressionKind.WithParams) { + return `(WITH\n${expr.__params__ + .map((param) => { + const optional = + param.__cardinality__ === Cardinality.AtMostOne ? "OPTIONAL " : ""; + let paramExpr: string; + if (param.__isComplex__) { + let cast = param.__element__.__name__; + cast = cast.includes("std::decimal") + ? `<${cast}><${cast.replace(/std::decimal/g, "std::str")}>` + : `<${cast}>`; + paramExpr = `${cast}to_json(<${optional}str>$${param.__name__})`; + } else { + paramExpr = `<${optional}${param.__element__.__name__}>$${param.__name__}`; + } + return ` __param__${param.__name__} := ${paramExpr}`; + }) + .join(",\n")}\nSELECT ${renderEdgeQL(expr.__expr__, ctx)})`; + } else if (expr.__kind__ === ExpressionKind.Alias) { + const aliasedExprVar = ctx.withVars.get(expr.__expr__ as any); + if (!aliasedExprVar) { + throw new Error( + `Expression referenced by alias does not exist in 'WITH' block` + ); + } + return aliasedExprVar.name; + } else if ( + expr.__kind__ === ExpressionKind.PathNode || + expr.__kind__ === ExpressionKind.PathLeaf + ) { + if (!expr.__parent__) { + return `${noImplicitDetached ? "" : "DETACHED "}${ + expr.__element__.__name__ + }`; + } else { + const isScopedLinkProp = + expr.__parent__.linkName.startsWith("@") && + ctx.withVars.has(expr.__parent__.type as any); + const linkName = isScopedLinkProp + ? `__linkprop_${expr.__parent__.linkName.slice(1)}` + : expr.__parent__.linkName; + const parent = renderEdgeQL( + expr.__parent__.type, + ctx, + false, + noImplicitDetached + ); + return `${parent}${linkName.startsWith("@") ? "" : "."}${q(linkName)}`; + } + } else if (expr.__kind__ === ExpressionKind.Literal) { + return literalToEdgeQL(expr.__element__, expr.__value__); + } else if (expr.__kind__ === ExpressionKind.Set) { + const exprs = expr.__exprs__; + + if ( + exprs.every((ex) => ex.__element__.__kind__ === TypeKind.object) || + exprs.every((ex) => ex.__element__.__kind__ !== TypeKind.object) + ) { + if (exprs.length === 0) return `<${expr.__element__.__name__}>{}`; + return `{ ${exprs.map((ex) => renderEdgeQL(ex, ctx)).join(", ")} }`; + } else { + throw new Error( + `Invalid arguments to set constructor: ${exprs + .map((ex) => ex.__element__.__name__) + .join(", ")}` + ); + } + } else if (expr.__kind__ === ExpressionKind.Array) { + return `[${expr.__items__ + .map((item) => renderEdgeQL(item, ctx)) + .join(", ")}]`; + } else if (expr.__kind__ === ExpressionKind.Tuple) { + return `(\n${expr.__items__ + .map( + (item) => + ` ` + renderEdgeQL(item, ctx, renderShape, noImplicitDetached) + ) + .join(",\n")}${expr.__items__.length === 1 ? "," : ""}\n)`; + } else if (expr.__kind__ === ExpressionKind.NamedTuple) { + return `(\n${Object.keys(expr.__shape__) + .map( + (key) => + ` ${key} := ${renderEdgeQL( + expr.__shape__[key]!, + ctx, + renderShape, + noImplicitDetached + )}` + ) + .join(",\n")}\n)`; + } else if (expr.__kind__ === ExpressionKind.TuplePath) { + return `${renderEdgeQL(expr.__parent__, ctx)}.${expr.__index__}`; + } else if (expr.__kind__ === ExpressionKind.Cast) { + const typeName = + expr.__element__.__name__ === "std::number" + ? "std::float64" + : expr.__element__.__name__; + if (expr.__expr__ === null) { + return `<${typeName}>{}`; + } + return `<${typeName}>(${renderEdgeQL(expr.__expr__, ctx)})`; + } else if (expr.__kind__ === ExpressionKind.Select) { + const lines: string[] = []; + if (isObjectType(expr.__element__)) { + const selectionTarget = renderEdgeQL( + expr.__scope__ ?? expr.__expr__, + ctx, + false + ); + + lines.push( + `SELECT${ + selectionTarget === "DETACHED std::FreeObject" + ? "" + : ` ${selectionTarget}` + }` + ); + + if ( + expr.__element__.__shape__ !== + (expr.__expr__ as ObjectTypeSet).__element__.__shape__ + ) { + lines.push( + shapeToEdgeQL( + (expr.__element__.__shape__ || {}) as object, + ctx, + expr.__element__ + ) + ); + } + } else { + // non-object/non-shape select expression + const needsScalarVar = + (expr.__modifiers__.filter || + expr.__modifiers__.order_by || + expr.__modifiers__.offset || + expr.__modifiers__.limit) && + !ctx.withVars.has(expr.__expr__ as any); + + lines.push( + `SELECT ${needsScalarVar ? "_ := " : ""}${renderEdgeQL( + expr.__expr__, + ctx + )}` + ); + + if (needsScalarVar) { + ctx = { ...ctx, withVars: new Map(ctx.withVars) }; + ctx.withVars.set(expr.__expr__ as any, { + name: "_", + childExprs: new Set(), + scope: expr, + }); + } + } + + const modifiers: string[] = []; + + if (expr.__modifiers__.filter) { + modifiers.push(`FILTER ${renderEdgeQL(expr.__modifiers__.filter, ctx)}`); + } + if (expr.__modifiers__.order_by) { + modifiers.push( + ...expr.__modifiers__.order_by.map( + ({ expression, direction, empty }, i) => { + return `${i === 0 ? "ORDER BY" : " THEN"} ${renderEdgeQL( + expression, + ctx + )}${direction ? " " + direction : ""}${empty ? " " + empty : ""}`; + } + ) + ); + } + if (expr.__modifiers__.offset) { + modifiers.push( + `OFFSET ${renderEdgeQL( + expr.__modifiers__.offset as OffsetExpression, + ctx + )}` + ); + } + if (expr.__modifiers__.limit) { + modifiers.push( + `LIMIT ${renderEdgeQL( + expr.__modifiers__.limit as LimitExpression, + ctx + )}` + ); + } + + // without assert_single, the query will return a more informative + // CardinalityMismatchError when the query returns more than one result + return ( + // (expr.__modifiers__.singleton ? `select assert_single((` : ``) + + "(" + + withBlock + + lines.join(" ") + + (modifiers.length ? "\n" + modifiers.join("\n") : "") + + ")" + // + (expr.__modifiers__.singleton ? `))` : ``) + ); + } else if (expr.__kind__ === ExpressionKind.Update) { + return `(${withBlock}UPDATE ${renderEdgeQL(expr.__scope__, ctx, false)}${ + expr.__modifiers__.filter + ? `\nFILTER ${renderEdgeQL(expr.__modifiers__.filter, ctx)}\n` + : " " + }SET ${shapeToEdgeQL(expr.__shape__, ctx, null, false, false)})`; + } else if (expr.__kind__ === ExpressionKind.Delete) { + return `(${withBlock}DELETE ${renderEdgeQL( + expr.__expr__, + ctx, + undefined, + noImplicitDetached + )})`; + } else if (expr.__kind__ === ExpressionKind.Insert) { + return `(${withBlock}INSERT ${renderEdgeQL( + expr.__expr__, + ctx, + false, + true + )} ${shapeToEdgeQL(expr.__shape__, ctx, null, false, false)})`; + } else if (expr.__kind__ === ExpressionKind.InsertUnlessConflict) { + const $on = expr.__conflict__.on; + const $else = expr.__conflict__.else; + const clause: string[] = []; + if (!$on) { + clause.push("\nUNLESS CONFLICT"); + } + if ($on) { + clause.push( + `\nUNLESS CONFLICT ON ${renderEdgeQL($on, ctx, false, true)}` + ); + } + if ($else) { + clause.push(`\nELSE (${renderEdgeQL($else, ctx, true, true)})`); + } + return `(${renderEdgeQL(expr.__expr__, ctx, false, true).slice( + 1, + -1 + )}${clause.join("")})`; + } else if (expr.__kind__ === ExpressionKind.Group) { + const groupingSet = expr.__modifiers__.by as any as GroupingSet; + const elementsShape = + expr.__element__.__shape__.elements.__element__.__shape__; + + const selectStatement: string[] = []; + const groupStatement: string[] = []; + + const groupTarget = renderEdgeQL(expr.__scope__, ctx, false); + groupStatement.push(`GROUP ${groupTarget}`); + + // render scoped withvars in using + const combinedBlock = [ + // ...scopedWithBlock, + // this is deduplicated in e.group + ...groupingSet.__exprs__.map( + ([k, v]) => ` ${k} := ${renderEdgeQL(v, ctx)}` + ), + ]; + groupStatement.push(`USING\n${combinedBlock.join(",\n")}`); + + let by = renderGroupingSet(groupingSet).trim(); + if (by[0] === "(" && by[by.length - 1] === ")") { + by = by.slice(1, by.length - 1); + } + groupStatement.push(`BY ` + by); + + // clause.push(withBlock.trim()); + + // render scope var and any unscoped withVars in with block + const selectTarget = `${groupTarget}_groups`; + selectStatement.push( + `WITH\n${[ + ...unscopedWithBlock, + ...scopeExprVar, + // ...scopedWithBlock, + ].join(",\n")}, + ${selectTarget} := ( +${indent(groupStatement.join("\n"), 4)} +)` + ); + + // rename scope var to fix all scope references that + // occur in the `elements` subshape + const scopeVar = ctx.withVars.get(expr.__scope__ as any); + + // replace references to __scope__ with + // .elements reference + const elementsShapeQuery = indent( + shapeToEdgeQL(elementsShape as object, { ...ctx }, expr.__element__), + 2 + ) + .trim() + .split(scopeVar!.name + ".") + .join(`${selectTarget}.elements.`); + + selectStatement.push(`SELECT ${selectTarget} { + key: {${groupingSet.__exprs__.map((e) => e[0]).join(", ")}}, + grouping, + elements: ${elementsShapeQuery} +}`); + return `(${selectStatement.join("\n")})`; + } else if (expr.__kind__ === ExpressionKind.Function) { + const args = expr.__args__.map( + (arg) => `${renderEdgeQL(arg!, ctx, false)}` + ); + for (const [key, arg] of Object.entries(expr.__namedargs__)) { + args.push(`${q(key)} := ${renderEdgeQL(arg, ctx, false)}`); + } + return `${expr.__name__}(${args.join(", ")})`; + } else if (expr.__kind__ === ExpressionKind.Operator) { + const operator = expr.__name__; + const args = expr.__args__; + switch (expr.__opkind__) { + case OperatorKind.Infix: + if (operator === "[]") { + let index = ""; + if (Array.isArray(args[1])) { + const [start, end] = args[1]; + if (start) { + index += renderEdgeQL(start, ctx); + } + index += ":"; + if (end) { + index += renderEdgeQL(end, ctx); + } + } else { + index = renderEdgeQL(args[1]!, ctx); + } + + return `${renderEdgeQL(args[0]!, ctx)}[${index}]`; + } + return `(${renderEdgeQL(args[0]!, ctx)} ${operator} ${renderEdgeQL( + args[1]!, + ctx + )})`; + case OperatorKind.Postfix: + return `(${renderEdgeQL(args[0]!, ctx)} ${operator})`; + case OperatorKind.Prefix: + return `(${operator} ${renderEdgeQL(args[0]!, ctx)})`; + case OperatorKind.Ternary: + if (operator === "if_else") { + return `(${renderEdgeQL(args[0]!, ctx)} IF ${renderEdgeQL( + args[1]!, + ctx + )} ELSE ${renderEdgeQL(args[2]!, ctx)})`; + } else { + throw new Error(`Unknown operator: ${operator}`); + } + default: + util.assertNever( + expr.__opkind__, + new Error(`Unknown operator kind: ${expr.__opkind__}`) + ); + } + } else if (expr.__kind__ === ExpressionKind.TypeIntersection) { + return `${renderEdgeQL(expr.__expr__, ctx)}[IS ${ + expr.__element__.__name__ + }]`; + } else if (expr.__kind__ === ExpressionKind.For) { + ctx.forVars.set(expr.__forVar__, `__forVar__${ctx.forVars.size}`); + return `(${withBlock}FOR ${ctx.forVars.get( + expr.__forVar__ + )} IN {${renderEdgeQL(expr.__iterSet__, ctx)}} +UNION (\n${indent(renderEdgeQL(expr.__expr__, ctx), 2)}\n))`; + } else if (expr.__kind__ === ExpressionKind.ForVar) { + const forVar = ctx.forVars.get(expr); + if (!forVar) { + throw new Error(`'FOR' loop variable used outside of 'FOR' loop`); + } + return forVar; + } else if (expr.__kind__ === ExpressionKind.Param) { + return `__param__${expr.__name__}`; + } else if (expr.__kind__ === ExpressionKind.Detached) { + return `(DETACHED ${renderEdgeQL( + expr.__expr__, + { + ...ctx, + renderWithVar: expr.__expr__ as any, + }, + undefined, + true + )})`; + } else if (expr.__kind__ === ExpressionKind.Global) { + return `(GLOBAL ${expr.__name__})`; + } else { + util.assertNever( + expr, + new Error(`Unrecognized expression kind: "${(expr as any).__kind__}"`) + ); + } +} + +function isGroupingSet(arg: any): arg is GroupingSet { + return arg.__kind__ === "groupingset"; +} + +// recursive renderer +function renderGroupingSet(set: GroupingSet): string { + const contents = Object.entries(set.__elements__) + .map(([k, v]) => { + return isGroupingSet(v) ? renderGroupingSet(v) : k; + }) + .join(", "); + if (set.__settype__ === "tuple") { + return `(${contents})`; + } else if (set.__settype__ === "set") { + return `{${contents}}`; + } else if (set.__settype__ === "cube") { + return `cube(${contents})`; + } else if (set.__settype__ === "rollup") { + return `rollup(${contents})`; + } else { + throw new Error(`Unrecognized set type: "${set.__settype__}"`); + } +} + +function shapeToEdgeQL( + shape: object | null, + ctx: RenderCtx, + type: ObjectType | null = null, + keysOnly: boolean = false, + injectImplicitId: boolean = true +) { + const pointers = type?.__pointers__ || null; + const isFreeObject = type?.__name__ === "std::FreeObject"; + if (shape === null) { + return ``; + } + + const lines: string[] = []; + const addLine = (line: string) => + lines.push(`${keysOnly ? "" : " "}${line}`); + + const seen = new Set(); + + for (const key in shape) { + if (!shape.hasOwnProperty(key)) continue; + if (seen.has(key)) { + // tslint:disable-next-line + console.warn(`Invalid: duplicate key "${key}"`); + continue; + } + seen.add(key); + let val = (shape as any)[key]; + let operator = ":="; + let polyType: SomeExpression | null = null; + + if (typeof val === "object" && !val.__element__) { + if (!!val["+="]) { + operator = "+="; + val = val["+="]; + } else if (!!val["-="]) { + operator = "-="; + val = val["-="]; + } + } + if (val.__kind__ === ExpressionKind.PolyShapeElement) { + polyType = val.__polyType__; + val = val.__shapeElement__; + } + const polyIntersection = polyType + ? `[IS ${polyType.__element__.__name__}].` + : ""; + + // For computed properties in select shapes, inject the expected + // cardinality inferred by the query builder. This ensures the actual + // type returned by the server matches the inferred return type, or an + // explicit error is thrown, instead of a silent mismatch between + // actual and inferred type. + // Add annotations on FreeObjects, despite the existence of a pointer. + const ptr = pointers?.[key]; + const addCardinalityAnnotations = pointers && (!ptr || isFreeObject); + + const expectedCardinality = + addCardinalityAnnotations && val.hasOwnProperty("__cardinality__") + ? val.__cardinality__ === Cardinality.Many || + val.__cardinality__ === Cardinality.AtLeastOne + ? "multi " + : "single " + : ""; + + // if selecting a required multi link, wrap expr in 'assert_exists' + const wrapAssertExists = ptr?.cardinality === Cardinality.AtLeastOne; + + if (typeof val === "boolean") { + if ( + !pointers?.[key] && + key[0] !== "@" && + type && + type?.__name__ !== "std::FreeObject" && + !polyIntersection + ) { + throw new Error(`Field "${key}" does not exist in ${type?.__name__}`); + } + if (val) { + addLine(`${polyIntersection}${q(key)}`); + } + continue; + } + + if (typeof val !== "object") { + throw new Error(`Invalid shape element at "${key}".`); + } + + const valIsExpression = val.hasOwnProperty("__kind__"); + + // is subshape + if (!valIsExpression) { + addLine( + `${polyIntersection}${q(key, false)}: ${indent( + shapeToEdgeQL(val, ctx, ptr?.target), + 2 + ).trim()}` + ); + continue; + } + + // val is expression + + // is computed + if (keysOnly) { + addLine( + q(key, false) + + (isObjectType(val.__element__) + ? `: ${shapeToEdgeQL(val.__element__.__shape__, ctx, null, true)}` + : "") + ); + continue; + } + const renderedExpr = renderEdgeQL(val, ctx); + + addLine( + `${expectedCardinality}${q(key, false)} ${operator} ${ + wrapAssertExists ? "assert_exists(" : "" + }${ + renderedExpr.includes("\n") + ? `(\n${indent( + renderedExpr[0] === "(" && + renderedExpr[renderedExpr.length - 1] === ")" + ? renderedExpr.slice(1, -1) + : renderedExpr, + 4 + )}\n )` + : renderedExpr + }${wrapAssertExists ? ")" : ""}` + ); + } + + if (lines.length === 0 && injectImplicitId) { + addLine("id"); + } + return keysOnly ? `{${lines.join(", ")}}` : `{\n${lines.join(",\n")}\n}`; +} + +function topoSortWithVars( + vars: Set, + ctx: RenderCtx +): SomeExpression[] { + if (!vars.size) { + return []; + } + + const sorted: SomeExpression[] = []; + + const unvisited = new Set(vars); + const visiting = new Set(); + + for (const withVar of unvisited) { + visit(withVar); + } + + function visit(withVar: SomeExpression): void { + if (!unvisited.has(withVar)) { + return; + } + if (visiting.has(withVar)) { + throw new Error(`'WITH' variables contain a cyclic dependency`); + } + + visiting.add(withVar); + + for (const child of ctx.withVars.get(withVar)!.childExprs) { + if (vars.has(child)) { + visit(child); + } + } + + visiting.delete(withVar); + unvisited.delete(withVar); + + sorted.push(withVar); + } + return sorted; +} + +const numericalTypes: Record = { + "std::number": true, + "std::int16": true, + "std::int32": true, + "std::int64": true, + "std::float32": true, + "std::float64": true, +}; + +function literalToEdgeQL(type: BaseType, val: any): string { + const typename = (type as any).__casttype__?.__name__ ?? type.__name__; + let skipCast = false; + let stringRep; + if (typename === "std::json") { + skipCast = true; + stringRep = `to_json($$${JSON.stringify(val)}$$)`; + } else if (typeof val === "string") { + if (numericalTypes[typename]) { + skipCast = typename === type.__name__; + stringRep = val; + } else if (type.__kind__ === TypeKind.enum) { + skipCast = true; + const vals = (type as EnumType).__values__; + if (vals.includes(val)) { + skipCast = true; + if (val.includes(" ")) { + stringRep = `<${type.__name__}>"${val}"`; + } else { + stringRep = `${type.__name__}.${q(val)}`; + } + } else { + throw new Error( + `Invalid value for type ${type.__name__}: ${JSON.stringify(val)}` + ); + } + } else { + if (typename === "std::str") { + skipCast = true; + } + stringRep = JSON.stringify(val); + } + } else if (typeof val === "number") { + if (numericalTypes[typename]) { + skipCast = typename === type.__name__; + } else { + throw new Error(`Unknown numerical type: ${type.__name__}!`); + } + stringRep = `${val.toString()}`; + } else if (typeof val === "boolean") { + stringRep = `${val.toString()}`; + skipCast = true; + } else if (typeof val === "bigint") { + stringRep = `${val.toString()}n`; + } else if (Array.isArray(val)) { + skipCast = val.length !== 0; + if (isArrayType(type)) { + stringRep = `[${val + .map((el) => literalToEdgeQL(type.__element__ as any, el)) + .join(", ")}]`; + } else if (isTupleType(type)) { + stringRep = `( ${val + .map((el, j) => literalToEdgeQL(type.__items__[j] as any, el)) + .join(", ")}${type.__items__.length === 1 ? "," : ""} )`; + } else { + throw new Error( + `Invalid value for type ${type.__name__}: ${JSON.stringify(val)}` + ); + } + } else if (val instanceof Date) { + stringRep = `'${val.toISOString()}'`; + } else if ( + val instanceof LocalDate || + val instanceof LocalDateTime || + val instanceof LocalTime || + val instanceof Duration || + val instanceof RelativeDuration || + val instanceof DateDuration + ) { + stringRep = `'${val.toString()}'`; + } else if (val instanceof Uint8Array) { + stringRep = bufferToStringRep(val); + skipCast = true; + } else if (val instanceof Range) { + const elType = (type as RangeType).__element__; + + // actual type will be inferred from + // defined value + const elTypeName = + elType.__name__ === "std::number" ? "std::int64" : elType.__name__; + + return `std::range(${ + val.lower === null + ? `<${elTypeName}>{}` + : literalToEdgeQL(elType, val.lower) + }, ${ + val.upper === null + ? `<${elTypeName}>{}` + : literalToEdgeQL(elType, val.upper) + }, inc_lower := ${val.incLower}, inc_upper := ${val.incUpper})`; + } else if (typeof val === "object") { + if (isNamedTupleType(type)) { + stringRep = `( ${Object.entries(val).map( + ([key, value]) => + `${key} := ${literalToEdgeQL(type.__shape__[key]!, value)}` + )} )`; + skipCast = true; + } else { + throw new Error( + `Invalid value for type ${type.__name__}: ${JSON.stringify(val)}` + ); + } + } else { + throw new Error( + `Invalid value for type ${type.__name__}: ${JSON.stringify(val)}` + ); + } + if (skipCast) { + return stringRep; + } + return `<${type.__name__}>${stringRep}`; +} + +function indent(str: string, depth: number) { + return str + .split("\n") + .map((line) => " ".repeat(depth) + line) + .join("\n"); +} + +// backtick quote identifiers if needed +// https://github.com/edgedb/edgedb/blob/master/edb/edgeql/quote.py +function q(ident: string, allowBacklinks: boolean = true): string { + if ( + !ident || + ident.startsWith("@") || + (allowBacklinks && (ident.startsWith("<") || ident.includes("::"))) + ) { + return ident; + } + + const isAlphaNum = /^([^\W\d]\w*|([1-9]\d*|0))$/.test(ident); + if (isAlphaNum) { + const lident = ident.toLowerCase(); + const isReserved = + lident !== "__type__" && + lident !== "__std__" && + reservedKeywords.has(lident); + + if (!isReserved) { + return ident; + } + } + + return "`" + ident.replace(/`/g, "``") + "`"; +} + +function bufferToStringRep(buf: Uint8Array): string { + let stringRep = ""; + for (const byte of buf) { + if (byte < 32 || byte > 126) { + // non printable ascii + switch (byte) { + case 8: + stringRep += "\\b"; + break; + case 9: + stringRep += "\\t"; + break; + case 10: + stringRep += "\\n"; + break; + case 12: + stringRep += "\\f"; + break; + case 13: + stringRep += "\\r"; + break; + default: + stringRep += `\\x${byte.toString(16).padStart(2, "0")}`; + } + } else { + stringRep += + (byte === 39 || byte === 92 ? "\\" : "") + String.fromCharCode(byte); + } + } + return `b'${stringRep}'`; +} + +function getErrorHint(expr: any): string { + let literalConstructor: string | null = null; + switch (typeof expr) { + case "string": + literalConstructor = "e.str()"; + break; + case "number": + literalConstructor = Number.isInteger(expr) ? "e.int64()" : "e.float64()"; + break; + case "bigint": + literalConstructor = "e.bigint()"; + break; + case "boolean": + literalConstructor = "e.bool()"; + break; + } + switch (true) { + case expr instanceof Date: + literalConstructor = "e.datetime()"; + break; + case expr instanceof Duration: + literalConstructor = "e.duration()"; + break; + case expr instanceof LocalDate: + literalConstructor = "e.cal.local_date()"; + break; + case expr instanceof LocalDateTime: + literalConstructor = "e.cal.local_datetime()"; + break; + case expr instanceof LocalTime: + literalConstructor = "e.cal.local_time()"; + break; + case expr instanceof RelativeDuration: + literalConstructor = "e.cal.relative_duration()"; + break; + case expr instanceof DateDuration: + literalConstructor = "e.cal.date_duration()"; + break; + } + + return literalConstructor + ? `\nHint: Maybe you meant to wrap the value in ` + + `a '${literalConstructor}' expression?` + : ""; +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/typesystem.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/typesystem.ts new file mode 100644 index 000000000..1e1273725 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/typesystem.ts @@ -0,0 +1,791 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import type { Executor } from "edgedb/dist/ifaces"; +import type { $expr_PathNode, $expr_TypeIntersection, $pathify } from "./path"; +import type { $expr_Literal } from "./literal"; +import type { $expr_Operator } from "./funcops"; +import type { + typeutil, + Cardinality, + ExpressionKind, +} from "edgedb/dist/reflection/index"; +import { TypeKind } from "edgedb/dist/reflection/index"; +import type { cardutil } from "./cardinality"; +import type { Range } from "edgedb"; + +////////////////// +// BASETYPE +////////////////// + +export interface BaseType { + __kind__: TypeKind; + __name__: string; +} +export type BaseTypeSet = { + __element__: BaseType; + __cardinality__: Cardinality; +}; +export type BaseTypeTuple = typeutil.tupleOf; + +////////////////// +// SCALARTYPE +////////////////// + +export interface ScalarType< + Name extends string = string, + TsType extends any = any, + TsConstType extends TsType = TsType +> extends BaseType { + __kind__: TypeKind.scalar; + __tstype__: TsType; + __tsconsttype__: TsConstType; + __name__: Name; +} + +export type scalarTypeWithConstructor< + S extends ScalarType, + ExtraTsTypes extends any = never +> = S & { + // tslint:disable-next-line + (val: T): $expr_Literal< + ScalarType< + S["__name__"], + S["__tstype__"], + T extends S["__tstype__"] ? T : S["__tstype__"] + > + >; +}; + +type $jsonDestructure = + Set["__element__"] extends ScalarType<"std::json"> + ? { + [path: string]: $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + Set["__element__"], + Set["__cardinality__"] + // > + >; + } & { + destructure> | string>( + path: T + ): $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + Set["__element__"], + cardutil.multiplyCardinalities< + Set["__cardinality__"], + T extends TypeSet ? T["__cardinality__"] : Cardinality.One + > + // > + >; + } + : unknown; + +//////////////////// +// SETS AND EXPRESSIONS +//////////////////// + +export interface TypeSet< + T extends BaseType = BaseType, + Card extends Cardinality = Cardinality +> { + __element__: T; + __cardinality__: Card; +} + +// utility function for creating set +export function $toSet( + root: Root, + card: Card +): TypeSet { + return { + __element__: root, + __cardinality__: card, + }; +} + +export type Expression< + Set extends TypeSet = TypeSet, + Runnable extends boolean = true +> = Set & + (BaseType extends Set["__element__"] // short-circuit non-specific types + ? { + run(cxn: Executor): any; + runJSON(cxn: Executor): any; + toEdgeQL(): string; + is: any; + assert_single: any; + // warning: any; + } + : $pathify & + ExpressionMethods> & + (Runnable extends true + ? { + run(cxn: Executor): Promise>; + runJSON(cxn: Executor): Promise; + } + : {}) & + $tuplePathify & + $arrayLikeIndexify & + $jsonDestructure); + +export type stripSet = "__element__" extends keyof T + ? "__cardinality__" extends keyof T + ? { + __element__: T["__element__"]; + __cardinality__: T["__cardinality__"]; + } + : T + : T; + +// export type stripSet = T extends {__element__: any; __cardinality__: any} +// ? { +// __element__: T["__element__"]; +// __cardinality__: T["__cardinality__"]; +// } +// : any; + +export type stripSetShape = { + [k in keyof T]: stripSet; +}; + +// importing the actual alias from +// generated/modules/std didn't work. +// returned 'any' every time +export type assert_single< + El extends BaseType, + Card extends Cardinality +> = Expression<{ + __element__: El; // ["__element__"]; + __cardinality__: Card; // cardutil.overrideUpperBound< + // Expr["__cardinality__"], "One" + // >; + __kind__: ExpressionKind.Function; + __name__: "std::assert_single"; + __args__: TypeSet[]; // discard wrapped expression + __namedargs__: {}; +}>; + +export type ExpressionMethods = { + toEdgeQL(): string; + + is( + ixn: T + ): $expr_TypeIntersection< + Set["__cardinality__"], + // might cause performance issues + ObjectType< + T["__element__"]["__name__"], + T["__element__"]["__pointers__"], + { id: true } + > + >; + assert_single(): assert_single< + Set["__element__"], + Cardinality.AtMostOne + // cardutil.overrideUpperBound + >; +}; + +////////////////// +// ENUMTYPE +////////////////// +export interface EnumType< + Name extends string = string, + Values extends [string, ...string[]] = [string, ...string[]] +> extends BaseType { + __kind__: TypeKind.enum; + __tstype__: Values[number]; + __name__: Name; + __values__: Values; +} + +////////////////// +// OBJECTTYPE +////////////////// + +export type ObjectTypeSet = TypeSet; +export type ObjectTypeExpression = TypeSet; + +export type ExclusiveTuple = typeutil.tupleOf<{ + [k: string]: TypeSet; +}>; +export interface ObjectType< + Name extends string = string, + Pointers extends ObjectTypePointers = ObjectTypePointers, + Shape extends object | null = any, + Exclusives extends ExclusiveTuple = ExclusiveTuple + // Polys extends Poly[] = any[] +> extends BaseType { + __kind__: TypeKind.object; + __name__: Name; + __pointers__: Pointers; + __shape__: Shape; + __exclusives__: Exclusives; +} + +export type PropertyTypes = + | ScalarType + | EnumType + | ArrayType + | TupleType + | NamedTupleType; + +export type SomeType = + | ScalarType + | EnumType + | ArrayType + | TupleType + | ObjectType + | NamedTupleType + | RangeType; + +export interface PropertyDesc< + Type extends BaseType = BaseType, + Card extends Cardinality = Cardinality, + Exclusive extends boolean = boolean, + Computed extends boolean = boolean, + Readonly extends boolean = boolean, + HasDefault extends boolean = boolean +> { + __kind__: "property"; + target: Type; + cardinality: Card; + exclusive: Exclusive; + computed: Computed; + readonly: Readonly; + hasDefault: HasDefault; +} + +export type $scopify = $expr_PathNode< + TypeSet + // null, + // true // exclusivity +>; + +export type PropertyShape = { + [k: string]: PropertyDesc; +}; + +export interface LinkDesc< + Type extends ObjectType = any, + Card extends Cardinality = Cardinality, + LinkProps extends PropertyShape = any, + Exclusive extends boolean = boolean, + Computed extends boolean = boolean, + Readonly extends boolean = boolean, + HasDefault extends boolean = boolean +> { + __kind__: "link"; + target: Type; + cardinality: Card; + properties: LinkProps; + exclusive: Exclusive; + computed: Computed; + readonly: Readonly; + hasDefault: HasDefault; +} + +export type ObjectTypePointers = { + [k: string]: PropertyDesc | LinkDesc; +}; + +export type stripBacklinks = { + [k in keyof T]: k extends `<${string}` ? never : T[k]; +}; + +export type omitBacklinks = + T extends `<${string}` ? never : T extends string ? T : never; + +export type stripNonUpdateables = { + [k in keyof T]: [T[k]["computed"]] extends [true] + ? never + : [T[k]["readonly"]] extends [true] + ? never + : k extends "__type__" + ? never + : k extends "id" + ? never + : T[k]; +}; + +export type stripNonInsertables = { + [k in keyof T]: [T[k]["computed"]] extends [true] + ? never + : [k] extends ["__type__"] + ? never + : T[k]; +}; + +type shapeElementToTs = [ + Element +] extends [true] + ? pointerToTsType + : [Element] extends [false] + ? never + : [Element] extends [boolean] + ? pointerToTsType | undefined + : Element extends TypeSet + ? setToTsType> + : Pointer extends LinkDesc + ? Element extends object + ? computeTsTypeCard< + computeObjectShape< + Pointer["target"]["__pointers__"] & Pointer["properties"], + Element + >, + Pointer["cardinality"] + > + : never + : never; + +// Element extends (scope: any) => any +// ? Pointer["target"] extends ObjectType +// ? computeObjectShape< +// Pointer["target"]["__pointers__"], +// ReturnType +// > +// : never +// : Element extends object +// ? Pointer["target"] extends ObjectType +// ? computeObjectShape +// : never +// : never; + +export type $expr_PolyShapeElement< + PolyType extends ObjectTypeSet = ObjectTypeSet, + ShapeElement extends any = any +> = { + __kind__: ExpressionKind.PolyShapeElement; + __polyType__: PolyType; + __shapeElement__: ShapeElement; +}; + +export type computeObjectShape< + Pointers extends ObjectTypePointers, + Shape +> = typeutil.flatten< + keyof Shape extends never + ? { id: string } + : { + [k in keyof Shape]: Shape[k] extends $expr_PolyShapeElement< + infer PolyType, + infer ShapeEl + > + ? [k] extends [keyof PolyType["__element__"]["__pointers__"]] + ? shapeElementToTs< + PolyType["__element__"]["__pointers__"][k], + ShapeEl + > | null + : never + : [k] extends [keyof Pointers] + ? shapeElementToTs + : Shape[k] extends TypeSet + ? setToTsType + : never; + } +>; + +export type pointerToTsTypeSimple = + El extends PropertyDesc + ? propToTsType + : El extends LinkDesc + ? { id: string } + : never; + +export type PrimitiveType = + | ScalarType + | EnumType + | TupleType + | NamedTupleType + | ArrayType + | RangeType; + +export type PrimitiveTypeSet = TypeSet; + +///////////////////////// +/// ARRAYTYPE +///////////////////////// + +type $arrayLikeIndexify = Set["__element__"] extends + | ArrayType + | ScalarType<"std::str"> + | ScalarType<"std::bytes"> + ? { + [index: number]: $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType< + Set["__element__"] extends ArrayType + ? El + : Set["__element__"] + >, + Set["__cardinality__"] + // > + >; + [slice: `${number}:${number | ""}` | `:${number}`]: $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType, + Set["__cardinality__"] + // > + >; + index> | number>( + index: T + ): $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType< + Set["__element__"] extends ArrayType + ? El + : Set["__element__"] + >, + cardutil.multiplyCardinalities< + Set["__cardinality__"], + T extends TypeSet ? T["__cardinality__"] : Cardinality.One + > + // > + >; + slice< + S extends TypeSet> | number, + E extends TypeSet> | number | undefined | null + >( + start: S, + end: E + ): $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType, + cardutil.multiplyCardinalities< + cardutil.multiplyCardinalities< + Set["__cardinality__"], + S extends TypeSet ? S["__cardinality__"] : Cardinality.One + >, + E extends TypeSet ? C : Cardinality.One + > + // > + >; + slice< + E extends TypeSet> | number | undefined | null + >( + start: undefined | null, + end: E + ): $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType, + cardutil.multiplyCardinalities< + Set["__cardinality__"], + E extends TypeSet ? C : Cardinality.One + > + // > + >; + } + : unknown; + +export type $expr_Array< + Type extends ArrayType = ArrayType, + Card extends Cardinality = Cardinality + // Items extends typeutil.tupleOf> +> = Expression<{ + __kind__: ExpressionKind.Array; + __items__: typeutil.tupleOf>; + __element__: Type; + __cardinality__: Card; +}>; + +export interface ArrayType< + Element extends BaseType = BaseType, + Name extends string = `array<${Element["__name__"]}>` +> extends BaseType { + __name__: Name; + __kind__: TypeKind.array; + __element__: Element; +} + +type ArrayTypeToTsType = BaseTypeToTsType< + Type["__element__"] +>[]; + +///////////////////////// +/// TUPLE TYPE +///////////////////////// + +type $tuplePathify = Set["__element__"] extends TupleType + ? addTuplePaths + : Set["__element__"] extends NamedTupleType + ? addNamedTuplePaths + : unknown; + +export type $expr_TuplePath< + ItemType extends BaseType = BaseType, + ParentCard extends Cardinality = Cardinality +> = Expression<{ + __kind__: ExpressionKind.TuplePath; + __element__: ItemType; + __cardinality__: ParentCard; + __parent__: $expr_Tuple | $expr_NamedTuple | $expr_TuplePath; + __index__: string | number; +}>; + +export type baseTupleElementsToTupleType> = + { + [k in keyof T]: T[k] extends TypeSet + ? getPrimitiveBaseType + : never; + }; +export type tupleElementsToTupleType> = + baseTupleElementsToTupleType extends BaseTypeTuple + ? TupleType> + : never; + +export type baseTupleElementsToCardTuple = { + [k in keyof T]: T[k] extends TypeSet ? C : never; +}; + +export type tupleElementsToCardTuple = + baseTupleElementsToCardTuple extends [Cardinality, ...Cardinality[]] + ? baseTupleElementsToCardTuple + : never; + +export type $expr_Tuple< + Items extends typeutil.tupleOf = typeutil.tupleOf +> = Expression<{ + __kind__: ExpressionKind.Tuple; + __items__: typeutil.tupleOf; + __element__: tupleElementsToTupleType; + __cardinality__: cardutil.multiplyCardinalitiesVariadic< + tupleElementsToCardTuple + >; +}>; + +export type indexKeys = T extends `${number}` ? T : never; + +type addTuplePaths = { + [k in indexKeys]: Items[k] extends BaseType + ? $expr_TuplePath + : never; +}; + +export interface TupleType + extends BaseType { + __name__: string; + __kind__: TypeKind.tuple; + __items__: Items; +} + +type TupleItemsToTsType = { + [k in keyof Items]: Items[k] extends BaseType + ? BaseTypeToTsType + : never; +}; + +///////////////////////// +/// NAMED TUPLE TYPE +///////////////////////// +type literalShapeToType = NamedTupleType<{ + [k in keyof T]: getPrimitiveBaseType; +}>; +type shapeCardinalities = + Shape[keyof Shape]["__cardinality__"]; +type inferNamedTupleCardinality = [ + Cardinality.Many +] extends [shapeCardinalities] + ? Cardinality.Many + : [Cardinality.Empty] extends [shapeCardinalities] + ? Cardinality.Empty + : [shapeCardinalities] extends [Cardinality.AtMostOne] + ? Cardinality.AtMostOne + : [shapeCardinalities] extends [ + Cardinality.AtMostOne | Cardinality.One + ] + ? Cardinality.One + : Cardinality.Many; + +export type $expr_NamedTuple< + Shape extends NamedTupleLiteralShape = NamedTupleLiteralShape +> = Expression<{ + __kind__: ExpressionKind.NamedTuple; + __element__: literalShapeToType; + __cardinality__: inferNamedTupleCardinality; + __shape__: Shape; +}>; + +type addNamedTuplePaths< + Shape extends NamedTupleShape, + ParentCard extends Cardinality +> = { + [k in keyof Shape]: Shape[k] extends BaseType + ? $expr_TuplePath + : never; +}; + +export type NamedTupleLiteralShape = { [k: string]: TypeSet }; +export type NamedTupleShape = { [k: string]: BaseType }; +export interface NamedTupleType + extends BaseType { + __name__: string; + __kind__: TypeKind.namedtuple; + __shape__: Shape; +} + +type NamedTupleTypeToTsType = { + [k in keyof Type["__shape__"]]: BaseTypeToTsType; +}; + +///////////////////////// +/// RANGE TYPE +///////////////////////// + +export interface RangeType< + Element extends ScalarType = ScalarType, + Name extends string = `range<${Element["__name__"]}>` +> extends BaseType { + __name__: Name; + __kind__: TypeKind.range; + __element__: Element; +} + +///////////////////// +/// TSTYPE COMPUTATION +///////////////////// +export type orLiteralValue = + | Set + | (Set["__element__"] extends ObjectType + ? never + : computeTsType); + +export type BaseTypeToTsType = Type extends ScalarType + ? Type["__tsconsttype__"] + : Type extends EnumType + ? Type["__tstype__"] + : Type extends ArrayType + ? typeutil.flatten> + : Type extends RangeType + ? Range + : Type extends TupleType + ? TupleItemsToTsType + : Type extends NamedTupleType + ? typeutil.flatten> + : Type extends ObjectType + ? typeutil.flatten< + computeObjectShape + > + : never; + +export type setToTsType = computeTsType< + Set["__element__"], + Set["__cardinality__"] +>; + +export type computeTsTypeCard< + T extends any, + C extends Cardinality +> = Cardinality extends C + ? unknown + : C extends Cardinality.Empty + ? null + : C extends Cardinality.One + ? T + : C extends Cardinality.AtLeastOne + ? [T, ...T[]] + : C extends Cardinality.AtMostOne + ? T | null + : C extends Cardinality.Many + ? T[] + : C extends Cardinality + ? unknown + : never; + +export type computeTsType< + T extends BaseType, + C extends Cardinality +> = BaseType extends T ? unknown : computeTsTypeCard, C>; + +export type propToTsType = Prop extends PropertyDesc< + infer Type, + infer Card +> + ? setToTsType> + : never; + +export type linkToTsType = computeTsType< + Link["target"], + Link["cardinality"] +>; + +export type pointerToTsType = + El extends PropertyDesc + ? propToTsType + : El extends LinkDesc + ? linkToTsType + : never; + +/////////////////// +// TYPE HELPERS +/////////////////// + +export type getPrimitiveBaseType = T extends ScalarType + ? ScalarType + : T; + +export type getPrimitiveNonArrayBaseType = + T extends ArrayType ? never : getPrimitiveBaseType; + +export function isScalarType(type: BaseType): type is ScalarType { + return type.__kind__ === TypeKind.scalar; +} +export function isEnumType(type: BaseType): type is EnumType { + return type.__kind__ === TypeKind.enum; +} +export function isObjectType(type: BaseType): type is ObjectType { + return type.__kind__ === TypeKind.object; +} +export function isTupleType(type: BaseType): type is TupleType { + return type.__kind__ === TypeKind.tuple; +} +export function isNamedTupleType(type: BaseType): type is NamedTupleType { + return type.__kind__ === TypeKind.namedtuple; +} +export function isArrayType(type: BaseType): type is ArrayType { + return type.__kind__ === TypeKind.array; +} + +export type NonArrayType = + | ScalarType + | EnumType + | ObjectType + | TupleType + | NamedTupleType + | RangeType; + +export type AnyTupleType = TupleType | NamedTupleType; + +export type ParamType = + | ScalarType + | EnumType + | ArrayType< + | ScalarType + | TupleType> + | NamedTupleType<{ [k: string]: ParamType }> + | RangeType + > + | TupleType> + | NamedTupleType<{ [k: string]: ParamType }> + | RangeType; diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/update.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/update.ts new file mode 100644 index 000000000..b20bf1713 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/update.ts @@ -0,0 +1,134 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { + ExpressionKind, + typeutil, + Cardinality, +} from "edgedb/dist/reflection/index"; +import type { + Expression, + ObjectTypePointers, + TypeSet, + ObjectTypeSet, + stripBacklinks, + stripNonUpdateables, + ObjectTypeExpression, + ObjectType, + $scopify, +} from "./typesystem"; +import type { pointerToAssignmentExpression } from "./casting"; +import { $expressionify, $getScopedExpr, $assert_single } from "./path"; +import { + SelectModifiers, + NormalisedSelectModifiers, + ComputeSelectCardinality, + $existingScopes, + $handleModifiers, +} from "./select"; +import { $normaliseInsertShape, pointerIsOptional } from "./insert"; + +///////////////// +/// UPDATE +///////////////// + +export type $expr_Update< + El extends ObjectType = ObjectType, + Card extends Cardinality = Cardinality + // Set extends TypeSet = TypeSet, + // Expr extends ObjectTypeSet = ObjectTypeSet, + // Shape extends UpdateShape = any +> = Expression<{ + __kind__: ExpressionKind.Update; + __element__: El; + __cardinality__: Card; + __expr__: TypeSet; + __shape__: any; + __modifiers__: NormalisedSelectModifiers; + __scope__: ObjectTypeExpression; +}>; + +export type UpdateShape = typeutil.stripNever< + stripNonUpdateables> +> extends infer Shape + ? Shape extends ObjectTypePointers + ? { + [k in keyof Shape]?: + | ( + | pointerToAssignmentExpression + | (Shape[k]["cardinality"] extends + | Cardinality.Many + | Cardinality.AtLeastOne + ? + | { "+=": pointerToAssignmentExpression } + | { "-=": pointerToAssignmentExpression } + : never) + ) + | (pointerIsOptional extends true + ? undefined | null + : never); + } + : never + : never; + +export function update< + Expr extends ObjectTypeExpression, + Shape extends { + filter?: SelectModifiers["filter"]; + filter_single?: SelectModifiers["filter_single"]; + set: UpdateShape; + } + // SetShape extends UpdateShape, + // Modifiers extends Pick +>( + expr: Expr, + shape: (scope: $scopify) => Readonly +): $expr_Update> { + const cleanScopedExprs = $existingScopes.size === 0; + + const scope = $getScopedExpr(expr as any, $existingScopes); + + const resolvedShape = shape(scope); + + if (cleanScopedExprs) { + $existingScopes.clear(); + } + + const mods: any = {}; + let updateShape: any | null; + for (const [key, val] of Object.entries(resolvedShape)) { + if (key === "filter" || key === "filter_single") { + mods[key] = val; + } else if (key === "set") { + updateShape = val; + } else { + throw new Error( + `Invalid update shape key '${key}', only 'filter', 'filter_single', ` + + `and 'set' are allowed` + ); + } + } + + if (!updateShape) { + throw new Error(`Update shape must contain 'set' shape`); + } + + const { modifiers, cardinality, needsAssertSingle } = $handleModifiers(mods, { + root: expr, + scope, + }); + + const updateExpr = { + __kind__: ExpressionKind.Update, + __element__: expr.__element__, + __cardinality__: cardinality, + __expr__: expr, + __shape__: $normaliseInsertShape(expr, updateShape, true), + __modifiers__: modifiers, + __scope__: scope, + } as any; + + return needsAssertSingle + ? $assert_single(updateExpr) + : $expressionify(updateExpr); +} diff --git a/packages/benchmarks/project-fixture/dbschema/edgeql-js/with.ts b/packages/benchmarks/project-fixture/dbschema/edgeql-js/with.ts new file mode 100644 index 000000000..165aeab28 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/edgeql-js/with.ts @@ -0,0 +1,65 @@ +// GENERATED by @edgedb/generate v0.1.1 +// Run 'npx @edgedb/generate edgeql-js' to re-generate + +import { ExpressionKind, Cardinality } from "edgedb/dist/reflection/index"; +import type { BaseType, Expression, TypeSet } from "./typesystem"; +import type { $expr_Select } from "./select"; +import type { $expr_For } from "./for"; +import type { $expr_Insert } from "./insert"; +import type { $expr_Update } from "./update"; +import type { $expr_Group } from "./group"; +import { $expressionify } from "./path"; + +export type $expr_Alias< + El extends BaseType = BaseType, + Card extends Cardinality = Cardinality +> = Expression<{ + __element__: El; + __cardinality__: Card; + __kind__: ExpressionKind.Alias; + __expr__: TypeSet; +}>; + +export function alias( + expr: Expr +): $expr_Alias { + return $expressionify({ + __kind__: ExpressionKind.Alias, + __element__: expr.__element__, + __cardinality__: expr.__cardinality__, + __expr__: expr, + }) as any; +} + +export type WithableExpression = + | $expr_Select + | $expr_For + | $expr_Insert + | $expr_Update + | $expr_Group; + +export type $expr_With< + // Refs extends TypeSet[] = TypeSet[], + Expr extends WithableExpression = WithableExpression +> = Expression<{ + __element__: Expr["__element__"]; + __cardinality__: Expr["__cardinality__"]; + __kind__: ExpressionKind.With; + __expr__: Expr; + __refs__: TypeSet[]; +}>; + +function _with( + refs: Expression[], + expr: Expr +): $expr_With { + return $expressionify({ + __kind__: ExpressionKind.With, + __element__: expr.__element__, + __cardinality__: expr.__cardinality__, + __refs__: refs, + __expr__: expr as any, + }) as any; +} + +export { _with as with }; diff --git a/packages/benchmarks/project-fixture/dbschema/futures.esdl b/packages/benchmarks/project-fixture/dbschema/futures.esdl new file mode 100644 index 000000000..332c7d84b --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/futures.esdl @@ -0,0 +1,4 @@ +# Disable the application of access policies within access policies +# themselves. This behavior will become the default in EdgeDB 3.0. +# See: https://www.edgedb.com/docs/reference/ddl/access_policies#nonrecursive +using future nonrecursive_access_policies; diff --git a/packages/benchmarks/project-fixture/dbschema/migrations/00001.edgeql b/packages/benchmarks/project-fixture/dbschema/migrations/00001.edgeql new file mode 100644 index 000000000..cd8fbc2d8 --- /dev/null +++ b/packages/benchmarks/project-fixture/dbschema/migrations/00001.edgeql @@ -0,0 +1,8 @@ +CREATE MIGRATION m1rkcenp45a4waxmvoyodlrhlj7kh3hnl6rta74zsghtlsu56tlfwq + ONTO initial +{ + CREATE FUTURE nonrecursive_access_policies; + CREATE TYPE default::Person { + CREATE REQUIRED PROPERTY name: std::str; + }; +}; diff --git a/packages/benchmarks/project-fixture/edgedb.toml b/packages/benchmarks/project-fixture/edgedb.toml new file mode 100644 index 000000000..4e3f0b771 --- /dev/null +++ b/packages/benchmarks/project-fixture/edgedb.toml @@ -0,0 +1,2 @@ +[edgedb] +server-version = "3.0-rc.2" diff --git a/packages/benchmarks/project-fixture/index.ts b/packages/benchmarks/project-fixture/index.ts new file mode 100644 index 000000000..5515de8e2 --- /dev/null +++ b/packages/benchmarks/project-fixture/index.ts @@ -0,0 +1,9 @@ +import { createClient } from "edgedb"; +import * as e from "./dbschema/edgeql-js"; + +async function run() { + const client = createClient(); + await e.select(e.Person, {}).run(client); +} + +run(); diff --git a/packages/benchmarks/project-fixture/package.json b/packages/benchmarks/project-fixture/package.json new file mode 100644 index 000000000..2140d79a9 --- /dev/null +++ b/packages/benchmarks/project-fixture/package.json @@ -0,0 +1,9 @@ +{ + "name": "project-fixture", + "devDependencies": { + "@edgedb/generate": "^0.1.1" + }, + "dependencies": { + "edgedb": "^1.2.2" + } +} diff --git a/packages/benchmarks/project-fixture/tsconfig.json b/packages/benchmarks/project-fixture/tsconfig.json new file mode 100644 index 000000000..e075f973c --- /dev/null +++ b/packages/benchmarks/project-fixture/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/packages/benchmarks/project-fixture/yarn.lock b/packages/benchmarks/project-fixture/yarn.lock new file mode 100644 index 000000000..555f0fe75 --- /dev/null +++ b/packages/benchmarks/project-fixture/yarn.lock @@ -0,0 +1,117 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@edgedb/generate@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@edgedb/generate/-/generate-0.1.1.tgz#37f7cecfb8760a0e18a4be21e277ab5913edfbd2" + integrity sha512-0NVX6WzKIDEBH+XlQS7gO/I63TI2IKjQWq5k3EFLsxMUSGL1LvxwHZNr7vXSxH1XRr+Qoyil9dxM+Ff78t/xZw== + dependencies: + chokidar "^3.5.3" + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +chokidar@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +edgedb@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/edgedb/-/edgedb-1.2.2.tgz#31756998e02c3e720d0c13a85697d0f3b8415c66" + integrity sha512-NQfd7dLSluxrHFGxaB/PtCGagdiiWuAqf0HtPFsR2epahsQYZU6DJipy+Vn0wdxLSlVKCRG+iAajrcVAvWZdog== + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" diff --git a/packages/benchmarks/src/index.ts b/packages/benchmarks/src/index.ts new file mode 100644 index 000000000..d853c484d --- /dev/null +++ b/packages/benchmarks/src/index.ts @@ -0,0 +1,88 @@ +import * as path from "node:path"; +import { Bench } from "tinybench"; + +import { type TSServer, createServer } from "./server-fixture"; + +const mockFileName = path.join(__dirname, "..", "project-fixture", "main.ts"); +const mockFileContent = `\ +import { edgedb } from "edgedb"; +import * as e from "./dbschema/edgeql-js"; + +async fuction main() { + await e.select(e.Person, () => ({ + # cursor here + })) +} + +main(); +`; + +async function getCompletion(server: TSServer) { + await server.requestCommand("completions", { + file: mockFileName, + offset: 4, + line: 5, + }); +} + +let activeServer: TSServer; + +let bench = new Bench({ time: 50 }); + +for (const version of ["ts48", "ts49", "ts50", "ts51"]) { + bench = bench.add( + version, + async () => { + await getCompletion(activeServer); + }, + { + beforeAll: () => { + activeServer = createServer( + path.join( + __dirname, + "..", + "..", + "..", + "node_modules", + version, + "bin", + "tsserver" + ) + ); + activeServer.send({ + command: "open", + arguments: { + file: mockFileName, + fileContent: mockFileContent, + }, + }); + }, + afterAll: async () => { + await activeServer.close(); + }, + } + ); +} + +async function main() { + console.log("Running benchmarks..."); + + await bench.run(); + console.table( + bench.tasks.map(({ name, result }) => + result + ? { + name, + "ops/sec": parseInt(result.hz.toString(), 10).toLocaleString(), + margin: `\xb1${result.rme.toFixed(2)}%`, + samples: result.samples.length, + mean: result.mean * 1000, + p75: result.p75 * 1000, + p99: result.p99 * 1000, + } + : null + ) + ); +} + +main(); diff --git a/packages/benchmarks/src/server-fixture.ts b/packages/benchmarks/src/server-fixture.ts new file mode 100644 index 000000000..c255f09fe --- /dev/null +++ b/packages/benchmarks/src/server-fixture.ts @@ -0,0 +1,135 @@ +import { fork, type ChildProcess } from "node:child_process"; +import path from "node:path"; +import readline from "node:readline"; + +class Deferred { + promise: Promise; + resolve!: (t: T) => void; + reject!: (reason?: any) => void; + + constructor() { + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + } +} + +export class TSServer { + _exitPromise: Promise; + _pendingResponses: number; + _isClosed: boolean; + _server: ChildProcess; + _seq: number; + deferred: Deferred | null = null; + + constructor(tsserverPath: string) { + const logfile = path.join(__dirname, "log.txt"); + const server = fork( + tsserverPath, + ["--logVerbosity", "verbose", "--logFile", logfile], + { + cwd: path.join(__dirname, "..", "project-fixture"), + stdio: ["pipe", "pipe", "pipe", "ipc"], + } + ); + this._exitPromise = new Promise((resolve, reject) => { + server.on("exit", (code) => resolve(code)); + server.on("error", (reason) => reject(reason)); + }); + + if (!server.stdout || !server.stderr) { + throw new Error("Could not initialize server process"); + } + + server.stdout.setEncoding("utf-8"); + + readline + .createInterface({ + input: server.stderr, + }) + .on("line", (line) => console.warn(line)); + + readline + .createInterface({ + input: server.stdout, + }) + .on("line", (line) => { + if (line[0] !== "{") { + return; + } + try { + const result = JSON.parse(line); + if (result.type === "response") { + --this._pendingResponses; + this.deferred?.resolve(result); + + if (this._pendingResponses <= 0 && this._isClosed) { + this._shutdown(); + } + } + } catch (e) { + // noop + } + }); + + this._isClosed = false; + this._server = server; + this._seq = 0; + this._pendingResponses = 0; + } + + send(command: Record, responseExpected: boolean = false) { + if (this._isClosed) { + throw new Error("server is closed"); + } + if (responseExpected) { + ++this._pendingResponses; + } + const seq = ++this._seq; + const deferred = new Deferred(); + this.deferred = deferred; + const req = + JSON.stringify(Object.assign({ seq, type: "request" }, command)) + "\n"; + if (!this._server.stdin) { + throw new Error( + "Could not write to server process due to process not having a stdin interface at runtime" + ); + } + this._server.stdin.write(req); + + return deferred.promise; + } + + sendCommand(name: string, args: Record) { + this.send({ command: name, arguments: args }, true); + } + + async requestCommand(name: string, args: Record) { + return this.send({ command: name, arguments: args }, true); + } + + close() { + if (!this._isClosed) { + this._isClosed = true; + if (this._pendingResponses <= 0) { + this._shutdown(); + } + } + return this._exitPromise; + } + + _shutdown() { + if (!this._server.stdin) { + throw new Error( + "Shutdown command issued when server process did not have a stdin interface" + ); + } + this._server.stdin.end(); + this._server.kill(); + } +} + +export function createServer(tsserverPath: string) { + return new TSServer(tsserverPath); +} diff --git a/packages/benchmarks/tsconfig.json b/packages/benchmarks/tsconfig.json new file mode 100644 index 000000000..e075f973c --- /dev/null +++ b/packages/benchmarks/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/packages/generate/src/syntax/with.ts b/packages/generate/src/syntax/with.ts index 6c689e5e7..821755511 100644 --- a/packages/generate/src/syntax/with.ts +++ b/packages/generate/src/syntax/with.ts @@ -1,4 +1,4 @@ -import { ExpressionKind, Cardinality } from "edgedb/dist/reflection/index"; +import { ExpressionKind, type Cardinality } from "edgedb/dist/reflection/index"; import type { BaseType, Expression, TypeSet } from "./typesystem"; import type { $expr_Select } from "./select"; import type { $expr_For } from "./for"; diff --git a/yarn.lock b/yarn.lock index dd00d48c3..e7f1d671b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,6 +10,40 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" +"@arrows/array@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@arrows/array/-/array-1.4.1.tgz#a6580a08cee219755ca9a8eb14e956d3c29a5508" + integrity sha512-MGYS8xi3c4tTy1ivhrVntFvufoNzje0PchjEz6G/SsWRgUKxL4tKwS6iPdO8vsaJYldagAeWMd5KRD0aX3Q39g== + dependencies: + "@arrows/composition" "^1.2.2" + +"@arrows/composition@^1.0.0", "@arrows/composition@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@arrows/composition/-/composition-1.2.2.tgz#d0a213cac8f8c36c1c75856a1e6ed940c27e9169" + integrity sha512-9fh1yHwrx32lundiB3SlZ/VwuStPB4QakPsSLrGJFH6rCXvdrd060ivAZ7/2vlqPnEjBkPRRXOcG1YOu19p2GQ== + +"@arrows/dispatch@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@arrows/dispatch/-/dispatch-1.0.3.tgz#c4c06260f89e9dd4ce280df3712980aa2f3de976" + integrity sha512-v/HwvrFonitYZM2PmBlAlCqVqxrkIIoiEuy5bQgn0BdfvlL0ooSBzcPzTMrtzY8eYktPyYcHg8fLbSgyybXEqw== + dependencies: + "@arrows/composition" "^1.2.2" + +"@arrows/error@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@arrows/error/-/error-1.0.2.tgz#4e68036f901118ba6f1de88656ef6be49e650414" + integrity sha512-yvkiv1ay4Z3+Z6oQsUkedsQm5aFdyPpkBUQs8vejazU/RmANABx6bMMcBPPHI4aW43VPQmXFfBzr/4FExwWTEA== + +"@arrows/multimethod@^1.1.6": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@arrows/multimethod/-/multimethod-1.4.1.tgz#319d0b6f84d22522dd2f4b24f04137b6219f0300" + integrity sha512-AZnAay0dgPnCJxn3We5uKiB88VL+1ZIF2SjZohLj6vqY2UyvB/sKdDnFP+LZNVsTC5lcnGPmLlRRkAh4sXkXsQ== + dependencies: + "@arrows/array" "^1.4.1" + "@arrows/composition" "^1.2.2" + "@arrows/error" "^1.0.2" + fast-deep-equal "^3.1.3" + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4": version "7.21.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" @@ -299,6 +333,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@esbuild-kit/cjs-loader@^2.4.2": version "2.4.2" resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.2.tgz#cb4dde00fbf744a68c4f20162ea15a8242d0fa54" @@ -716,6 +757,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" @@ -731,6 +777,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.18" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" @@ -792,6 +846,26 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@types/babel__core@^7.1.14": version "7.20.0" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.0.tgz#61bc5a4cae505ce98e1e36c5445e4bee060d8891" @@ -1017,12 +1091,12 @@ acorn-jsx@^5.3.2: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^8.0.2: +acorn-walk@^8.0.2, acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.1.0, acorn@^8.8.0, acorn@^8.8.1: +acorn@^8.1.0, acorn@^8.4.1, acorn@^8.8.0, acorn@^8.8.1: version "8.8.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== @@ -1044,7 +1118,7 @@ ajv@^6.10.0, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-escapes@^4.2.1: +ansi-escapes@^4.2.1, ansi-escapes@^4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -1083,6 +1157,11 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1100,6 +1179,11 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1170,6 +1254,29 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +benchmark@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629" + integrity sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ== + dependencies: + lodash "^4.17.4" + platform "^1.3.3" + +benny@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/benny/-/benny-3.7.1.tgz#964aaaf877e3ab658f79705422277b8471868e37" + integrity sha512-USzYxODdVfOS7JuQq/L0naxB788dWCiUgUTxvN+WLPt/JfcDURNNj8kN/N+uK6PDvuR67/9/55cVKGPleFQINA== + dependencies: + "@arrows/composition" "^1.0.0" + "@arrows/dispatch" "^1.0.2" + "@arrows/multimethod" "^1.1.6" + benchmark "^2.1.4" + common-tags "^1.8.0" + fs-extra "^10.0.0" + json2csv "^5.0.6" + kleur "^4.1.4" + log-update "^4.0.0" + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" @@ -1291,6 +1398,13 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -1346,6 +1460,16 @@ commander@^2.12.1: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== + +common-tags@^1.8.0: + version "1.8.2" + resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" + integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1373,6 +1497,11 @@ copy-anything@^3.0.2: dependencies: is-what "^4.1.8" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1942,6 +2071,15 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2048,7 +2186,7 @@ globby@^13.1.2: merge2 "^1.4.1" slash "^4.0.0" -graceful-fs@^4.2.9: +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -2730,16 +2868,44 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json2csv@^5.0.6: + version "5.0.7" + resolved "https://registry.yarnpkg.com/json2csv/-/json2csv-5.0.7.tgz#f3a583c25abd9804be873e495d1e65ad8d1b54ae" + integrity sha512-YRZbUnyaJZLZUJSRi2G/MqahCyRv9n/ds+4oIetjDF3jWQA7AG7iSeKTiZiCNqtMZM7HDyt0e/W6lEnoGEmMGA== + dependencies: + commander "^6.1.0" + jsonparse "^1.3.1" + lodash.get "^4.4.2" + json5@^2.2.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonparse@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +kleur@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" + integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== + leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -2780,6 +2946,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== + lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -2790,6 +2961,21 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lodash@^4.17.4: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-update@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" + integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== + dependencies: + ansi-escapes "^4.3.0" + cli-cursor "^3.1.0" + slice-ansi "^4.0.0" + wrap-ansi "^6.2.0" + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -2811,7 +2997,7 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" -make-error@1.x: +make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -2926,7 +3112,7 @@ once@^1.3.0: dependencies: wrappy "1" -onetime@^5.1.2: +onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -3061,6 +3247,11 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +platform@^1.3.3: + version "1.3.6" + resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7" + integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -3171,6 +3362,14 @@ resolve@^1.20.0, resolve@^1.3.2: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -3231,7 +3430,7 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -signal-exit@^3.0.3, signal-exit@^3.0.7: +signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -3251,6 +3450,15 @@ slash@^4.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" @@ -3375,6 +3583,11 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== +tinybench@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.5.0.tgz#4711c99bbf6f3e986f67eb722fed9cddb3a68ba5" + integrity sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA== + tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" @@ -3423,6 +3636,45 @@ ts-jest@29.1.0, ts-jest@^29.1.0: semver "7.x" yargs-parser "^21.0.1" +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +"ts48@npm:typescript@4.8.4": + version "4.8.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" + integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== + +"ts49@npm:typescript@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +"ts50@npm:typescript@5.0.4", typescript@^5.0, typescript@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== + +"ts51@npm:typescript@5.1.3": + version "5.1.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826" + integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw== + tslib@^1.13.0, tslib@^1.7.1, tslib@^1.8.1: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -3520,16 +3772,16 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -typescript@^5.0, typescript@^5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== - universalify@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + update-browserslist-db@^1.0.10: version "1.0.11" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" @@ -3553,6 +3805,11 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-to-istanbul@^9.0.1: version "9.1.0" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265" @@ -3613,6 +3870,15 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -3683,6 +3949,11 @@ yargs@^17.3.1: y18n "^5.0.5" yargs-parser "^21.1.1" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From aaf675b4f1d46888eb9b157dfa094cb324b9c2c3 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Fri, 9 Jun 2023 10:27:23 -0400 Subject: [PATCH 2/6] Warn on no-inferrable-types --- .eslintrc.cjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0bc22ce4c..5870d1963 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -3,7 +3,7 @@ module.exports = { extends: [ "eslint:recommended", "plugin:@typescript-eslint/recommended", - "prettier" + "prettier", ], parser: "@typescript-eslint/parser", plugins: ["@typescript-eslint"], @@ -13,6 +13,7 @@ module.exports = { // Svelte doesn't correctly compile if imports of the generated /modules // aren't imported as 'import type' in other parts of the generated // querybuilder, so set this option to ensure we always do that - "@typescript-eslint/consistent-type-imports": "error" - } + "@typescript-eslint/consistent-type-imports": "error", + "@typescript-eslint/no-inferrable-types": "warn", + }, }; From 445df72b3155df748a3a08caea5966173c69c3d8 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Fri, 9 Jun 2023 14:57:39 -0400 Subject: [PATCH 3/6] Fix which line, add assertions, and manual warmup --- packages/benchmarks/project-fixture/index.ts | 10 +-- packages/benchmarks/src/index.ts | 82 +++++++++++++++++--- packages/benchmarks/src/server-fixture.ts | 8 +- 3 files changed, 77 insertions(+), 23 deletions(-) diff --git a/packages/benchmarks/project-fixture/index.ts b/packages/benchmarks/project-fixture/index.ts index 5515de8e2..8337712ea 100644 --- a/packages/benchmarks/project-fixture/index.ts +++ b/packages/benchmarks/project-fixture/index.ts @@ -1,9 +1 @@ -import { createClient } from "edgedb"; -import * as e from "./dbschema/edgeql-js"; - -async function run() { - const client = createClient(); - await e.select(e.Person, {}).run(client); -} - -run(); +// diff --git a/packages/benchmarks/src/index.ts b/packages/benchmarks/src/index.ts index d853c484d..7d7640df1 100644 --- a/packages/benchmarks/src/index.ts +++ b/packages/benchmarks/src/index.ts @@ -1,33 +1,73 @@ import * as path from "node:path"; +import * as assert from "node:assert/strict"; import { Bench } from "tinybench"; import { type TSServer, createServer } from "./server-fixture"; const mockFileName = path.join(__dirname, "..", "project-fixture", "main.ts"); const mockFileContent = `\ -import { edgedb } from "edgedb"; -import * as e from "./dbschema/edgeql-js"; +import { createClient } from "edgedb"; +import e from "./dbschema/edgeql-js"; async fuction main() { - await e.select(e.Person, () => ({ - # cursor here - })) + const client = createClient(); + await e + .select(e.Person, () => ({ + // Cursor here + })) + .run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); + await e.select(e.Person, () => ({})).run(client); } main(); `; async function getCompletion(server: TSServer) { - await server.requestCommand("completions", { + return server.requestCommand("completions", { file: mockFileName, offset: 4, - line: 5, + line: 8, }); } let activeServer: TSServer; -let bench = new Bench({ time: 50 }); +let bench = new Bench({ time: 5000, iterations: 2000 }); for (const version of ["ts48", "ts49", "ts50", "ts51"]) { bench = bench.add( @@ -36,7 +76,7 @@ for (const version of ["ts48", "ts49", "ts50", "ts51"]) { await getCompletion(activeServer); }, { - beforeAll: () => { + beforeAll: async () => { activeServer = createServer( path.join( __dirname, @@ -45,8 +85,8 @@ for (const version of ["ts48", "ts49", "ts50", "ts51"]) { "..", "node_modules", version, - "bin", - "tsserver" + "lib", + "tsserver.js" ) ); activeServer.send({ @@ -56,6 +96,26 @@ for (const version of ["ts48", "ts49", "ts50", "ts51"]) { fileContent: mockFileContent, }, }); + const response = await getCompletion(activeServer); + assert.equal(response.command, "completions"); + assert.ok(response.success); + assert.ok(response.body.length && response.body.length > 0); + assert.ok( + response.body.some( + (com: Record) => com.name === "__type__" + ) + ); + assert.ok( + response.body.some( + (com: Record) => com.name === "filter_single" + ) + ); + assert.ok( + response.body.some((com: Record) => com.name === "id") + ); + for (const _ of Array.from({ length: 100 })) { + await getCompletion(activeServer); + } }, afterAll: async () => { await activeServer.close(); diff --git a/packages/benchmarks/src/server-fixture.ts b/packages/benchmarks/src/server-fixture.ts index c255f09fe..80f873e45 100644 --- a/packages/benchmarks/src/server-fixture.ts +++ b/packages/benchmarks/src/server-fixture.ts @@ -2,6 +2,8 @@ import { fork, type ChildProcess } from "node:child_process"; import path from "node:path"; import readline from "node:readline"; +type TSServerResponse = { type: "response" } & Record; + class Deferred { promise: Promise; resolve!: (t: T) => void; @@ -21,7 +23,7 @@ export class TSServer { _isClosed: boolean; _server: ChildProcess; _seq: number; - deferred: Deferred | null = null; + deferred: Deferred | null = null; constructor(tsserverPath: string) { const logfile = path.join(__dirname, "log.txt"); @@ -59,7 +61,7 @@ export class TSServer { return; } try { - const result = JSON.parse(line); + const result: TSServerResponse = JSON.parse(line); if (result.type === "response") { --this._pendingResponses; this.deferred?.resolve(result); @@ -87,7 +89,7 @@ export class TSServer { ++this._pendingResponses; } const seq = ++this._seq; - const deferred = new Deferred(); + const deferred = new Deferred(); this.deferred = deferred; const req = JSON.stringify(Object.assign({ seq, type: "request" }, command)) + "\n"; From c0a03a0e1610aa5d80a967e9fef2d613996b22e9 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Fri, 9 Jun 2023 14:58:59 -0400 Subject: [PATCH 4/6] Fix script name --- packages/benchmarks/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/benchmarks/package.json b/packages/benchmarks/package.json index bf0db0769..08a518cca 100644 --- a/packages/benchmarks/package.json +++ b/packages/benchmarks/package.json @@ -27,7 +27,7 @@ "typescript": "^5.0" }, "scripts": { - "benchmark": "tsx src/benchmark.ts" + "benchmark": "tsx src/index.ts" }, "bugs": { "url": "https://github.com/edgedb/edgedb-js/issues" From 493ac5cc601ccc7d863f4249bb03ce0b85adfd97 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Fri, 9 Jun 2023 15:08:05 -0400 Subject: [PATCH 5/6] Add vars/args ignore pattern --- .eslintrc.cjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5870d1963..bd231bca1 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -15,5 +15,12 @@ module.exports = { // querybuilder, so set this option to ensure we always do that "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/no-inferrable-types": "warn", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + }, + ], }, }; From 39ac2084480e7befda99a820184f9c51abc12805 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Fri, 9 Jun 2023 15:11:48 -0400 Subject: [PATCH 6/6] Stub `build` and `test` scripts --- packages/benchmarks/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/benchmarks/package.json b/packages/benchmarks/package.json index 08a518cca..faae6860a 100644 --- a/packages/benchmarks/package.json +++ b/packages/benchmarks/package.json @@ -27,7 +27,9 @@ "typescript": "^5.0" }, "scripts": { - "benchmark": "tsx src/index.ts" + "benchmark": "tsx src/index.ts", + "test": "echo 'No tests for benchmarks...'", + "build": "echo 'No build for benchmarks...'" }, "bugs": { "url": "https://github.com/edgedb/edgedb-js/issues"