Full Code of kysely-org/kysely for AI

master 91cf3733b2a4 cached
616 files
2.6 MB
705.7k tokens
3234 symbols
1 requests
Download .txt
Showing preview only (2,810K chars total). Download the full file or copy to clipboard to get everything.
Repository: kysely-org/kysely
Branch: master
Commit: 91cf3733b2a4
Files: 616
Total size: 2.6 MB

Directory structure:
gitextract_h4793jw5/

├── .github/
│   └── workflows/
│       ├── bench.yml
│       ├── compare.yml
│       ├── preview.yml
│       ├── publish.yml
│       └── test.yml
├── .gitignore
├── .mocharc.js
├── .node-version
├── .npmrc
├── .nvmrc
├── .prettierignore
├── .prettierrc.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── FUNDING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── deno.check.d.ts
├── deno.check.json
├── deno.lint.json
├── docker-compose.yml
├── docs/
│   └── index.html
├── example/
│   ├── .gitignore
│   ├── .prettierrc.json
│   ├── README.md
│   ├── package.json
│   ├── src/
│   │   ├── app.ts
│   │   ├── authentication/
│   │   │   ├── auth-token.service.ts
│   │   │   ├── auth-token.ts
│   │   │   ├── authentication.service.ts
│   │   │   ├── refresh-token.repository.ts
│   │   │   ├── refresh-token.table.ts
│   │   │   └── refresh-token.ts
│   │   ├── config.ts
│   │   ├── context.ts
│   │   ├── database.ts
│   │   ├── migrate-to-latest.ts
│   │   ├── migrations/
│   │   │   ├── 2021_09_18_06_54_59_create_user.ts
│   │   │   ├── 2021_09_18_14_05_20_create_refresh_token.ts
│   │   │   └── 2021_09_18_18_22_45_create_sign_in_method.ts
│   │   ├── router.ts
│   │   ├── user/
│   │   │   ├── sign-in-method/
│   │   │   │   ├── password-sign-in-method.table.ts
│   │   │   │   ├── sign-in-method.controller.ts
│   │   │   │   ├── sign-in-method.repository.ts
│   │   │   │   ├── sign-in-method.service.ts
│   │   │   │   ├── sign-in-method.table.ts
│   │   │   │   └── sign-in-method.ts
│   │   │   ├── signed-in-user.ts
│   │   │   ├── user.controller.ts
│   │   │   ├── user.repository.ts
│   │   │   ├── user.service.ts
│   │   │   ├── user.table.ts
│   │   │   └── user.ts
│   │   └── util/
│   │       ├── ajv.ts
│   │       ├── errors.ts
│   │       └── object.ts
│   ├── test/
│   │   ├── test-config.ts
│   │   ├── test-context.ts
│   │   └── user/
│   │       └── user.test.ts
│   └── tsconfig.json
├── jsr.json
├── outdated-typescript.d.ts
├── package.json
├── pnpm-workspace.yaml
├── scripts/
│   ├── add-deno-type-references.js
│   ├── align-versions.mts
│   ├── check-esm-imports.js
│   ├── check-exports.js
│   ├── copy-interface-documentation.js
│   ├── exclude-test-files-for-backwards-compat.mts
│   ├── generate-site-examples.js
│   ├── module-fixup.js
│   ├── remove-global-augmentations.mts
│   ├── tsconfig.json
│   └── util/
│       └── for-each-file.js
├── site/
│   ├── .gitignore
│   ├── babel.config.js
│   ├── docs/
│   │   ├── dialects.md
│   │   ├── examples/
│   │   │   ├── _category_.json
│   │   │   ├── cte/
│   │   │   │   ├── 0010-simple-selects.js
│   │   │   │   ├── 0010-simple-selects.mdx
│   │   │   │   ├── 0020-inserts-updates-and-deletions.js
│   │   │   │   ├── 0020-inserts-updates-and-deletions.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── delete/
│   │   │   │   ├── 0010-single-row.js
│   │   │   │   ├── 0010-single-row.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── insert/
│   │   │   │   ├── 0010-single-row.js
│   │   │   │   ├── 0010-single-row.mdx
│   │   │   │   ├── 0020-multiple-rows.js
│   │   │   │   ├── 0020-multiple-rows.mdx
│   │   │   │   ├── 0030-returning-data.js
│   │   │   │   ├── 0030-returning-data.mdx
│   │   │   │   ├── 0040-complex-values.js
│   │   │   │   ├── 0040-complex-values.mdx
│   │   │   │   ├── 0050-insert-subquery.js
│   │   │   │   ├── 0050-insert-subquery.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── join/
│   │   │   │   ├── 0010-simple-inner-join.js
│   │   │   │   ├── 0010-simple-inner-join.mdx
│   │   │   │   ├── 0020-aliased-inner-join.js
│   │   │   │   ├── 0020-aliased-inner-join.mdx
│   │   │   │   ├── 0030-complex-join.js
│   │   │   │   ├── 0030-complex-join.mdx
│   │   │   │   ├── 0040-subquery-join.js
│   │   │   │   ├── 0040-subquery-join.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── merge/
│   │   │   │   ├── 0010-source-row-existence.js
│   │   │   │   ├── 0010-source-row-existence.mdx
│   │   │   │   ├── 0020-temporary-changes-table.js
│   │   │   │   ├── 0020-temporary-changes-table.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── select/
│   │   │   │   ├── 0010-a-single-column.js
│   │   │   │   ├── 0010-a-single-column.mdx
│   │   │   │   ├── 0020-column-with-a-table.js
│   │   │   │   ├── 0020-column-with-a-table.mdx
│   │   │   │   ├── 0030-multiple-columns.js
│   │   │   │   ├── 0030-multiple-columns.mdx
│   │   │   │   ├── 0040-aliases.js
│   │   │   │   ├── 0040-aliases.mdx
│   │   │   │   ├── 0050-complex-selections.js
│   │   │   │   ├── 0050-complex-selections.mdx
│   │   │   │   ├── 0051-not-null.js
│   │   │   │   ├── 0051-not-null.mdx
│   │   │   │   ├── 0060-function-calls.js
│   │   │   │   ├── 0060-function-calls.mdx
│   │   │   │   ├── 0070-distinct.js
│   │   │   │   ├── 0070-distinct.mdx
│   │   │   │   ├── 0080-distinct-on.js
│   │   │   │   ├── 0080-distinct-on.mdx
│   │   │   │   ├── 0090-all-columns.js
│   │   │   │   ├── 0090-all-columns.mdx
│   │   │   │   ├── 0100-all-columns-of-a-table.js
│   │   │   │   ├── 0100-all-columns-of-a-table.mdx
│   │   │   │   ├── 0110-nested-array.js
│   │   │   │   ├── 0110-nested-array.mdx
│   │   │   │   ├── 0120-nested-object.js
│   │   │   │   ├── 0120-nested-object.mdx
│   │   │   │   ├── 0130-generic-find-query.js
│   │   │   │   ├── 0130-generic-find-query.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── transactions/
│   │   │   │   ├── 0010-simple-transaction.js
│   │   │   │   ├── 0010-simple-transaction.mdx
│   │   │   │   ├── 0011-controlled-transaction.js
│   │   │   │   ├── 0011-controlled-transaction.mdx
│   │   │   │   ├── 0012-controlled-transaction-w-savepoints.js
│   │   │   │   ├── 0012-controlled-transaction-w-savepoints.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── update/
│   │   │   │   ├── 0010-single-row.js
│   │   │   │   ├── 0010-single-row.mdx
│   │   │   │   ├── 0020-complex-values.js
│   │   │   │   ├── 0020-complex-values.mdx
│   │   │   │   ├── 0030-my-sql-joins.js
│   │   │   │   ├── 0030-my-sql-joins.mdx
│   │   │   │   └── _category_.json
│   │   │   └── where/
│   │   │       ├── 0010-simple-where-clause.js
│   │   │       ├── 0010-simple-where-clause.mdx
│   │   │       ├── 0020-where-in.js
│   │   │       ├── 0020-where-in.mdx
│   │   │       ├── 0030-object-filter.js
│   │   │       ├── 0030-object-filter.mdx
│   │   │       ├── 0040-or-where.js
│   │   │       ├── 0040-or-where.mdx
│   │   │       ├── 0050-conditional-where-calls.js
│   │   │       ├── 0050-conditional-where-calls.mdx
│   │   │       ├── 0060-complex-where-clause.js
│   │   │       ├── 0060-complex-where-clause.mdx
│   │   │       └── _category_.json
│   │   ├── execution.mdx
│   │   ├── generating-types.md
│   │   ├── getting-started/
│   │   │   ├── Dialects.tsx
│   │   │   ├── IUseADifferentDialect.tsx
│   │   │   ├── IUseADifferentPackageManager.tsx
│   │   │   ├── Installation.tsx
│   │   │   ├── Instantiation.tsx
│   │   │   ├── Querying.tsx
│   │   │   ├── Summary.tsx
│   │   │   ├── _prerequisites.mdx
│   │   │   ├── _types.mdx
│   │   │   └── shared.tsx
│   │   ├── getting-started.mdx
│   │   ├── integrations/
│   │   │   ├── _category_.json
│   │   │   ├── llms.mdx
│   │   │   └── supabase.mdx
│   │   ├── intro.mdx
│   │   ├── migrations.mdx
│   │   ├── playground.mdx
│   │   ├── plugins.md
│   │   ├── recipes/
│   │   │   ├── 0001-relations.md
│   │   │   ├── 0001-reusable-helpers.md
│   │   │   ├── 0002-data-types.md
│   │   │   ├── 0003-raw-sql.md
│   │   │   ├── 0004-splitting-query-building-and-execution.md
│   │   │   ├── 0005-conditional-selects.md
│   │   │   ├── 0006-expressions.md
│   │   │   ├── 0007-schemas.md
│   │   │   ├── 0008-deduplicate-joins.md
│   │   │   ├── 0009-excessively-deep-types.md
│   │   │   ├── 0010-extending-kysely.md
│   │   │   ├── 0011-introspecting-relation-metadata.md
│   │   │   ├── 0012-logging.md
│   │   │   └── _category_.json
│   │   └── runtimes/
│   │       ├── _category_.json
│   │       ├── browser.md
│   │       └── deno.mdx
│   ├── docusaurus.config.ts
│   ├── package.json
│   ├── sidebars.js
│   ├── src/
│   │   ├── components/
│   │   │   ├── DemoVideo.module.css
│   │   │   ├── DemoVideo.tsx
│   │   │   ├── Playground.module.css
│   │   │   ├── Playground.tsx
│   │   │   ├── SectionFeatures/
│   │   │   │   ├── index.tsx
│   │   │   │   └── styles.module.css
│   │   │   ├── SectionQuotes/
│   │   │   │   ├── Quote.tsx
│   │   │   │   ├── index.tsx
│   │   │   │   ├── quotes.ts
│   │   │   │   ├── reddit.module.css
│   │   │   │   └── styles.module.css
│   │   │   └── playground-example-types.ts
│   │   ├── css/
│   │   │   └── custom.css
│   │   └── pages/
│   │       ├── index.module.css
│   │       └── index.tsx
│   ├── static/
│   │   ├── .nojekyll
│   │   └── demo_optimized.webm
│   └── tsconfig.json
├── src/
│   ├── dialect/
│   │   ├── database-introspector.ts
│   │   ├── dialect-adapter-base.ts
│   │   ├── dialect-adapter.ts
│   │   ├── dialect.ts
│   │   ├── mssql/
│   │   │   ├── mssql-adapter.ts
│   │   │   ├── mssql-dialect-config.ts
│   │   │   ├── mssql-dialect.ts
│   │   │   ├── mssql-driver.ts
│   │   │   ├── mssql-introspector.ts
│   │   │   └── mssql-query-compiler.ts
│   │   ├── mysql/
│   │   │   ├── mysql-adapter.ts
│   │   │   ├── mysql-dialect-config.ts
│   │   │   ├── mysql-dialect.ts
│   │   │   ├── mysql-driver.ts
│   │   │   ├── mysql-introspector.ts
│   │   │   └── mysql-query-compiler.ts
│   │   ├── postgres/
│   │   │   ├── postgres-adapter.ts
│   │   │   ├── postgres-dialect-config.ts
│   │   │   ├── postgres-dialect.ts
│   │   │   ├── postgres-driver.ts
│   │   │   ├── postgres-introspector.ts
│   │   │   └── postgres-query-compiler.ts
│   │   └── sqlite/
│   │       ├── sqlite-adapter.ts
│   │       ├── sqlite-dialect-config.ts
│   │       ├── sqlite-dialect.ts
│   │       ├── sqlite-driver.ts
│   │       ├── sqlite-introspector.ts
│   │       └── sqlite-query-compiler.ts
│   ├── driver/
│   │   ├── connection-provider.ts
│   │   ├── database-connection.ts
│   │   ├── default-connection-provider.ts
│   │   ├── driver.ts
│   │   ├── dummy-driver.ts
│   │   ├── runtime-driver.ts
│   │   └── single-connection-provider.ts
│   ├── dynamic/
│   │   ├── dynamic-reference-builder.ts
│   │   ├── dynamic-table-builder.ts
│   │   └── dynamic.ts
│   ├── expression/
│   │   ├── expression-builder.ts
│   │   ├── expression-wrapper.ts
│   │   └── expression.ts
│   ├── helpers/
│   │   ├── mssql.ts
│   │   ├── mysql.ts
│   │   ├── postgres.ts
│   │   └── sqlite.ts
│   ├── index.ts
│   ├── kysely.ts
│   ├── migration/
│   │   ├── file-migration-provider.ts
│   │   └── migrator.ts
│   ├── operation-node/
│   │   ├── add-column-node.ts
│   │   ├── add-constraint-node.ts
│   │   ├── add-index-node.ts
│   │   ├── aggregate-function-node.ts
│   │   ├── alias-node.ts
│   │   ├── alter-column-node.ts
│   │   ├── alter-table-node.ts
│   │   ├── and-node.ts
│   │   ├── binary-operation-node.ts
│   │   ├── case-node.ts
│   │   ├── cast-node.ts
│   │   ├── check-constraint-node.ts
│   │   ├── collate-node.ts
│   │   ├── column-definition-node.ts
│   │   ├── column-node.ts
│   │   ├── column-update-node.ts
│   │   ├── common-table-expression-name-node.ts
│   │   ├── common-table-expression-node.ts
│   │   ├── constraint-node.ts
│   │   ├── create-index-node.ts
│   │   ├── create-schema-node.ts
│   │   ├── create-table-node.ts
│   │   ├── create-type-node.ts
│   │   ├── create-view-node.ts
│   │   ├── data-type-node.ts
│   │   ├── default-insert-value-node.ts
│   │   ├── default-value-node.ts
│   │   ├── delete-query-node.ts
│   │   ├── drop-column-node.ts
│   │   ├── drop-constraint-node.ts
│   │   ├── drop-index-node.ts
│   │   ├── drop-schema-node.ts
│   │   ├── drop-table-node.ts
│   │   ├── drop-type-node.ts
│   │   ├── drop-view-node.ts
│   │   ├── explain-node.ts
│   │   ├── fetch-node.ts
│   │   ├── foreign-key-constraint-node.ts
│   │   ├── from-node.ts
│   │   ├── function-node.ts
│   │   ├── generated-node.ts
│   │   ├── group-by-item-node.ts
│   │   ├── group-by-node.ts
│   │   ├── having-node.ts
│   │   ├── identifier-node.ts
│   │   ├── insert-query-node.ts
│   │   ├── join-node.ts
│   │   ├── json-operator-chain-node.ts
│   │   ├── json-path-leg-node.ts
│   │   ├── json-path-node.ts
│   │   ├── json-reference-node.ts
│   │   ├── limit-node.ts
│   │   ├── list-node.ts
│   │   ├── matched-node.ts
│   │   ├── merge-query-node.ts
│   │   ├── modify-column-node.ts
│   │   ├── offset-node.ts
│   │   ├── on-conflict-node.ts
│   │   ├── on-duplicate-key-node.ts
│   │   ├── on-node.ts
│   │   ├── operation-node-source.ts
│   │   ├── operation-node-transformer.ts
│   │   ├── operation-node-visitor.ts
│   │   ├── operation-node.ts
│   │   ├── operator-node.ts
│   │   ├── or-action-node.ts
│   │   ├── or-node.ts
│   │   ├── order-by-item-node.ts
│   │   ├── order-by-node.ts
│   │   ├── output-node.ts
│   │   ├── over-node.ts
│   │   ├── parens-node.ts
│   │   ├── partition-by-item-node.ts
│   │   ├── partition-by-node.ts
│   │   ├── primary-key-constraint-node.ts
│   │   ├── primitive-value-list-node.ts
│   │   ├── query-node.ts
│   │   ├── raw-node.ts
│   │   ├── reference-node.ts
│   │   ├── references-node.ts
│   │   ├── refresh-materialized-view-node.ts
│   │   ├── rename-column-node.ts
│   │   ├── rename-constraint-node.ts
│   │   ├── returning-node.ts
│   │   ├── schemable-identifier-node.ts
│   │   ├── select-all-node.ts
│   │   ├── select-modifier-node.ts
│   │   ├── select-query-node.ts
│   │   ├── selection-node.ts
│   │   ├── set-operation-node.ts
│   │   ├── simple-reference-expression-node.ts
│   │   ├── table-node.ts
│   │   ├── top-node.ts
│   │   ├── tuple-node.ts
│   │   ├── unary-operation-node.ts
│   │   ├── unique-constraint-node.ts
│   │   ├── update-query-node.ts
│   │   ├── using-node.ts
│   │   ├── value-list-node.ts
│   │   ├── value-node.ts
│   │   ├── values-node.ts
│   │   ├── when-node.ts
│   │   ├── where-node.ts
│   │   └── with-node.ts
│   ├── parser/
│   │   ├── binary-operation-parser.ts
│   │   ├── coalesce-parser.ts
│   │   ├── collate-parser.ts
│   │   ├── data-type-parser.ts
│   │   ├── default-value-parser.ts
│   │   ├── delete-from-parser.ts
│   │   ├── expression-parser.ts
│   │   ├── fetch-parser.ts
│   │   ├── group-by-parser.ts
│   │   ├── identifier-parser.ts
│   │   ├── insert-values-parser.ts
│   │   ├── join-parser.ts
│   │   ├── merge-into-parser.ts
│   │   ├── merge-parser.ts
│   │   ├── on-commit-action-parse.ts
│   │   ├── on-modify-action-parser.ts
│   │   ├── order-by-parser.ts
│   │   ├── parse-utils.ts
│   │   ├── partition-by-parser.ts
│   │   ├── reference-parser.ts
│   │   ├── returning-parser.ts
│   │   ├── savepoint-parser.ts
│   │   ├── select-from-parser.ts
│   │   ├── select-parser.ts
│   │   ├── set-operation-parser.ts
│   │   ├── table-parser.ts
│   │   ├── top-parser.ts
│   │   ├── tuple-parser.ts
│   │   ├── unary-operation-parser.ts
│   │   ├── update-parser.ts
│   │   ├── update-set-parser.ts
│   │   ├── value-parser.ts
│   │   └── with-parser.ts
│   ├── plugin/
│   │   ├── camel-case/
│   │   │   ├── camel-case-plugin.ts
│   │   │   ├── camel-case-transformer.ts
│   │   │   └── camel-case.ts
│   │   ├── deduplicate-joins/
│   │   │   ├── deduplicate-joins-plugin.ts
│   │   │   └── deduplicate-joins-transformer.ts
│   │   ├── handle-empty-in-lists/
│   │   │   ├── handle-empty-in-lists-plugin.ts
│   │   │   ├── handle-empty-in-lists-transformer.ts
│   │   │   └── handle-empty-in-lists.ts
│   │   ├── immediate-value/
│   │   │   ├── immediate-value-plugin.ts
│   │   │   └── immediate-value-transformer.ts
│   │   ├── kysely-plugin.ts
│   │   ├── noop-plugin.ts
│   │   ├── parse-json-results/
│   │   │   └── parse-json-results-plugin.ts
│   │   └── with-schema/
│   │       ├── with-schema-plugin.ts
│   │       └── with-schema-transformer.ts
│   ├── query-builder/
│   │   ├── aggregate-function-builder.ts
│   │   ├── case-builder.ts
│   │   ├── cte-builder.ts
│   │   ├── delete-query-builder.ts
│   │   ├── delete-result.ts
│   │   ├── function-module.ts
│   │   ├── having-interface.ts
│   │   ├── insert-query-builder.ts
│   │   ├── insert-result.ts
│   │   ├── join-builder.ts
│   │   ├── json-path-builder.ts
│   │   ├── merge-query-builder.ts
│   │   ├── merge-result.ts
│   │   ├── no-result-error.ts
│   │   ├── on-conflict-builder.ts
│   │   ├── order-by-interface.ts
│   │   ├── order-by-item-builder.ts
│   │   ├── output-interface.ts
│   │   ├── over-builder.ts
│   │   ├── returning-interface.ts
│   │   ├── select-query-builder-expression.ts
│   │   ├── select-query-builder.ts
│   │   ├── update-query-builder.ts
│   │   ├── update-result.ts
│   │   └── where-interface.ts
│   ├── query-compiler/
│   │   ├── compiled-query.ts
│   │   ├── default-query-compiler.ts
│   │   └── query-compiler.ts
│   ├── query-creator.ts
│   ├── query-executor/
│   │   ├── default-query-executor.ts
│   │   ├── noop-query-executor.ts
│   │   ├── query-executor-base.ts
│   │   ├── query-executor-provider.ts
│   │   └── query-executor.ts
│   ├── raw-builder/
│   │   ├── raw-builder.ts
│   │   └── sql.ts
│   ├── schema/
│   │   ├── alter-column-builder.ts
│   │   ├── alter-table-add-foreign-key-constraint-builder.ts
│   │   ├── alter-table-add-index-builder.ts
│   │   ├── alter-table-builder.ts
│   │   ├── alter-table-drop-constraint-builder.ts
│   │   ├── alter-table-executor.ts
│   │   ├── check-constraint-builder.ts
│   │   ├── column-definition-builder.ts
│   │   ├── create-index-builder.ts
│   │   ├── create-schema-builder.ts
│   │   ├── create-table-builder.ts
│   │   ├── create-type-builder.ts
│   │   ├── create-view-builder.ts
│   │   ├── drop-index-builder.ts
│   │   ├── drop-schema-builder.ts
│   │   ├── drop-table-builder.ts
│   │   ├── drop-type-builder.ts
│   │   ├── drop-view-builder.ts
│   │   ├── foreign-key-constraint-builder.ts
│   │   ├── primary-key-constraint-builder.ts
│   │   ├── refresh-materialized-view-builder.ts
│   │   ├── schema.ts
│   │   └── unique-constraint-builder.ts
│   └── util/
│       ├── assert.ts
│       ├── column-type.ts
│       ├── compilable.ts
│       ├── deferred.ts
│       ├── explainable.ts
│       ├── infer-result.ts
│       ├── json-object-args.ts
│       ├── log-once.ts
│       ├── log.ts
│       ├── object-utils.ts
│       ├── performance-now.ts
│       ├── provide-controlled-connection.ts
│       ├── query-id.ts
│       ├── random-string.ts
│       ├── require-all-props.ts
│       ├── stack-trace-utils.ts
│       ├── streamable.ts
│       ├── type-error.ts
│       └── type-utils.ts
├── test/
│   ├── browser/
│   │   ├── index.html
│   │   ├── main.ts
│   │   └── test.js
│   ├── bun/
│   │   ├── bun.test.ts
│   │   ├── package.json
│   │   └── tsconfig.json
│   ├── cloudflare-workers/
│   │   ├── .dev.vars
│   │   ├── api.ts
│   │   ├── package.json
│   │   └── test.ts
│   ├── composite-ts/
│   │   ├── index.mts
│   │   ├── package.json
│   │   └── tsconfig.json
│   ├── deno/
│   │   ├── cdn.test.ts
│   │   ├── deno.json
│   │   └── local.test.ts
│   ├── node/
│   │   ├── src/
│   │   │   ├── aggregate-function.test.ts
│   │   │   ├── array.test.ts
│   │   │   ├── async-dispose.test.ts
│   │   │   ├── camel-case.test.ts
│   │   │   ├── case.test.ts
│   │   │   ├── clear.test.ts
│   │   │   ├── coalesce.test.ts
│   │   │   ├── controlled-transaction.test.ts
│   │   │   ├── deduplicate-joins.test.ts
│   │   │   ├── delete.test.ts
│   │   │   ├── disconnects.test.ts
│   │   │   ├── error-stack.test.ts
│   │   │   ├── execute.test.ts
│   │   │   ├── explain.test.ts
│   │   │   ├── expression.test.ts
│   │   │   ├── group-by.test.ts
│   │   │   ├── handle-empty-in-lists-plugin.test.ts
│   │   │   ├── having.test.ts
│   │   │   ├── immediate-value-plugin.test.ts
│   │   │   ├── insert.test.ts
│   │   │   ├── introspect.test.ts
│   │   │   ├── join.test.ts
│   │   │   ├── json-traversal.test.ts
│   │   │   ├── json.test.ts
│   │   │   ├── log-once.test.ts
│   │   │   ├── logging.test.ts
│   │   │   ├── merge.test.ts
│   │   │   ├── migration.test.ts
│   │   │   ├── object-util.test.ts
│   │   │   ├── order-by.test.ts
│   │   │   ├── parse-json-results-plugin.test.ts
│   │   │   ├── performance.test.ts
│   │   │   ├── query-id.test.ts
│   │   │   ├── raw-query.test.ts
│   │   │   ├── raw-sql.test.ts
│   │   │   ├── replace.test.ts
│   │   │   ├── sanitize-identifiers.test.ts
│   │   │   ├── schema.test.ts
│   │   │   ├── select.test.ts
│   │   │   ├── set-operation.test.ts
│   │   │   ├── sql-injection.test.ts
│   │   │   ├── stream.test.ts
│   │   │   ├── test-migrations/
│   │   │   │   ├── migration1.ts
│   │   │   │   └── migration2.ts
│   │   │   ├── test-setup.ts
│   │   │   ├── transaction.test.ts
│   │   │   ├── update.test.ts
│   │   │   ├── where.test.ts
│   │   │   ├── with-schema.test.ts
│   │   │   └── with.test.ts
│   │   └── tsconfig.json
│   ├── outdated-ts/
│   │   ├── outdated-ts.test.ts
│   │   ├── package.json
│   │   └── tsconfig.json
│   ├── scripts/
│   │   └── mysql-init.sql
│   ├── ts-benchmarks/
│   │   ├── index.ts
│   │   ├── order-by.bench.ts
│   │   ├── package.json
│   │   ├── select-from.bench.ts
│   │   └── tsconfig.json
│   └── typings/
│       ├── index.d.ts
│       ├── package.json
│       ├── shared.d.ts
│       └── test-d/
│           ├── aggregate-function.test-d.ts
│           ├── alter-table.test-d.ts
│           ├── assert-type.test-d.ts
│           ├── case.test-d.ts
│           ├── clear.test-d.ts
│           ├── coalesce.test-d.ts
│           ├── create-table.test-d.ts
│           ├── delete-query-builder.test-d.ts
│           ├── expression.test-d.ts
│           ├── generic-pre-5.4.test-d.ts
│           ├── generic.test-d.ts
│           ├── huge-db.test-d.ts
│           ├── if.test-d.ts
│           ├── index.test-d.ts
│           ├── infer-result.test-d.ts
│           ├── insert.test-d.ts
│           ├── join.test-d.ts
│           ├── json-traversal.test-d.ts
│           ├── kysely-any.test-d.ts
│           ├── merge.test-d.ts
│           ├── postgres-json.test-d.ts
│           ├── select-from.test-d.ts
│           ├── select-no-from.test-d.ts
│           ├── select.test-d.ts
│           ├── set-operation.test-d.ts
│           ├── update.test-d.ts
│           ├── where.test-d.ts
│           └── with.test-d.ts
├── tsconfig-base.json
├── tsconfig-cjs.json
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/bench.yml
================================================
name: bench

permissions:
  contents: read

on:
  push:
    branches:
      - master
    paths-ignore:
      - '.github/workflows/preview.yml'
      - 'assets/**'
      - 'docs/**'
      - 'example/**'
      - 'site/**'
      - '.gitignore'
      - '.node-version'
      - '.npmrc'
      - '.nvmrc'
      - '.prettierignore'
      - '.prettierrc.json'
      - '*.md'
      - 'deno*'
      - 'jsr*'
      - 'LICENSE'
      - 'outdated-typescript.d.ts'
  pull_request:
    paths-ignore:
      - '.github/workflows/preview.yml'
      - 'assets/**'
      - 'docs/**'
      - 'example/**'
      - 'site/**'
      - '.gitignore'
      - '.node-version'
      - '.npmrc'
      - '.nvmrc'
      - '.prettierignore'
      - '.prettierrc.json'
      - '*.md'
      - 'deno*'
      - 'jsr*'
      - 'LICENSE'
      - 'outdated-typescript.d.ts'
  workflow_dispatch:

jobs:
  typescript:
    name: TypeScript Benchmarks
    permissions:
      pull-requests: write
    runs-on: ubuntu-latest

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm install

      - name: Run benchmarks
        id: bench
        run: |
          # Run the benchmark command and capture its exit code
          pnpm bench:ts > /tmp/benchmark_output.txt 2>&1
          exit_code=$?

          # Process the output
          summary_output=$(cat /tmp/benchmark_output.txt | grep -v "> " | sed '/./,$!d')

          # Set a boolean output indicating if it failed with exit code 1
          if [ $exit_code -eq 1 ]; then
            echo "benchmark_failed=true" >> $GITHUB_OUTPUT
          else
            echo "benchmark_failed=false" >> $GITHUB_OUTPUT
          fi

          echo "full_summary<<EOF" >> $GITHUB_OUTPUT
          echo "$summary_output" >> $GITHUB_OUTPUT
          echo "EOF" >> $GITHUB_OUTPUT

      - name: Analyze Results
        id: analyze
        run: |
          full_summary="${{ steps.bench.outputs.full_summary }}"

          # This powerful awk script performs two actions:
          # 1. It finds blocks missing a Delta line and calculates it.
          # 2. It filters for all blocks where the final delta is not zero.
          changed_blocks=$(echo "$full_summary" | awk '
          BEGIN { RS="" } # Process the input in blocks separated by blank lines
          {
            block_text = $0 # Store the original block text
            is_changed = 0

            # If a block is missing a Delta line, calculate it
            if ($0 ~ /Baseline:/ && $0 !~ /Delta:/) {
              # Extract numeric values for Result and Baseline
              match($0, /Result: ([0-9.]+)/, r)
              match($0, /Baseline: ([0-9.]+)/, b)
              
              result_val = r[1]
              baseline_val = b[1]
              
              # Calculate the delta, avoiding division by zero
              if (baseline_val > 0) {
                delta = ((result_val / baseline_val) - 1) * 100
                # Append the newly calculated, formatted Delta line to the block
                block_text = sprintf("%s\n📊 Delta: %+.2f%%", block_text, delta)
              }
            }
            
            # Now, check the (potentially modified) block for a non-zero delta.
            # This works for both pre-existing deltas and the ones we just calculated.
            if (block_text ~ /Delta:/ && block_text !~ /Delta: (\+)?0\.00%/) {
              # Filter out any summary lines that are not part of a benchmark block
              if (block_text ~ /🏌️/) {
                print block_text "\n" # Print the complete, changed block
              }
            }
          }')

          if [ -n "$changed_blocks" ]; then
            echo "has_changes=true" >> $GITHUB_OUTPUT
            echo "changed_blocks<<EOF" >> $GITHUB_OUTPUT
            echo "$changed_blocks" >> $GITHUB_OUTPUT
            echo "EOF" >> $GITHUB_OUTPUT
          else
            echo "has_changes=false" >> $GITHUB_OUTPUT
          fi

      - name: PR Comment on Changes
        if: steps.analyze.outputs.has_changes == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
        uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
        with:
          comment-tag: typescript-benchmarks
          message: |
            <details>
            <summary>⏱️ <strong>Benchmark changes detected</strong> following ${{ github.event.pull_request.head.sha }}</summary>

            The following benchmarks have changed from the baseline:
            ```
            ${{ steps.analyze.outputs.changed_blocks }}
            ```
            </details>

      - name: PR Comment on No Changes
        if: steps.analyze.outputs.has_changes == 'false' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
        uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
        with:
          comment-tag: typescript-benchmarks
          message: ✅ ⏱️ **No benchmark changes detected** following ${{ github.event.pull_request.head.sha }}.

      - name: Fail job if benchmark command failed
        if: steps.bench.outputs.benchmark_failed == 'true'
        run: |
          echo "Benchmark command failed with exit code 1"
          exit 1


================================================
FILE: .github/workflows/compare.yml
================================================
name: compare llms-full.txt

permissions:
  contents: read

on:
  pull_request:
    paths:
      - '.github/workflows/compare.yml'
      - 'site/**'
  workflow_dispatch:

jobs:
  build-current:
    name: Build current branch
    runs-on: ubuntu-latest
    outputs:
      artifact-name: current-llms-full-txt

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm install

      - name: Build
        working-directory: site
        run: pnpm build

      - name: Upload current build artifact
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
        with:
          name: current-llms-full-txt
          path: site/build/llms-full.txt

  build-target:
    name: Build target branch
    runs-on: ubuntu-latest
    outputs:
      artifact-name: target-llms-full-txt

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm install

      - name: Checkout target branch and build
        run: |
          TARGET_BRANCH=${{ github.event.pull_request.base.ref || 'master' }}
          git fetch origin $TARGET_BRANCH:$TARGET_BRANCH
          git checkout $TARGET_BRANCH
          pnpm install
          cd site && pnpm build

      - name: Upload target build artifact
        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
        with:
          name: target-llms-full-txt
          path: site/build/llms-full.txt

  diff:
    name: Diff current branch vs. target branch
    runs-on: ubuntu-latest
    needs: [build-current, build-target]

    steps:
      - name: Download current build
        uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: current-llms-full-txt
          path: current/

      - name: Download target build
        uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: target-llms-full-txt
          path: target/

      - name: Diff current vs. target
        uses: LouisBrunner/diff-action@9ea7b75986aa27143ad4928974c98a5a1bd92170 # v2.2.0
        with:
          mode: addition
          new: current/llms-full.txt
          old: target/llms-full.txt
          output: diff-llms-full.txt
          tolerance: mixed


================================================
FILE: .github/workflows/preview.yml
================================================
name: preview

permissions:
  contents: read

on:
  push:
    branches:
      - master
  pull_request:
    paths:
      - '**/*'
      - '!.github/workflows/*.yml'
      - '.github/workflows/preview.yml'
      - '!assets/**'
      - '!docs/**'
      - '!example/**'
      - '!site/**'
      - '!test/**'
      - '!.node-version'
      - '!.nvmrc'
      - '!.prettierignore'
      - '!.prettierrc.json'
      - '!*.md'
      - '!deno.check*'
      - '!deno.lint.json'
      - '!docker-compose.yml'
      - '!jsr.json'
      - '!LICENSE'

jobs:
  release:
    name: Release preview build
    runs-on: ubuntu-latest

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm install

      - name: Build
        run: pnpm build

      - name: Release preview version
        run: pnpx pkg-pr-new@0.0.61 publish --template './example'


================================================
FILE: .github/workflows/publish.yml
================================================
# https://docs.npmjs.com/trusted-publishers#github-actions-configuration
name: publish

on:
  push:
    tags:
      - 'v*'

permissions:
  contents: read
  id-token: write # Required for OIDC

jobs:
  npm:
    if: github.repository == 'kysely-org/kysely'
    environment: release
    runs-on: ubuntu-latest

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          fetch-depth: 0 # Need full history to check branch ancestry

      - name: verify tag format and branch
        run: |
          # Validate ref_name format before assignment
          if [[ ! "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
            echo "Error: tag does not follow semver!"
            exit 1
          fi

          TAG="${{ github.ref_name }}"

          # Check if tag points to a commit that exists on master branch
          TAG_COMMIT=$(git rev-list -n 1 "$TAG")
          if ! git merge-base --is-ancestor "$TAG_COMMIT" origin/master; then
            echo "Error: tag is not based on master branch"
            exit 1
          fi

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: pnpm
          node-version: lts/*
          registry-url: https://registry.npmjs.org/

      - name: verify package version
        run: |
          TAG="${{ github.ref_name }}"
          VERSION="${TAG#v}"

          # Get version from package.json safely (parse as JSON, don't execute)
          PACKAGE_VERSION=$(node -p "JSON.parse(require('node:fs').readFileSync('./package.json', 'utf8')).version")

          # Validate version format: must be MAJOR.MINOR.PATCH
          if [[ ! "$PACKAGE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
            echo "Error: package.json version does not follow semver!"
            exit 1
          fi

          # Verify versions match
          if [[ "$VERSION" != "$PACKAGE_VERSION" ]]; then
            echo "Error: tag and package.json version don't match!"
            exit 1
          fi

      - name: Install dependencies
        run: npm i -g npm@^11.5.2 && pnpm i --frozen-lockfile --prefer-offline

      - name: Publish
        run: pnpm publish --no-git-checks # the workflow runs in a detached head state, so git checks fail

  jsr:
    needs: npm
    environment: release
    runs-on: ubuntu-latest

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm i

      - name: Prepare for publish
        run: pnpm script:remove-global-augmentations

      - name: publish
        run: pnpm jsr publish --allow-dirty


================================================
FILE: .github/workflows/test.yml
================================================
name: test

permissions:
  contents: read

on:
  push:
    branches:
      - master
    paths:
      - '**/*'
      - '!.github/workflows/*.yml'
      - '.github/workflows/test.yml'
      - '!assets/**'
      - '!docs/**'
      - '!example/**'
      - '!site/**'
      - '!.node-version'
      - '!.nvmrc'
      - '!.prettierignore'
      - '!.prettierrc.json'
      - '!*.md'
      - '!LICENSE'
  pull_request:
    paths:
      - '**/*'
      - '!.github/workflows/*.yml'
      - '.github/workflows/test.yml'
      - '!assets/**'
      - '!docs/**'
      - '!example/**'
      - '!site/**'
      - '!.node-version'
      - '!.nvmrc'
      - '!.prettierignore'
      - '!.prettierrc.json'
      - '!*.md'
      - '!LICENSE'
  workflow_dispatch:

jobs:
  node:
    strategy:
      fail-fast: false
      matrix:
        # https://endoflife.date/nodejs
        node-version: [20.x, 22.x, 24.x, 25.x]
        with-transformer: [false, true]
    runs-on: ubuntu-latest

    name: Node.js (${{ matrix.node-version }})${{ matrix.with-transformer && ' /w transformer' || '' }}

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: ${{ matrix.node-version }}

      - name: Install dependencies
        run: pnpm install

      - name: Run docker compose
        run: docker compose up -d

      - name: Run node tests
        run: ${{ matrix.with-transformer && 'TEST_TRANSFORMER=1 ' || '' }}pnpm test

      - name: Run esbuild test
        if: ${{ !matrix.with-transformer }}
        run: pnpm test:esbuild

  deno:
    name: Deno
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        # https://endoflife.date/deno
        deno-version: [2.5.x]

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Use Deno ${{ matrix.deno-version }}
        uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3
        with:
          deno-version: ${{ matrix.deno-version }}

      - name: Install dependencies
        run: pnpm install

      - name: Run docker compose
        run: docker compose up -d

      - name: Build
        run: pnpm build

      - name: Run deno tests
        run: pnpm test:deno

      - name: Lint for Deno/JSR
        run: pnpm lint:deno

  bun:
    name: Bun
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        bun-version: [1.1.44, 1.2.23, 1.3]

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm install

      - name: Use Bun ${{ matrix.bun-version }}
        uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
        with:
          bun-version: ${{ matrix.bun-version }}

      - name: Run docker compose
        run: docker compose up -d

      - name: Run bun tests
        run: pnpm test:bun

  browser:
    name: Browser
    runs-on: ubuntu-latest

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm install

      - name: Install playwright
        run: pnpm playwright install chromium

      - name: Run browser tests
        run: pnpm test:browser

  cloudflare-workers:
    name: Cloudflare Workers
    runs-on: ubuntu-latest

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm install

      - name: Run docker compose
        run: docker compose up -d

      - name: Run cloudflare workers test
        run: pnpm test:cloudflare-workers

  older-typescript-version:
    name: Older TypeScript version
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        typescript-version: [
            ~4.6.0, # 28.2.2022 https://devblogs.microsoft.com/typescript/announcing-typescript-4-6/
            ~4.7.0, # 24.5.2022 https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/
            ~4.8.0, # 25.8.2022 https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/
            ~4.9.0, # 15.11.2022 https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/
            ~5.0.0, # 16.3.2023 https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/
            ~5.2.0, # 24.8.2023 https://devblogs.microsoft.com/typescript/announcing-typescript-5-1/ https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/
            ~5.3.0, # 20.11.2023 https://devblogs.microsoft.com/typescript/announcing-typescript-5-3/
            ~5.4.0, # 6.3.2024 https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/
            ~5.8.0, # 28.2.2025 https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/ https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/ https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/ https://devblogs.microsoft.com/typescript/announcing-typescript-5-8/
            # ~5.9.0, # 1.8.2025 https://devblogs.microsoft.com/typescript/announcing-typescript-5-9/
          ]

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm install

      - name: Run build with newer TypeScript
        run: pnpm build

      - name: Set TypeScript and TSD versions
        run: |
          TS_VERSION="${{ matrix.typescript-version }}"
          echo "TS_VERSION=$TS_VERSION" >> $GITHUB_ENV
          TSD_VERSION=$(echo '{"~4.6.0":"0.20.0", "~4.7.0":"0.22.0", "~4.8.0":"0.24.1", "~4.9.0":"0.27.0", "~5.0.0":"0.28.1", "~5.2.0":"0.29.0", "~5.3.0":"0.30.7", "~5.4.0":"0.31.2", "~5.8.0":"0.32.0", "~5.9.0":"0.33.0"}' | jq -r --arg key "$TS_VERSION" '.[$key]')
          echo "TSD_VERSION=$TSD_VERSION" >> $GITHUB_ENV

      - name: Install Typescript (${{ env.TS_VERSION }}) and TSD (${{ env.TSD_VERSION }})
        run: pnpm i -D typescript@${{ env.TS_VERSION }} tsd@${{ env.TSD_VERSION }}

      - name: Exclude non-backward compatible tests
        run: pnpm script:exclude-test-files-for-backwards-compat

      - name: Run tests with older TypeScript version
        run: pnpm test:typings${{ env.TS_VERSION != '~4.6.0' && env.TS_VERSION != '~4.7.0' && ' && pnpm test:node:build' || '' }}

  jsdocs:
    name: JSDocs
    runs-on: ubuntu-latest

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Use Deno
        uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3
        with:
          deno-version: 2.x

      - name: Install dependencies
        run: pnpm install

      - name: Build
        run: pnpm build

      - name: Type-check JSDocs code blocks
        run: pnpm test:jsdocs

  typescript-native:
    name: TypeScript Native
    runs-on: ubuntu-latest

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm i

      - name: Build
        run: pnpm build

      - name: Run TypeScript Native tests
        run: pnpx @typescript/native-preview --project ./test/node/tsconfig.json

  typescript-composite:
    name: TypeScript Composite
    runs-on: ubuntu-latest

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm i

      - name: Test
        working-directory: test/composite-ts
        run: npm i && npm run check:types

  jsr:
    name: JSR
    runs-on: ubuntu-latest

    steps:
      - name: Harden Runner
        uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
        with:
          egress-policy: audit

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0

      - name: Use Node.js
        uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
        with:
          cache: 'pnpm'
          node-version: lts/*

      - name: Install dependencies
        run: pnpm i

      - name: Prepare for publish
        run: pnpm script:remove-global-augmentations

      - name: Dry-run jsr publish
        run: pnpm jsr publish --allow-dirty --dry-run


================================================
FILE: .gitignore
================================================
dist
/helpers
/test/browser/bundle.js
node_modules
.vscode
.idea
tsconfig.tsbuildinfo


================================================
FILE: .mocharc.js
================================================
const { isCI } = require('std-env')

module.exports = {
  forbidOnly: isCI,
}


================================================
FILE: .node-version
================================================
22


================================================
FILE: .npmrc
================================================
# so we don't have to `-w` anytime we bump root workspace dependencies.
ignore-workspace-root-check=true


================================================
FILE: .nvmrc
================================================
lts/*


================================================
FILE: .prettierignore
================================================
*.md

================================================
FILE: .prettierrc.json
================================================
{
  "semi": false,
  "singleQuote": true,
  "trailingComma": "all"
}


================================================
FILE: CODE_OF_CONDUCT.md
================================================
# ~~Contributor Covenant Code of Conduct~~ Kysely Code of Conduct

## Our Pledge

~~We as members, contributors, and leaders pledge to make participation in our~~
~~community a harassment-free experience for everyone, regardless of age, body~~
~~size, visible or invisible disability, ethnicity, sex characteristics, gender~~
~~identity and expression, level of experience, education, socio-economic status,~~
~~nationality, personal appearance, race, religion, or sexual identity~~
~~and orientation.~~

~~We pledge to act and interact in ways that contribute to an open, welcoming,~~
~~diverse, inclusive, and healthy community.~~

Don't be an asshole.
You are not entitled to other people's time, energy, or attention.

That's it. That's the pledge.

## Our Standards

~~Examples of behavior that contributes to a positive environment for our~~
~~community include:~~

~~* Demonstrating empathy and kindness toward other people~~
~~* Being respectful of differing opinions, viewpoints, and experiences~~
~~* Giving and gracefully accepting constructive feedback~~
~~* Accepting responsibility and apologizing to those affected by our mistakes,~~
  ~~and learning from the experience~~
~~* Focusing on what is best not just for us as individuals, but for the~~
  ~~overall community~~

~~Examples of unacceptable behavior include:~~

~~* The use of sexualized language or imagery, and sexual attention or~~
  ~~advances of any kind~~
~~* Trolling, insulting or derogatory comments, and personal or political attacks~~
~~* Public or private harassment~~
~~* Publishing others' private information, such as a physical or email~~
  ~~address, without their explicit permission~~
~~* Other conduct which could reasonably be considered inappropriate in a~~
  ~~professional setting~~

Don't be an asshole.
You are not entitled to other people's time, energy, or attention.

Examples of being an asshole or entitled include:

* Probably not the best idea to come in complaining and not having minimal respect to develop some basic sentences.
  > what is the migration_lock ?? why we have this in the database - https://github.com/kysely-org/kysely/issues/973
* Probably not the best idea to attack the maintainer after he answered succinctly (out of character) for whatever reason (context switch? busy?).
  > You got any more of them there examples buster? - https://github.com/kysely-org/kysely/issues/677#issuecomment-2019876074
* Probably not the best idea to come in all yelling and demanding stuff.
  > NO documentation about error handling!!!!
  > I am really confused that the docs doesnt have anything about error handling
  > this is a mandataory things to add!! - https://github.com/kysely-org/kysely/issues/1217
* Probably not the best idea to tone police the maintainer after he spent time explaining library philosophy, and to publicly refuse to contribute something you demanded.
  > I'm sorry fella but with your tone I really don't feel like it. Good luck - https://github.com/kysely-org/kysely/issues/709#issuecomment-1727617260
* Probably not the best idea to question the maintainer's decisions after properly answering your question, and to be entitled for JavaScript skill issue help after the issue is closed.
  > I don't understand your answer and closing the issue. - https://github.com/kysely-org/kysely/issues/527#issuecomment-1577383794
* Probably not the best idea to jump into closed issues and be entitled to other people's efforts.
  > why on earth there is no mention of this in the documentation? - https://github.com/kysely-org/kysely/issues/649#issuecomment-2430854835
* Probably not the best idea to not search existing issues, and then ask the maintainer to spend time doing it.
  > could you please provide numbers of duplicated issues to explore the topic? - https://github.com/kysely-org/kysely/issues/762#issuecomment-1801951960
* Probably not the best idea to sarcastically suggest the maintainer is not helpful while using his hard work for free.
  > Most helpful man in the world - https://github.com/kysely-org/kysely/issues/762#issuecomment-2404599281
* Probably not the best idea to side with the asshole/entitled by upvoting them or downvoting us.

  ![image](https://github.com/user-attachments/assets/ca6efd57-d8db-428a-a274-7b45b380887f)
  ![image](https://github.com/user-attachments/assets/62356fa3-7cea-4b82-9967-d56c76f0beee)



## Enforcement Responsibilities

~~Community leaders are responsible for clarifying and enforcing our standards of~~
~~acceptable behavior and will take appropriate and fair corrective action in~~
~~response to any behavior that they deem inappropriate, threatening, offensive,~~
~~or harmful.~~

~~Community leaders have the right and responsibility to remove, edit, or reject~~
~~comments, commits, code, wiki edits, issues, and other contributions that are~~
~~not aligned to this Code of Conduct, and will communicate reasons for moderation~~
~~decisions when appropriate.~~

We are here in our free time. We are not getting paid to serve and please you.

We will not tolerate assholes or entitled behavior.

We are capable of banning you from the GitHub organization, Discord server, or any 
other community space we manage. Don't make us do it.

## Scope

~~This Code of Conduct applies within all community spaces, and also applies when~~
~~an individual is officially representing the community in public spaces.~~
~~Examples of representing our community include using an official e-mail address,~~
~~posting via an official social media account, or acting as an appointed~~
~~representative at an online or offline event.~~

Relevant to all repositories in the Kysely GitHub organization, the Kysely Discord 
server, and any other community space managed by Kysely.

## Enforcement

~~Instances of abusive, harassing, or otherwise unacceptable behavior may be~~
~~reported to the community leaders responsible for enforcement at~~
~~Kysely's GitHub repositories and Discord server.~~
~~All complaints will be reviewed and investigated promptly and fairly.~~

~~All community leaders are obligated to respect the privacy and security of the~~
~~reporter of any incident.~~

Report to us anyone who is being an asshole or entitled.
We will take appropriate action if necessary.

## Enforcement Guidelines

~~Community leaders will follow these Community Impact Guidelines in determining~~
~~the consequences for any action they deem in violation of this Code of Conduct:~~

We might do these things:

~~### 1. Correction~~

**Community Impact**: ~~Use of inappropriate language or other behavior deemed~~
~~unprofessional or unwelcome in the community.~~

Someone being an asshole or entitled.

**Consequence**: ~~A private, written warning from community leaders, providing~~
~~clarity around the nature of the violation and an explanation of why the~~
~~behavior was inappropriate. A public apology may be requested.~~

We might return the favor (we're not perfect), ignore you, edit/close/lock/delete 
your post/comment, or ban you. There is no strike system.

~~### 2. Warning~~

~~**Community Impact**: A violation through a single incident or series~~
~~of actions.~~

~~**Consequence**: A warning with consequences for continued behavior. No~~
~~interaction with the people involved, including unsolicited interaction with~~
~~those enforcing the Code of Conduct, for a specified period of time. This~~
~~includes avoiding interactions in community spaces as well as external channels~~
~~like social media. Violating these terms may lead to a temporary or~~
~~permanent ban.~~

~~### 3. Temporary Ban~~

~~**Community Impact**: A serious violation of community standards, including~~
~~sustained inappropriate behavior.~~

~~**Consequence**: A temporary ban from any sort of interaction or public~~
~~communication with the community for a specified period of time. No public or~~
~~private interaction with the people involved, including unsolicited interaction~~
~~with those enforcing the Code of Conduct, is allowed during this period.~~
~~Violating these terms may lead to a permanent ban.~~

~~### 4. Permanent Ban~~

~~**Community Impact**: Demonstrating a pattern of violation of community~~
~~standards, including sustained inappropriate behavior,  harassment of an~~
~~individual, or aggression toward or disparagement of classes of individuals.~~

~~**Consequence**: A permanent ban from any sort of public interaction within~~
~~the community.~~

## ~~Attribution~~

~~This Code of Conduct is adapted from the [Contributor Covenant][homepage],~~
~~version 2.0, available at~~
~~https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.~~

~~Community Impact Guidelines were inspired by [Mozilla's code of conduct~~
~~enforcement ladder](https://github.com/mozilla/diversity).~~

~~[homepage]: https://www.contributor-covenant.org~~

~~For answers to common questions about this code of conduct, see the FAQ at~~
~~https://www.contributor-covenant.org/faq. Translations are available at~~
~~https://www.contributor-covenant.org/translations.~~


================================================
FILE: CONTRIBUTING.md
================================================
# Contribution Guidelines

Wanna contribute to Kysely or other libraries within the [kysely-org](https://github.com/kysely-org) organization?

You're awesome! 🤗

## 😕 How Can I Contribute?

## 📢 By Spreading the Word

If you like what we're building here, please: 

1. Tell your friends, co-workers, family, neighbors, followers, agent markdowns, etc.
1. Speak about it in meetups and conferences. (if you need help with the presentation, please ask on Discord!).

There is no company behind this organization and project. We do this in our free time and cannot advertise it
all by ourselves. Companies have dedicated devrel teams doing all that work, other projects might have community
managers or full-time developers with the capacity to also handle social media and meetups with higher frequency.

More people using Kysely eventually means:

1. less bugs left unreported and unsolved.
1. high chance people share workarounds.
1. more data points for innovation.
1. more people who might contribute and push this thing even further.
1. it becomes a standard part of the Node.js/Bun/Deno developer's toolbox so you'll happily stumble upon it
   in future codebases you'll join, or it'll be easier to get buy-in from co-workers/leadership.

## 🤝 By Helping People in Issues or on Discord

We need all the help we can get with supporting the community, answering questions, triaging! 

If you've been using the library for a while, or know a thing or two about SQL, and specific databases, don't 
be shy about it!

## 🐛 By Submitting Issues (Bugs, Enhancement Ideas, Questions) or Opening threads on Discord

Please use search and make sure an existing **open** issue or thread doesn't exist before submitting. If an existing
issue is only somewhat relevant, please submit a new issue and reference the old one instead of commenting
on the existing one. Let us label your new issue as `duplicate` if it is the same thing - it's fine! If it's not 
the same thing and you commented on another issue, it makes it harder to track on our end.

If possible/relevant, please provide a [playground link](https://kyse.link), Stackblitz OR a public git repository that 
reproduces the issue.

Please provide the exact error/warning texts you're getting. "this doesn't work" or "this throws an error"
are not helping us help you.

Don't be an asshole. Don't demand support/service from us.

## ⌨️ With Code!

### 📘 Documentation Code Contributions

Pull requests are always welcome! 

The [kysely.dev](https://kysely.dev) application is located @ [/site](https://github.com/kysely-org/kysely/tree/master/site).

It is a pretty standard [docusaurus](https://docusaurus.io/) application.

The code examples are extracted, using a custom script (see `"script:generate-site-examples"` @ [package.json](https://github.com/kysely-org/kysely/blob/master/package.json)), 
and custom annotations, from [JSDocs](https://jsdoc.app/) comments in the source code @ [/src](https://github.com/kysely-org/kysely/tree/master/src).
If you need to change an existing code example, please do so in the source code AND then run the script.
_TODO: explain how to add a new code example._

If it is a big change (lots of lines of code OR files involved), please get a conversation going on an issue or on 
Discord before starting work on it.

### 🧙 Implementation Code Contributions (Bugfixes, Enhancements [Existing or New Features])

Pull requests (PRs) are welcome, BUT since:

1. Our time and capacity as maintainers are limited.
1. Your time is limited.
1. Your motivation and morale is important to us.
1. Onboarding in a new highly opinionated open-source project can be challenging.

We need a process in place:

1. To make sure only things that have a good chance of being accepted are worked on. We hate saying "no".
1. To make sure that things that are being worked on don't result in too much back-and-forth between authors and maintainers.
   We hate seeing these things drag on for a long time, and we know how frustrating it is on your end.
1. To make sure there's no pressure on you when you take on a task.
1. To make sure there's a clear understanding of who is working on what to avoid redundancies and conflicts.

#### The Process

Here is the gist of it:

1. If an issue on the subject **doesn't exist** yet, **submit** one. If you want to work on it, **ask** to be **assigned**
   to it in the issue **description**, in the **comments**, OR on **Discord**.
1. If an issue on the subject **exists** and is labeled with `bug` OR (`enhancement` AND `greenlit`\* OR even `good first issue`\**):
   1. If there is a pull request (**PR**) **linked** to it:
      1. If the **PR** is **stale** (a few months without new commits or comments from the PR author OR Kysely maintainers),
         **ask** to be **assigned** to it and continue work on the PR.
      1. If the **PR** is **not stale**, you can still offer some review comments, or **ask** to **pair** up with the PR author.
   1. If there is **no PR linked** to it and a person is **already assigned** to it:
      1. If the assignment is stale (a few weeks without a PR opened after the person was assigned to the issue), ask
         to be assigned to the issue in the comments OR on Discord.
      1. If the assignment is not stale, it's OK to ask the assignee if they'll be willing to pair up.
   1. If there is no PR linked to it and no assignee, ask to be assigned to it in the comments OR on Discord.
   
_\* an issue that was reviewed by the maintainers and would be nice to get a pull request for from the community._

_\** an issue that was reviewed by the maintainers and would be a nice opportunity to onboard an open-source newbie
  into the codebase._

Once you're assigned to an issue, you can start working on your code changes. It's best to ask questions
in the issue or on Discord as early as possible, and even share your progress with the maintainers and community via a 
draft (WIP) pull request.

We will close surprise pull requests that are not related to an existing issue or the pull request submitter is not
assigned to the issue.

We will close pull requests where the changes are too far from acceptable. Such cases are a waste of time for us to
even begin to comment on. You can ask for quick informal feedback on Discord in such cases and submit another pull
request with better changes later.

#### Style/Design Philosophy

* Kysely should have zero dependencies.

* Kysely should work in all JavaScript environments (node.js, deno & modern browsers), 
even though the main focus is node.js.

* Everything is immutable.

* The API should be as close to writing raw SQL as possible while still providing 
type safety.

* Everything outside of dialect implementations is dialect-agnostic.

* Everything is tested.

    * Functionality - No mocks. Everything is tested against real database instances.
    No partial testing. If a sql "thing" is supported by some databases, test it
    against all of them.

    * Types - We're a type-safe package, you get the idea.

* Everything consumer-facing should be documented.

* Everything is type-safe. Things that cannot be implemented in a way that is safe 
for all cases, are best left for consumers to implement.

* Most features should have escape hatches.

* Less is more.

#### Getting Started

1. fork kysely.

1. clone your fork.

1. install Node.js (preferably the latest even-numbered version). we recommend using [`fnm`](https://github.com/Schniz/fnm) for managing Node.js versions.

1. install `corepack` by running `npm i -g corepack` in your terminal.

1. run `corepack enable` in your terminal.

1. `cd` into the repository.

1. run `corepack install` in your terminal to install the exact package manager and version used in this project.

1. run `pnpm i` in your terminal to install dependencies. if `pnpm` tells you it ignored a `postinstall` script from some package - tells us immediately via issue or Discord - this is a security concern!

1. create a branch (we don't care about naming).

1. create a draft pull request. link the relevant issue by referring to it in the 
PR's description. E.g. `closes #123` will link the PR to issue/pull request #123.

1. implement your changes.

#### Testing

1. write functionality tests @ [/test/node](https://github.com/kysely-org/kysely/tree/master/test/node).

1. write typings tests @ [/test/typings](https://github.com/kysely-org/kysely/tree/master/test/typings)

1. install Docker.

1. run `docker compose up -d` in your terminal to spin up database instances.

1. run `pnpm test` in your terminal.


================================================
FILE: FUNDING.md
================================================
# Funding

Kysely is an MIT-licensed open-source project and is completely free to use - and will remain so.

Kysely is a labor of love. We do this in our free time.

We do not accept donations.

- Getting paid for open-source won't make us put more time and effort into open-source.
  We have family, friends, and other hobbies and interests.

- We work in the tech industry, full-time, as software developers. We are comfortable as-is.

- We don't believe in freelance open-source as a stable source of income for the long term.
  We have mouths to feed, and careers to maintain.

- Sponsored projects tend to be affected by big sponsors. We want to keep Kysely away
  from companies' and VCs' opinions and business needs.

- Kysely is escapism for us. We don't want it to feel like another job.


Instead of donating to us, we encourage you to support meaningful causes or other open-source projects in need of funding.

Thank you for supporting Kysely through your usage, contributions, and feedback.


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2022 Sami Koskimäki

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua)

[![NPM Version](https://img.shields.io/npm/v/kysely?style=flat&label=latest)](https://github.com/kysely-org/kysely/releases/latest)
[![Tests](https://github.com/kysely-org/kysely/actions/workflows/test.yml/badge.svg)](https://github.com/kysely-org/kysely)
[![License](https://img.shields.io/github/license/kysely-org/kysely?style=flat)](https://github.com/kysely-org/kysely/blob/master/LICENSE)
[![Issues](https://img.shields.io/github/issues-closed/kysely-org/kysely?logo=github)](https://github.com/kysely-org/kysely/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
[![Pull Requests](https://img.shields.io/github/issues-pr-closed/kysely-org/kysely?label=PRs&logo=github&style=flat)](https://github.com/kysely-org/kysely/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc)
![GitHub contributors](https://img.shields.io/github/contributors/kysely-org/kysely)
[![NPM Downloads](https://img.shields.io/npm/dw/kysely?logo=npm)](https://www.npmjs.com/package/kysely)
[![JSR Downloads](https://jsr.io/badges/@kysely/kysely/weekly-downloads)](https://jsr.io/@kysely/kysely)
[![JSR Score](https://jsr.io/badges/@kysely/kysely/score)](https://jsr.io/@kysely/kysely)

###### Join the discussion ⠀⠀⠀⠀⠀⠀⠀ 
[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=flat&logo=discord&logoColor=white)](https://discord.gg/xyBJ3GwvAm)
[![Bluesky](https://img.shields.io/badge/Bluesky-0285FF?style=flat&logo=Bluesky&logoColor=white)](https://bsky.app/profile/kysely.dev)

###### Get started
[![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=flat&logo=postgresql&logoColor=white)](https://kysely.dev/docs/getting-started?dialect=postgresql)
[![MySQL](https://img.shields.io/badge/mysql-4479A1.svg?style=flat&logo=mysql&logoColor=white)](https://kysely.dev/docs/getting-started?dialect=mysql)
[![MicrosoftSQLServer](https://img.shields.io/badge/Microsoft%20SQL%20Server-CC2927?style=flat&logo=microsoft%20sql%20server&logoColor=white)](https://kysely.dev/docs/getting-started?dialect=mssql)
[![SQLite](https://img.shields.io/badge/sqlite-%2307405e.svg?style=flat&logo=sqlite&logoColor=white)](https://kysely.dev/docs/getting-started?dialect=sqlite)
& more!

# [Kysely](https://kysely.dev)

Kysely (pronounce “Key-Seh-Lee”) is a type-safe and autocompletion-friendly [TypeScript](https://www.typescriptlang.org/) [SQL](https://en.wikipedia.org/wiki/SQL) query builder.
Inspired by [Knex.js](http://knexjs.org/). Mainly developed for [Node.js](https://nodejs.org/en/) but also
runs on all other [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) environments like [Deno](https://deno.com/), [Bun](https://bun.sh/), [Cloudflare Workers](https://workers.cloudflare.com/)
and web browsers.

![](https://github.com/kysely-org/kysely/blob/master/assets/demo.gif)

Kysely makes sure you only refer to tables and columns that are visible to the part of the query
you're writing. The result type only has the selected columns with correct types and aliases. As an
added bonus you get autocompletion for all that stuff.

As shown in the gif above, through the pure magic of modern TypeScript, Kysely is even able to parse
the alias given to `pet.name` and add the `pet_name` column to the result row type. Kysely is able to infer
column names, aliases and types from selected subqueries, joined subqueries, `with` statements and pretty
much anything you can think of.

Of course there are cases where things cannot be typed at compile time, and Kysely offers escape
hatches for these situations. See the [sql template tag](https://kysely-org.github.io/kysely-apidoc/interfaces/Sql.html)
and the [DynamicModule](https://kysely-org.github.io/kysely-apidoc/classes/DynamicModule.html#ref) for more info.

All API documentation is written in the typing files and you can simply hover over the module, class
or method you're using to see it in your IDE. The same documentation is also hosted [here](https://kysely-org.github.io/kysely-apidoc/).

If you start using Kysely and can't find something you'd want to use, please open an issue or join our
[Discord server](https://discord.gg/xyBJ3GwvAm).

# Getting started

Please visit our documentation site [kysely.dev](https://kysely.dev) to get started. We also have a comprehensive
API documentation hosted [here](https://kysely-org.github.io/kysely-apidoc/), but you can access the same
documentation in your IDE by hovering over a class/method/property/whatever.

# Core team

## Project leads

Responsible for project direction, API design, maintenance, code reviews, community support, documentation, and working on some of the most 
impactful/challenging things.

<table>
    <tbody>
        <tr>
            <td align="center">
                <a href="https://github.com/koskimas">
                    <img src="https://avatars.githubusercontent.com/u/846508?v=4?s=100" width="100px;" alt=""/>
                    <br />
                    Sami Koskimäki
                </a>
                <br />
                (the <a href="https://web.archive.org/web/20211203210043/https://www.jakso.me/blog/kysely-a-type-safe-sql-query-builder-for-typescript">author</a>)
            </td>
            <td align="center">
                <a href="https://github.com/igalklebanov">
                    <img src="https://avatars.githubusercontent.com/u/14938291?v=4&s=100" width="100px;" alt=""/>
                    <br />
                    Igal Klebanov
                </a>
                <br />
                (the <a href="https://github.com/kysely-org/kysely/pull/1414#issuecomment-2781281996">dynamo</a>)
            </td>
        </tr>
    </tbody>
</table>

## Honorable mentions

People who had special impact on the project and its growth.

<table>
    <tbody>
        <tr>
            <td align="center">
                <a href="https://github.com/fhur">
                    <img src="https://avatars.githubusercontent.com/u/6452323?v=4&s=100" width="100px;" alt=""/>
                    <br />
                    Fernando Hurtado
                </a>
                <br />
                (1st <a href="https://kysely.dev">docs</a>)
            </td>
            <td align="center">
                <a href="https://github.com/wirekang">
                    <img src="https://avatars.githubusercontent.com/u/43294688?v=4&s=100" width="100px;" alt=""/>
                    <br />
                    Wirekang
                </a>
                <br />
                (<a href="https://kyse.link">playground</a>)
            </td>
            <td align="center">
                <a href="https://github.com/tgriesser">
                    <img src="https://avatars.githubusercontent.com/u/154748?v=4&s=100" width="100px;" alt=""/>
                    <br />
                    Tim Griesser
                </a>
                <br />
                (<a href="https://knexjs.org/">Knex</a>)
            </td>
        </tr>
        <tr>
            <td align="center">
                <a href="https://github.com/RobinBlomberg">
                    <img src="https://avatars.githubusercontent.com/u/20827397?v=4&s=100" width="100px;" alt=""/>
                    <br />
                    Robin Blomberg
                </a>
                <br />
                (<a href="https://github.com/RobinBlomberg/kysely-codegen">codegen</a>)
            </td>
                        <td align="center">
                <a href="https://github.com/nexxeln">
                    <img src="https://avatars.githubusercontent.com/u/95541290?v=4&s=100" width="100px" alt="" />
                    <br />
                    Shoubhit Dash
                </a>
                <br />
                (prisma <a href="https://www.nexxel.dev/blog/typesafe-database">idea</a>)
            </td>
            <td align="center">
                <a href="https://github.com/nexxeln">
                    <img src="https://avatars.githubusercontent.com/u/3050355?v=4&s=100" width="100px" alt="" />
                    <br />
                    Valtýr Örn Kjartansson
                </a>
                <br />
                (prisma <a href="https://github.com/valtyr/prisma-kysely">impl</a>)
            </td>
        </tr>
        <tr>
            <td align="center">
                <a href="https://github.com/thdxr">
                    <img src="https://avatars.githubusercontent.com/u/826656?v=4&s=100" width="100px;" alt=""/>
                    <br />
                    Dax Raad
                </a>
                <br />
                (early <a href="https://thdxr.com/post/serverless-relational-showdown">adopter</a>)
            </td>
            <td align="center">
                <a href="https://github.com/t3dotgg">
                    <img src="https://avatars.githubusercontent.com/u/6751787?v=4&s=100" width="100px;" alt=""/>
                    <br />
                    Theo Browne
                </a>
                <br />
                (early <a href="https://discord.com/channels/966627436387266600/988912020558602331/993220628154961930">promoter</a>)
            </td>
            <td align="center">
                <a href="https://github.com/leerob">
                    <img src="https://avatars.githubusercontent.com/u/9113740?v=4&s=100" width="100px;" alt="" />
                    <br />
                    Lee Robinson
                </a>
                <br />
                (early <a href="https://x.com/leerob/status/1576929372811849730">promoter</a>)
            </td>
        </tr>
        <tr>
            <td align="center">
                <a href="https://github.com/ethanresnick">
                    <img src="https://avatars.githubusercontent.com/u/471894?v=4&s=100" width="100px" alt="" />
                    <br />
                    Ethan Resnick
                </a>
                <br />
                (timely <a href="https://github.com/kysely-org/kysely/issues/494">feedback</a>)
            </td>
            <td align="center">
                <a href="https://github.com/thetutlage">
                    <img src="https://avatars.githubusercontent.com/u/1706381?v=4&s=100" width="100px;" alt="" />
                    <br />
                    Harminder Virk
                </a>
                <br />
                (dope <a href="https://github.com/thetutlage/meta/discussions/8">writeup</a>)
            </td>
            <td align="center">
                <a href="https://github.com/elitan">
                    <img src="https://avatars.githubusercontent.com/u/331818?v=4&s=100" width="100px;" alt="" />
                    <br />
                    Johan Eliasson
                </a>
                <br />
                (<a href="https://eliasson.me/articles/crafting-the-perfect-t3-stack-my-journey-with-kysely-atlas-and-clerk">promoter</a>/<a href="https://www.youtube.com/watch?v=u2s39dRIpCM">educator</a>)
            </td>
        </tr>
        <!-- <tr>
            <td align="center">
                <a href="">
                    <img src="" width="100px;" alt="" />
                    <br />
                    Name
                </a>
                <br />
                (contribution)
            </td>
        </tr> -->
    </tbody>
</table>

## All contributors

<p align="center">
    <a href="https://github.com/kysely-org/kysely/graphs/contributors">
        <img src="https://contrib.rocks/image?repo=kysely-org/kysely" />
    </a>
    </br>
    <span>Want to contribute? Check out our <a href="./CONTRIBUTING.md" >contribution guidelines</a>.</span>
</p>

<p align="center">
    <a href="https://vercel.com/?utm_source=kysely&utm_campaign=oss">
        <img src="https://kysely.dev/img/powered-by-vercel.svg" alt="Powered by Vercel" />
    </a>
</p>


================================================
FILE: SECURITY.md
================================================
# Security Policy

We take security seriously. We are responsible maintainers. Kysely is widely used in production and there's a lot at stake.

We're not perfect.

## Supply Chain Attacks

We're on the frontline. We listen, we adapt. We try to use up-to-date best practices and standards from the maintainer community.

Being hacked and helping distribute malicious code to our community will be soul crushing to us.

We're not perfect. GitHub is not perfect. [NPM](https://npmjs.com) is not perfect.

### Recommendations

These are not perfect.

1. Our runtimes are not perfect. Keep yours up-to-date - [End Of Life (EOL) versions don't receive security updates](https://nodejs.org/en/blog/announcements/node-18-eol-support) and there are fewer eyes watching.

1. [`pnpm`](https://pnpm.io) is not perfect, but it's the [closest](https://pnpm.io/supply-chain-security) we have - use it as your package manager.

    1. It offers out the box [protection from malicious `postinstall` scripts](https://pnpm.io/settings#onlybuiltdependencies) - many attackers use `postinstall` scripts to run/setup their malicious code while you install the package.
    1. It allows to [ignore new package versions](https://pnpm.io/settings#minimumreleaseage) with a configurable time period - response to supply chain attacks (regaining NPM/GitHub access, pulling the malicious package versions off NPM and publishing new safe versions) usually takes up to 24 hours.

1. [Provenance](https://docs.npmjs.com/viewing-package-provenance) is not perfect, but it's the closest we have - audit publish flows, source commits, builds, etc.

1. Our ecosystem is not perfect. Simplify/flatten your dependency graph. You probably don't need some of those libraries. Your runtime might have a native solution for some of these things. You can copy that single function over - attackers prey on (undermaintained) transitive dependencies as the blast radius is bigger, and response takes longer.

1. Auth is not perfect. Use secret/password managers. Encrypt. [2FA](https://en.wikipedia.org/wiki/Multi-factor_authentication) everything. Don't access production directly from laptops - many attacks involve exfiltration, and they're [getting more creative](https://www.anthropic.com/news/detecting-countering-misuse-aug-2025).

## Reporting Security Issues

To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/kysely-org/kysely/security/advisories/new) tab.

Don't abuse the system. Don't waste our time with troll/spam/AI slop false reports.

Don't be an asshole. We're not perfect.


================================================
FILE: deno.check.d.ts
================================================
import type {
  ColumnType,
  Generated,
  GeneratedAlways,
  Insertable,
  Kysely,
  Selectable,
  SqlBool,
  Updateable,
} from './dist/esm'

export interface Database {
  audit: AuditTable
  person: PersonTable
  person_backup: PersonTable
  pet: PetTable
  toy: ToyTable
  wine: WineTable
  wine_stock_change: WineStockChangeTable
}

interface AuditTable {
  id: Generated<number>
  action: string
}

interface PersonTable {
  id: Generated<number>
  address: { city: string } | null
  age: number | null
  birthdate: ColumnType<Date | null, string | null | undefined, string | null>
  created_at: GeneratedAlways<Date>
  deleted_at: ColumnType<Date | null, string | null | undefined, string | null>
  experience: { role: string }[] | null
  first_name: string
  gender: 'male' | 'female' | 'other' | null
  has_pets: Generated<'Y' | 'N'>
  last_name: string | null
  middle_name: string | null
  nicknames: string[] | null
  nullable_column: string | null
  profile: {
    addresses: { city: string }[]
    website: { url: string }
  } | null
  updated_at: ColumnType<Date | null, string | null | undefined, string | null>
  marital_status: 'single' | 'married' | 'divorced' | 'widowed' | null
}

interface PetTable {
  id: Generated<number>
  created_at: GeneratedAlways<Date>
  is_favorite: Generated<SqlBool>
  name: string
  owner_id: number
  species: Species
}

interface ToyTable {
  id: Generated<number>
  name: string
  pet_id: number
  price: number
}

interface WineTable {
  id: Generated<number>
  name: string
  stock: number
}

interface WineStockChangeTable {
  id: Generated<number>
  stock_delta: number
  wine_name: string
}

export type Person = Selectable<PersonTable>
export type NewPerson = Insertable<PersonTable>
export type PersonUpdate = Updateable<PersonTable>
export type Pet = Selectable<PetTable>
export type NewPet = Insertable<PetTable>
export type PetUpdate = Updateable<PetTable>
export type Species = 'dog' | 'cat' | 'hamster'

declare global {
  // @ts-ignore
  export class Buffer {
    static isBuffer(obj: unknown): obj is { length: number }
    static compare(a: Buffer, b: Buffer): number
  }
  export const db: Kysely<Database>
  export function functionThatExpectsPersonWithNonNullValue(
    person: Person & { nullable_column: string },
  ): void
}


================================================
FILE: deno.check.json
================================================
{
  "$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
  "compilerOptions": {
    "types": ["./deno.check.d.ts"]
  },
  "imports": {
    "better-sqlite3": "npm:better-sqlite3",
    "kysely": "./dist/esm",
    "kysely/helpers/mssql": "./dist/esm/helpers/mssql.js",
    "kysely/helpers/mysql": "./dist/esm/helpers/mysql.js",
    "kysely/helpers/postgres": "./dist/esm/helpers/postgres.js",
    "kysely/helpers/sqlite": "./dist/esm/helpers/sqlite.js",
    "lodash/snakeCase": "npm:lodash/snakeCase",
    "mysql2": "npm:mysql2",
    "pg": "npm:pg",
    "pg-cursor": "npm:pg-cursor",
    "tarn": "npm:tarn",
    "tedious": "npm:tedious",
    "type-editor": "./deno.check.d.ts"
  }
}


================================================
FILE: deno.lint.json
================================================
{
  "$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
  "lint": {
    "rules": {
      "tags": ["jsr"]
    }
  }
}


================================================
FILE: docker-compose.yml
================================================
services:
  # credit to Knex.js team for the following mssql setup here:
  mssql:
    image: mcr.microsoft.com/mssql/server:2022-latest
    ports:
      - '21433:1433'
    environment:
      ACCEPT_EULA: Y
      MSSQL_PID: Express
      SA_PASSWORD: KyselyTest0
    healthcheck:
      test: /opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P 'KyselyTest0' -Q 'select 1'
  waitmssql:
    image: mcr.microsoft.com/mssql/server:2017-latest
    links:
      - mssql
    depends_on:
      - mssql
    environment:
      MSSQL_PID: Express
    entrypoint:
      - bash
      - -c
      # https://docs.microsoft.com/en-us/sql/relational-databases/logs/control-transaction-durability?view=sql-server-ver15#bkmk_DbControl
      - 'until /opt/mssql-tools/bin/sqlcmd -S mssql -U sa -P KyselyTest0 -d master -Q "CREATE DATABASE kysely_test; ALTER DATABASE kysely_test SET ALLOW_SNAPSHOT_ISOLATION ON; ALTER DATABASE kysely_test SET DELAYED_DURABILITY = FORCED"; do sleep 5; done'
  mysql:
    image: 'mysql/mysql-server'
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: kysely_test
    ports:
      - '3308:3306'
    volumes:
      - ./test/scripts/mysql-init.sql:/data/application/init.sql
    command: --init-file /data/application/init.sql
  postgres:
    image: 'postgres'
    environment:
      POSTGRES_DB: kysely_test
      POSTGRES_USER: kysely
      POSTGRES_HOST_AUTH_METHOD: trust
    ports:
      - '5434:5432'


================================================
FILE: docs/index.html
================================================
<!doctype html>
<html>
  <head>
    <meta
      http-equiv="refresh"
      content="0; url='https://kysely-org.github.io/kysely-apidoc'"
    />
  </head>
  <body></body>
</html>


================================================
FILE: example/.gitignore
================================================
lib
node_modules
.vscode


================================================
FILE: example/.prettierrc.json
================================================
{
  "semi": false,
  "singleQuote": true
}


================================================
FILE: example/README.md
================================================
# An example server that uses Kysely

This is a simple but realistic Koa based server that shows one way to use Kysely. Since this example attempts to mimic a real world project, most of the code isn't relevant to learning how to use Kysely. The relevant parts are the repositories and how they are used. This examples is by no means the best or the right way to use Kysely, but simply one possible way.

The server has three main levels of abstraction:

1. **Repository**: Repositories contain all Kysely code and provide higher level methods for dealing with the database.

2. **Service**: All business logic is implemented in the service layer. Services use repositories to interact with the database. While repositories deal with database rows and types like `UserRow` the service layer doesn't leak out those types. For example user service methods return and take `User` objects instead of `UserRow` objects.

3. **Controller**: Controllers define the HTTP API. Controllers validate and convert the inputs and outputs from/to the network and call services to carry out the actual business logic.

## Running the example

All you need to do start poking around with the code is to clone kysely, go to the example folder and run:

```
npm install
npm test
```

You need to have postgres running in the default port `5432` and the default postgres user `postgres` should exist with no password. You can modify the [test configuration](https://github.com/kysely-org/kysely/blob/master/example/test/test-config.ts) if you want to use different settings.


================================================
FILE: example/package.json
================================================
{
  "name": "kysely_koa_example",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "rm -rf dist && tsc",
    "test": "mocha --timeout 5000 -r ts-node/register test/**/*.test.ts",
    "migrate:latest": "node dist/migrate-to-latest.js"
  },
  "author": "Sami Koskimäki <sami@jakso.me>",
  "license": "MIT",
  "dependencies": {
    "ajv": "^8.11.2",
    "dotenv": "^16.0.0",
    "jsonwebtoken": "^9.0.0",
    "koa": "^2.14.1",
    "koa-bodyparser": "^4.3.0",
    "koa-compress": "^5.1.0",
    "koa-json": "^2.0.2",
    "koa-router": "^12.0.0",
    "kysely": "0.23.3",
    "pg": "^8.8.0"
  },
  "devDependencies": {
    "@types/chai": "^4.3.4",
    "@types/jsonwebtoken": "^9.0.0",
    "@types/koa": "^2.13.5",
    "@types/koa-bodyparser": "^4.3.10",
    "@types/koa-compress": "^4.0.3",
    "@types/koa-json": "^2.0.20",
    "@types/koa-router": "^7.4.4",
    "@types/mocha": "^10.0.1",
    "@types/node": "^16.11.9",
    "axios": "^1.2.2",
    "chai": "^4.3.7",
    "mocha": "^10.2.0",
    "ts-node": "^10.9.1",
    "typescript": "^4.9.4"
  }
}


================================================
FILE: example/src/app.ts
================================================
import * as Koa from 'koa'
import * as json from 'koa-json'
import * as compress from 'koa-compress'
import * as bodyParser from 'koa-bodyparser'
import { Server } from 'http'
import { Kysely, PostgresDialect } from 'kysely'

import { Config } from './config'
import { Context, ContextExtension } from './context'
import { Database } from './database'
import { Router } from './router'
import { userController } from './user/user.controller'
import { ControllerError } from './util/errors'
import { isObject } from './util/object'
import { Pool } from 'pg'

export class App {
  #config: Config
  #koa: Koa<any, ContextExtension>
  #router: Router
  #db: Kysely<Database>
  #server?: Server

  constructor(config: Config) {
    this.#config = config
    this.#koa = new Koa()
    this.#router = new Router()
    this.#db = new Kysely<Database>({
      dialect: new PostgresDialect({
        pool: async () => new Pool(this.#config.database),
      }),
    })

    this.#koa.use(compress())
    this.#koa.use(bodyParser())
    this.#koa.use(json())

    this.#koa.use(this.errorHandler)
    this.#koa.use(this.decorateContext)

    userController(this.#router)

    this.#koa.use(this.#router.routes())
    this.#koa.use(this.#router.allowedMethods())
  }

  get db(): Kysely<Database> {
    return this.#db
  }

  async start(): Promise<void> {
    return new Promise((resolve) => {
      this.#server = this.#koa.listen(this.#config.port, resolve)
    })
  }

  async stop(): Promise<void> {
    await new Promise<void>((resolve, reject) => {
      this.#server?.close((err) => {
        if (err) {
          reject(err)
        } else {
          resolve()
        }
      })
    })

    await this.#db?.destroy()
  }

  private readonly errorHandler = async (
    ctx: Context,
    next: Koa.Next,
  ): Promise<void> => {
    try {
      await next()
    } catch (error) {
      if (error instanceof ControllerError) {
        respondError(ctx, error)
      } else {
        respondError(ctx, createUnknownError(error))
      }
    }
  }

  private readonly decorateContext = async (
    ctx: Context,
    next: Koa.Next,
  ): Promise<void> => {
    ctx.db = this.#db!
    await next()
  }
}

function respondError(ctx: Context, error: ControllerError): void {
  ctx.status = error.status
  ctx.body = error.toJSON()
}

function createUnknownError(error: unknown): ControllerError {
  return new ControllerError(
    500,
    'UnknownError',
    (isObject(error) ? error.message : undefined) ?? 'unknown error',
  )
}


================================================
FILE: example/src/authentication/auth-token.service.ts
================================================
import * as jwt from 'jsonwebtoken'
import * as refreshTokenRepository from './refresh-token.repository'
import { Kysely } from 'kysely'
import { config } from '../config'
import { Database } from '../database'
import { AuthToken } from './auth-token'
import { RefreshToken } from './refresh-token'

export class AuthTokenError extends Error {}
export class InvalidAuthTokenError extends AuthTokenError {}
export class AuthTokenExpiredError extends AuthTokenError {}
export class RefreshTokenUserIdMismatchError extends Error {}

export interface AuthTokenPayload {
  userId: string
  refreshTokenId: string
}

interface RefreshTokenPayload {
  userId: string
  refreshTokenId: string
  isRefreshToken: true
}

export async function createRefreshToken(
  db: Kysely<Database>,
  userId: string,
): Promise<RefreshToken> {
  const { refresh_token_id } = await refreshTokenRepository.insertRefreshToken(
    db,
    userId,
  )

  return signRefreshToken({
    userId,
    refreshTokenId: refresh_token_id,
    isRefreshToken: true,
  })
}

function signRefreshToken(tokenPayload: RefreshTokenPayload): RefreshToken {
  // Refresh tokens never expire.
  return { refreshToken: jwt.sign(tokenPayload, config.authTokenSecret) }
}

export async function createAuthToken(
  db: Kysely<Database>,
  refreshToken: RefreshToken,
): Promise<AuthToken> {
  const { userId, refreshTokenId } = verifyRefreshToken(refreshToken)

  await refreshTokenRepository.updateRefreshToken(db, refreshTokenId, {
    last_refreshed_at: new Date(),
  })

  return signAuthToken({ userId, refreshTokenId })
}

function verifyRefreshToken(token: RefreshToken): RefreshTokenPayload {
  const payload = verifyToken(token.refreshToken)

  if (
    !payload ||
    typeof payload !== 'object' ||
    typeof payload.userId !== 'string' ||
    typeof payload.refreshTokenId !== 'string' ||
    payload.isRefreshToken !== true
  ) {
    throw new InvalidAuthTokenError()
  }

  return {
    userId: payload.userId,
    refreshTokenId: payload.refreshTokenId,
    isRefreshToken: true,
  }
}

function signAuthToken(tokenPayload: AuthTokenPayload): AuthToken {
  return {
    authToken: jwt.sign(tokenPayload, config.authTokenSecret, {
      expiresIn: config.authTokenExpiryDuration,
    }),
  }
}

export function verifyAuthToken(token: AuthToken): AuthTokenPayload {
  const payload = verifyToken(token.authToken)

  if (
    !payload ||
    typeof payload !== 'object' ||
    typeof payload.userId !== 'string' ||
    typeof payload.refreshTokenId !== 'string'
  ) {
    throw new InvalidAuthTokenError()
  }

  return {
    userId: payload.userId,
    refreshTokenId: payload.refreshTokenId,
  }
}

function verifyToken(token: string): string | jwt.JwtPayload {
  try {
    return jwt.verify(token, config.authTokenSecret)
  } catch (error) {
    if (error instanceof jwt.TokenExpiredError) {
      throw new AuthTokenExpiredError()
    }

    throw new InvalidAuthTokenError()
  }
}

export async function deleteRefreshToken(
  db: Kysely<Database>,
  userId: string,
  refreshToken: RefreshToken,
): Promise<void> {
  const payload = verifyRefreshToken(refreshToken)

  if (payload.userId !== userId) {
    throw new RefreshTokenUserIdMismatchError()
  }

  await db
    .deleteFrom('refresh_token')
    .where('refresh_token_id', '=', payload.refreshTokenId)
    .execute()
}


================================================
FILE: example/src/authentication/auth-token.ts
================================================
export interface AuthToken {
  authToken: string
}


================================================
FILE: example/src/authentication/authentication.service.ts
================================================
import * as refreshTokenRepository from './refresh-token.repository'
import * as authTokenService from './auth-token.service'

import { AuthTokenExpiredError, AuthTokenPayload } from './auth-token.service'
import { Next } from 'koa'
import { Context } from '../context'
import { ControllerError } from '../util/errors'

export async function authenticateUser(
  ctx: Context,
  next: Next,
): Promise<void> {
  const { userId } = ctx.params

  if (!userId) {
    throw new ControllerError(
      400,
      'NoUserIdParameter',
      'no user id parameter found in the route',
    )
  }

  const authorization = ctx.headers['authorization']

  if (!authorization || !authorization.startsWith('Bearer ')) {
    throw new ControllerError(
      400,
      'InvalidAuthorizationHeader',
      'missing or invalid Authorization header',
    )
  }

  const authToken = authorization.substring('Bearer '.length)
  let authTokenPayload: AuthTokenPayload | undefined

  try {
    authTokenPayload = authTokenService.verifyAuthToken({ authToken })
  } catch (error) {
    if (error instanceof AuthTokenExpiredError) {
      throw new ControllerError(
        401,
        'ExpiredAuthToken',
        'the auth token has expired',
      )
    }

    throw new ControllerError(401, 'InvalidAuthToken', 'invalid auth token')
  }

  if (userId !== authTokenPayload.userId) {
    throw new ControllerError(403, 'UserMismatch', "wrong user's auth token")
  }

  const refreshToken = await refreshTokenRepository.findRefreshToken(
    ctx.db,
    authTokenPayload.userId,
    authTokenPayload.refreshTokenId,
  )

  if (!refreshToken) {
    throw new ControllerError(
      404,
      'UserOrRefreshTokenNotFound',
      'either the user or the refresh token has been deleted',
    )
  }

  return next()
}


================================================
FILE: example/src/authentication/refresh-token.repository.ts
================================================
import { Kysely } from 'kysely'
import { Database } from '../database'
import {
  RefreshTokenRow,
  UpdateableRefreshTokenRow,
} from './refresh-token.table'

export async function insertRefreshToken(
  db: Kysely<Database>,
  userId: string,
): Promise<RefreshTokenRow> {
  const [refreshToken] = await db
    .insertInto('refresh_token')
    .values({
      user_id: userId,
      last_refreshed_at: new Date(),
    })
    .returningAll()
    .execute()

  return refreshToken
}

export async function findRefreshToken(
  db: Kysely<Database>,
  userId: string,
  refreshTokenId: string,
): Promise<RefreshTokenRow | undefined> {
  const token = await db
    .selectFrom('refresh_token as rt')
    .selectAll('rt')
    .innerJoin('user as u', 'rt.user_id', 'u.user_id')
    .where('u.user_id', '=', userId)
    .where('rt.refresh_token_id', '=', refreshTokenId)
    .executeTakeFirst()

  return token
}

export async function updateRefreshToken(
  db: Kysely<Database>,
  refreshTokenId: string,
  patch: Pick<UpdateableRefreshTokenRow, 'last_refreshed_at'>,
): Promise<void> {
  await db
    .updateTable('refresh_token')
    .set(patch)
    .where('refresh_token_id', '=', refreshTokenId)
    .execute()
}


================================================
FILE: example/src/authentication/refresh-token.table.ts
================================================
import { Generated, Insertable, Selectable, Updateable } from 'kysely'

export interface RefreshTokenTable {
  refresh_token_id: Generated<string>
  user_id: string
  last_refreshed_at: Date
  created_at: Generated<Date>
}

export type RefreshTokenRow = Selectable<RefreshTokenTable>
export type InsertableRefreshTokenRow = Insertable<RefreshTokenTable>
export type UpdateableRefreshTokenRow = Updateable<RefreshTokenTable>


================================================
FILE: example/src/authentication/refresh-token.ts
================================================
import { ajv } from '../util/ajv'

export interface RefreshToken {
  refreshToken: string
}

export const validateRefreshToken = ajv.compile<RefreshToken>({
  type: 'object',
  required: ['refreshToken'],
  properties: {
    refreshToken: {
      type: 'string',
    },
  },
})


================================================
FILE: example/src/config.ts
================================================
import * as dotenv from 'dotenv'
import { ConnectionConfig } from 'pg'

dotenv.config()

export interface Config {
  readonly port: number
  readonly authTokenSecret: string
  readonly authTokenExpiryDuration: string
  readonly database: ConnectionConfig
}

export const config: Config = Object.freeze({
  port: parseInt(getEnvVariable('PORT'), 10),
  authTokenSecret: getEnvVariable('AUTH_TOKEN_SECRET'),
  authTokenExpiryDuration: getEnvVariable('AUTH_TOKEN_EXIRY_DURATION'),
  database: Object.freeze({
    database: getEnvVariable('DATABASE'),
    host: getEnvVariable('DATABASE_HOST'),
    user: getEnvVariable('DATABASE_USER'),
  }),
})

function getEnvVariable(name: string): string {
  if (!process.env[name]) {
    throw new Error(`environment variable ${name} not found`)
  }

  return process.env[name]!
}


================================================
FILE: example/src/context.ts
================================================
import * as Koa from 'koa'
import * as KoaRouter from 'koa-router'

import { Kysely } from 'kysely'
import { Database } from './database'

export interface ContextExtension {
  db: Kysely<Database>
}

export type Context = Koa.ParameterizedContext<
  any,
  ContextExtension & KoaRouter.IRouterParamContext<any, ContextExtension>,
  any
>


================================================
FILE: example/src/database.ts
================================================
import { RefreshTokenTable } from './authentication/refresh-token.table'
import { PasswordSignInMethodTable } from './user/sign-in-method/password-sign-in-method.table'
import { SignInMethodTable } from './user/sign-in-method/sign-in-method.table'
import { UserTable } from './user/user.table'

export interface Database {
  user: UserTable
  refresh_token: RefreshTokenTable
  sign_in_method: SignInMethodTable
  password_sign_in_method: PasswordSignInMethodTable
}


================================================
FILE: example/src/migrate-to-latest.ts
================================================
import * as path from 'path'
import { promises as fs } from 'fs'
import { Database } from './database'
import { config } from './config'
import {
  Kysely,
  Migrator,
  PostgresDialect,
  FileMigrationProvider,
} from 'kysely'
import { Pool } from 'pg'

async function migrateToLatest() {
  const db = new Kysely<Database>({
    dialect: new PostgresDialect({
      pool: new Pool(config.database),
    }),
  })

  const migrator = new Migrator({
    db,
    provider: new FileMigrationProvider({
      fs,
      path,
      migrationFolder: path.join(__dirname, 'migrations'),
    }),
  })

  const { error, results } = await migrator.migrateToLatest()

  results?.forEach((it) => {
    if (it.status === 'Success') {
      console.log(`migration "${it.migrationName}" was executed successfully`)
    } else if (it.status === 'Error') {
      console.error(`failed to execute migration "${it.migrationName}"`)
    }
  })

  if (error) {
    console.error('failed to migrate')
    console.error(error)
    process.exit(1)
  }

  await db.destroy()
}

migrateToLatest()


================================================
FILE: example/src/migrations/2021_09_18_06_54_59_create_user.ts
================================================
import { Kysely, sql } from 'kysely'

export async function up(db: Kysely<any>): Promise<void> {
  await db.schema
    .createTable('user')
    .addColumn('user_id', 'uuid', (col) =>
      col.primaryKey().defaultTo(sql`gen_random_uuid()`),
    )
    .addColumn('first_name', 'text')
    .addColumn('last_name', 'text')
    .addColumn('email', 'text', (col) => col.unique())
    .addColumn('created_at', 'timestamp', (col) => col.defaultTo(sql`NOW()`))
    .execute()
}

export async function down(db: Kysely<any>): Promise<void> {
  await db.schema.dropTable('user').execute()
}


================================================
FILE: example/src/migrations/2021_09_18_14_05_20_create_refresh_token.ts
================================================
import { Kysely, sql } from 'kysely'

export async function up(db: Kysely<any>): Promise<void> {
  await db.schema
    .createTable('refresh_token')
    .addColumn('refresh_token_id', 'uuid', (col) =>
      col.primaryKey().defaultTo(sql`gen_random_uuid()`),
    )
    .addColumn('user_id', 'uuid', (col) =>
      col.references('user.user_id').notNull().onDelete('cascade'),
    )
    .addColumn('last_refreshed_at', 'timestamp', (col) => col.notNull())
    .addColumn('created_at', 'timestamp', (col) =>
      col.notNull().defaultTo(sql`NOW()`),
    )
    .execute()

  await db.schema
    .createIndex('refresh_token_user_id_index')
    .on('refresh_token')
    .column('user_id')
    .execute()
}

export async function down(db: Kysely<any>): Promise<void> {
  await db.schema.dropTable('refresh_token').execute()
}


================================================
FILE: example/src/migrations/2021_09_18_18_22_45_create_sign_in_method.ts
================================================
import { Kysely } from 'kysely'

export async function up(db: Kysely<any>): Promise<void> {
  await db.schema
    .createTable('sign_in_method')
    .addColumn('user_id', 'uuid', (col) =>
      col.references('user.user_id').notNull().onDelete('cascade'),
    )
    .addColumn('type', 'text', (col) => col.notNull())
    .addPrimaryKeyConstraint('sign_in_method_primary_key', ['user_id', 'type'])
    .execute()

  await db.schema
    .createTable('password_sign_in_method')
    .addColumn('user_id', 'uuid', (col) =>
      col.references('user.user_id').notNull().primaryKey().onDelete('cascade'),
    )
    .addColumn('password_hash', 'text', (col) => col.notNull())
    .execute()

  await db.schema
    .createIndex('sign_in_method_user_id_index')
    .on('sign_in_method')
    .column('user_id')
    .execute()

  await db.schema
    .createIndex('password_sign_in_method_user_id_index')
    .on('password_sign_in_method')
    .column('user_id')
    .execute()
}

export async function down(db: Kysely<any>): Promise<void> {
  await db.schema.dropTable('sign_in_method').execute()
  await db.schema.dropTable('password_sign_in_method').execute()
}


================================================
FILE: example/src/router.ts
================================================
import * as KoaRouter from 'koa-router'

import { ContextExtension } from './context'

export class Router extends KoaRouter<any, ContextExtension> {}


================================================
FILE: example/src/user/sign-in-method/password-sign-in-method.table.ts
================================================
import { Insertable, Selectable, Updateable } from 'kysely'

export interface PasswordSignInMethodTable {
  user_id: string
  password_hash: string
}

export type PasswordSignInMethodRow = Selectable<PasswordSignInMethodTable>

export type InsertablePasswordSignInMethodRow =
  Insertable<PasswordSignInMethodTable>

export type UpdateablePasswordSignInMethodRow =
  Updateable<PasswordSignInMethodTable>


================================================
FILE: example/src/user/sign-in-method/sign-in-method.controller.ts
================================================
import * as signInMethodService from './sign-in-method.service'
import * as authenticationService from '../../authentication/authentication.service'
import * as authTokenService from '../../authentication/auth-token.service'

import { RefreshTokenUserIdMismatchError } from '../../authentication/auth-token.service'
import {
  PasswordTooLongError,
  PasswordTooWeakError,
  SignInMethodNotFoundError,
  UserAlreadyHasSignInMethodError,
  WrongPasswordError,
} from './sign-in-method.service'
import { validateRefreshToken } from '../../authentication/refresh-token'
import { Router } from '../../router'
import { ControllerError, UserNotFoundError } from '../../util/errors'
import { validatePasswordSignInMethod } from './sign-in-method'

export function signInMethodController(router: Router): void {
  router.post(
    '/api/v1/user/:userId/sign-in-methods',
    authenticationService.authenticateUser,
    async (ctx) => {
      const { body } = ctx.request

      if (!validatePasswordSignInMethod(body)) {
        throw new ControllerError(
          400,
          'InvalidSignInMethod',
          'invalid sign in method',
        )
      }

      try {
        await ctx.db.transaction().execute(async (trx) => {
          await signInMethodService.addPasswordSignInMethod(
            trx,
            ctx.params.userId,
            body,
          )
        })

        ctx.status = 201
        ctx.body = { success: true }
      } catch (error) {
        if (error instanceof UserNotFoundError) {
          throw new ControllerError(404, 'UserNotFound', 'user not found')
        } else if (error instanceof PasswordTooWeakError) {
          throw new ControllerError(
            400,
            'PasswordTooWeak',
            'password is too weak',
          )
        } else if (error instanceof PasswordTooLongError) {
          throw new ControllerError(
            400,
            'PasswordTooLong',
            'password is too long',
          )
        } else if (error instanceof UserAlreadyHasSignInMethodError) {
          throw new ControllerError(
            409,
            'UserAlreadyHasSignInMethod',
            'the user already has a sign in method',
          )
        }

        throw error
      }
    },
  )

  router.post('/api/v1/user/sign-in', async (ctx) => {
    const { body } = ctx.request

    if (!validatePasswordSignInMethod(body)) {
      throw new ControllerError(
        400,
        'InvalidSignInMethod',
        'invalid sign in method',
      )
    }

    try {
      const signedInUser = await ctx.db.transaction().execute(async (trx) => {
        return signInMethodService.singInUsingPassword(trx, body)
      })

      ctx.status = 200
      ctx.body = {
        user: signedInUser.user,
        authToken: signedInUser.authToken.authToken,
        refreshToken: signedInUser.refreshToken.refreshToken,
      }
    } catch (error) {
      if (
        error instanceof UserNotFoundError ||
        error instanceof WrongPasswordError ||
        error instanceof SignInMethodNotFoundError
      ) {
        // Don't leak too much information about why the sign in failed.
        throw new ControllerError(
          401,
          'InvalidCredentials',
          'wrong email or password',
        )
      }

      throw error
    }
  })

  router.post(
    '/api/v1/user/:userId/sign-out',
    authenticationService.authenticateUser,
    async (ctx) => {
      const { body } = ctx.request

      if (!validateRefreshToken(body)) {
        throw new ControllerError(
          400,
          'InvalidRefreshToken',
          'the body must contain a valid refresh token',
        )
      }

      try {
        await authTokenService.deleteRefreshToken(
          ctx.db,
          ctx.params.userId,
          body,
        )

        ctx.status = 200
        ctx.body = { success: true }
      } catch (error) {
        if (error instanceof RefreshTokenUserIdMismatchError) {
          throw new ControllerError(
            403,
            'RefreshTokenUserIdMismatch',
            "cannot delete another user's refresh token",
          )
        }

        throw error
      }
    },
  )
}


================================================
FILE: example/src/user/sign-in-method/sign-in-method.repository.ts
================================================
import { Kysely } from 'kysely'
import { Database } from '../../database'
import {
  InsertablePasswordSignInMethodRow,
  PasswordSignInMethodRow,
} from './password-sign-in-method.table'

export async function findPasswordSignInMethod(
  db: Kysely<Database>,
  userId: string,
): Promise<PasswordSignInMethodRow | undefined> {
  const method = await db
    .selectFrom('sign_in_method as sim')
    .innerJoin('password_sign_in_method as psim', 'psim.user_id', 'sim.user_id')
    .selectAll('psim')
    .where('sim.type', '=', 'password')
    .where('sim.user_id', '=', userId)
    .executeTakeFirst()

  return method
}

export async function insertPasswordSignInMethod(
  db: Kysely<Database>,
  method: InsertablePasswordSignInMethodRow,
): Promise<PasswordSignInMethodRow> {
  await db
    .with('sim', (db) =>
      db
        .insertInto('sign_in_method')
        .values({ user_id: method.user_id, type: 'password' }),
    )
    .insertInto('password_sign_in_method')
    .values(method)
    .execute()

  return method
}


================================================
FILE: example/src/user/sign-in-method/sign-in-method.service.ts
================================================
import * as crypto from 'crypto'
import * as signInMethodRepository from './sign-in-method.repository'
import * as userService from '../user.service'
import * as authTokenService from '../../authentication/auth-token.service'

import { Transaction } from 'kysely'
import { Database } from '../../database'
import { UserNotFoundError } from '../../util/errors'
import { SignedInUser } from '../signed-in-user'
import { PasswordSignInMethod } from './sign-in-method'

export const MIN_PASSWORD_LENGTH = 8
export const MAX_PASSWORD_LENGTH = 255

export class UserAlreadyHasSignInMethodError extends Error {}
export class SignInMethodNotFoundError extends Error {}
export class WrongPasswordError extends Error {}
export class PasswordTooWeakError extends Error {}
export class PasswordTooLongError extends Error {}

export async function addPasswordSignInMethod(
  trx: Transaction<Database>,
  userId: string,
  method: PasswordSignInMethod,
): Promise<void> {
  const user = await userService.lockUserById(trx, userId)

  if (!user) {
    throw new UserNotFoundError()
  }

  if (user.email) {
    throw new UserAlreadyHasSignInMethodError()
  }

  await signInMethodRepository.insertPasswordSignInMethod(trx, {
    user_id: userId,
    password_hash: await encryptPassword(method.password),
  })

  await userService.setUserEmail(trx, userId, method.email)
}

async function encryptPassword(password: string): Promise<string> {
  if (password.length < MIN_PASSWORD_LENGTH) {
    throw new PasswordTooWeakError()
  }

  if (password.length > MAX_PASSWORD_LENGTH) {
    throw new PasswordTooLongError()
  }

  return encryptSecret(password)
}

async function encryptSecret(secret: string): Promise<string> {
  const salt = crypto.randomBytes(16).toString('hex')
  return `${salt}:${await scrypt(secret, salt)}`
}

async function verifySecret(secret: string, hash: string): Promise<boolean> {
  const [salt, secretHash] = hash.split(':')
  return (await scrypt(secret, salt)) === secretHash
}

async function scrypt(secret: string, salt: string): Promise<string> {
  return new Promise((resolve, reject) => {
    crypto.scrypt(
      secret,
      salt,
      64,
      { N: 16384, r: 8, p: 1 },
      (err, secretHash) => {
        if (err) {
          return reject(err)
        }

        resolve(secretHash.toString('hex'))
      },
    )
  })
}

export async function singInUsingPassword(
  trx: Transaction<Database>,
  method: PasswordSignInMethod,
): Promise<SignedInUser> {
  const user = await userService.lockUserByEmail(trx, method.email)

  if (!user) {
    throw new UserNotFoundError()
  }

  const signInMethod = await signInMethodRepository.findPasswordSignInMethod(
    trx,
    user.id,
  )

  if (!signInMethod) {
    throw new SignInMethodNotFoundError()
  }

  if (!(await verifyPassword(method.password, signInMethod.password_hash))) {
    throw new WrongPasswordError()
  }

  const refreshToken = await authTokenService.createRefreshToken(trx, user.id)
  const authToken = await authTokenService.createAuthToken(trx, refreshToken)

  return {
    user,
    authToken,
    refreshToken,
  }
}

async function verifyPassword(
  password: string,
  hash: string,
): Promise<boolean> {
  return verifySecret(password, hash)
}


================================================
FILE: example/src/user/sign-in-method/sign-in-method.table.ts
================================================
import { Insertable, Selectable, Updateable } from 'kysely'

export interface SignInMethodTable {
  user_id: string
  type: 'password'
}

export type SignInMethodRow = Selectable<SignInMethodTable>
export type InsertableSignInMethodRow = Insertable<SignInMethodTable>
export type UpdateableSignInMethodRow = Updateable<SignInMethodTable>


================================================
FILE: example/src/user/sign-in-method/sign-in-method.ts
================================================
import { ajv } from '../../util/ajv'

export type SignInMethod = PasswordSignInMethod

export interface PasswordSignInMethod {
  email: string
  password: string
}

export const validatePasswordSignInMethod = ajv.compile<PasswordSignInMethod>({
  type: 'object',
  required: ['email', 'password'],
  properties: {
    email: {
      type: 'string',
    },
    password: {
      type: 'string',
    },
  },
})


================================================
FILE: example/src/user/signed-in-user.ts
================================================
import { AuthToken } from '../authentication/auth-token'
import { RefreshToken } from '../authentication/refresh-token'
import { User } from './user'

export interface SignedInUser {
  refreshToken: RefreshToken
  authToken: AuthToken
  user: User
}


================================================
FILE: example/src/user/user.controller.ts
================================================
import * as userService from './user.service'
import * as authenticationService from '../authentication/authentication.service'

import { Router } from '../router'
import { signInMethodController } from './sign-in-method/sign-in-method.controller'
import { validateCreateAnonymousUserRequest } from './user'
import { ControllerError } from '../util/errors'

export function userController(router: Router): void {
  router.post('/api/v1/user', async (ctx) => {
    const { body } = ctx.request

    if (!validateCreateAnonymousUserRequest(body)) {
      throw new ControllerError(400, 'InvalidUser', 'invalid user')
    }

    const result = await ctx.db.transaction().execute(async (trx) => {
      return userService.createAnonymousUser(trx, body)
    })

    ctx.status = 201
    ctx.body = {
      user: result.user,
      authToken: result.authToken.authToken,
      refreshToken: result.refreshToken.refreshToken,
    }
  })

  router.get(
    '/api/v1/user/:userId',
    authenticationService.authenticateUser,
    async (ctx) => {
      const { userId } = ctx.params
      const user = await userService.findUserById(ctx.db, userId)

      if (!user) {
        throw new ControllerError(
          404,
          'UserNotFound',
          `user with id ${userId} was not found`,
        )
      }

      ctx.body = { user }
    },
  )

  signInMethodController(router)
}


================================================
FILE: example/src/user/user.repository.ts
================================================
import { Kysely, Transaction } from 'kysely'
import { Database } from '../database'
import { InsertableUserRow, UserRow } from './user.table'

export async function insertUser(
  db: Kysely<Database>,
  user: InsertableUserRow,
): Promise<UserRow> {
  const insertedUser = await db
    .insertInto('user')
    .values(user)
    .returningAll()
    .executeTakeFirstOrThrow()

  return insertedUser
}

export async function findUserById(
  db: Kysely<Database>,
  id: string,
): Promise<UserRow | undefined> {
  const user = await db
    .selectFrom('user')
    .where('user_id', '=', id)
    .selectAll('user')
    .executeTakeFirst()

  return user
}

export async function lockUserById(
  trx: Transaction<Database>,
  id: string,
): Promise<UserRow | undefined> {
  return lockUser(trx, 'user_id', id)
}

export async function lockUserByEmail(
  trx: Transaction<Database>,
  email: string,
): Promise<UserRow | undefined> {
  return lockUser(trx, 'email', email)
}

async function lockUser(
  trx: Transaction<Database>,
  column: 'user_id' | 'email',
  value: string,
): Promise<UserRow | undefined> {
  const user = await trx
    .selectFrom('user')
    .where(column, '=', value)
    .selectAll('user')
    .forUpdate()
    .executeTakeFirst()

  return user
}

export async function setUserEmail(
  db: Kysely<Database>,
  id: string,
  email: string,
): Promise<void> {
  await db
    .updateTable('user')
    .where('user_id', '=', id)
    .set({ email })
    .execute()
}


================================================
FILE: example/src/user/user.service.ts
================================================
import * as userRepository from './user.repository'
import * as authTokenService from '../authentication/auth-token.service'

import { Kysely, Transaction } from 'kysely'
import { Database } from '../database'
import { SignedInUser } from './signed-in-user'
import { CreateAnonymousUserRequest, User } from './user'
import { UserRow } from './user.table'

export async function createAnonymousUser(
  db: Kysely<Database>,
  request: CreateAnonymousUserRequest,
): Promise<SignedInUser> {
  const user = await userRepository.insertUser(db, {
    first_name: request.firstName,
    last_name: request.lastName,
  })

  const refreshToken = await authTokenService.createRefreshToken(
    db,
    user.user_id,
  )

  const authToken = await authTokenService.createAuthToken(db, refreshToken)

  return {
    refreshToken,
    authToken,
    user: userRowToUser(user),
  }
}

export async function findUserById(
  db: Kysely<Database>,
  userId: string,
): Promise<User | undefined> {
  const userRow = await userRepository.findUserById(db, userId)

  if (userRow) {
    return userRowToUser(userRow)
  }
}

export async function lockUserById(
  trx: Transaction<Database>,
  id: string,
): Promise<User | undefined> {
  const userRow = await userRepository.lockUserById(trx, id)

  if (userRow) {
    return userRowToUser(userRow)
  }
}

export async function lockUserByEmail(
  trx: Transaction<Database>,
  email: string,
): Promise<User | undefined> {
  const userRow = await userRepository.lockUserByEmail(trx, email)

  if (userRow) {
    return userRowToUser(userRow)
  }
}

export async function setUserEmail(
  db: Kysely<Database>,
  userId: string,
  email: string,
): Promise<void> {
  await userRepository.setUserEmail(db, userId, email)
}

export function userRowToUser(user: UserRow): User {
  return {
    id: user.user_id,
    firstName: user.first_name,
    lastName: user.last_name,
    email: user.email,
  }
}


================================================
FILE: example/src/user/user.table.ts
================================================
import { Generated, Insertable, Selectable, Updateable } from 'kysely'

export interface UserTable {
  user_id: Generated<string>
  first_name: string | null
  last_name: string | null
  email: string | null
  created_at: Generated<Date>
}

export type UserRow = Selectable<UserTable>
export type InsertableUserRow = Insertable<UserTable>
export type UpdateableUserRow = Updateable<UserTable>


================================================
FILE: example/src/user/user.ts
================================================
import { ajv } from '../util/ajv'

export interface User {
  id: string
  firstName: string | null
  lastName: string | null
  email: string | null
}

export interface CreateAnonymousUserRequest {
  firstName?: string
  lastName?: string
}

export const validateCreateAnonymousUserRequest =
  ajv.compile<CreateAnonymousUserRequest>({
    type: 'object',
    properties: {
      firstName: {
        type: 'string',
      },
      lastName: {
        type: 'string',
      },
    },
  })


================================================
FILE: example/src/util/ajv.ts
================================================
import Ajv from 'ajv'

export const ajv = new Ajv()


================================================
FILE: example/src/util/errors.ts
================================================
export type AuthenticationErrors =
  | 'NoUserIdParameter'
  | 'InvalidAuthorizationHeader'
  | 'InvalidAuthToken'
  | 'ExpiredAuthToken'
  | 'UserMismatch'
  | 'UserOrRefreshTokenNotFound'

export type UserApiErrors = 'InvalidUser' | 'UserNotFound'

export type SignInMethodApiErrors =
  | 'InvalidSignInMethod'
  | 'UserAlreadyHasSignInMethod'
  | 'PasswordTooWeak'
  | 'PasswordTooLong'
  | 'InvalidCredentials'
  | 'InvalidRefreshToken'
  | 'RefreshTokenUserIdMismatch'

export type ErrorCode =
  | 'UnknownError'
  | AuthenticationErrors
  | UserApiErrors
  | SignInMethodApiErrors

export type ErrorStatus = 400 | 401 | 403 | 404 | 409 | 500

export class ControllerError extends Error {
  readonly status: ErrorStatus
  readonly code: ErrorCode
  readonly data?: any

  constructor(
    status: ErrorStatus,
    code: ErrorCode,
    message: string,
    data?: any,
  ) {
    super(message)
    this.status = status
    this.code = code
    this.data = data
  }

  toJSON() {
    return {
      error: { code: this.code, message: this.message },
    }
  }
}

export class UserNotFoundError extends Error {}


================================================
FILE: example/src/util/object.ts
================================================
export function isObject(value: unknown): value is Record<string, any> {
  return typeof value === 'object' && value !== null
}


================================================
FILE: example/test/test-config.ts
================================================
import { ConnectionConfig } from 'pg'
import { Config } from '../src/config'

export interface TestConfig extends Config {
  readonly adminDatabase: ConnectionConfig
}

export const testConfig: TestConfig = {
  port: 3001,
  authTokenSecret: 'a498a5cf13a8194a2477f9284df34af3954fad3dc8459e343a',
  authTokenExpiryDuration: '2h',
  database: {
    host: 'localhost',
    database: 'kysely_koa_example_test',
    user: 'postgres',
  },
  adminDatabase: {
    host: 'localhost',
    database: 'postgres',
    user: 'postgres',
  },
}


================================================
FILE: example/test/test-context.ts
================================================
import * as path from 'path'
import axios from 'axios'
import { promises as fs } from 'fs'
import {
  FileMigrationProvider,
  Kysely,
  Migrator,
  PostgresDialect,
  sql,
} from 'kysely'

import { testConfig } from './test-config'
import { App } from '../src/app'
import { Database } from '../src/database'
import { User } from '../src/user/user'
import { Pool } from 'pg'

export class TestContext {
  #app?: App

  request = axios.create({
    baseURL: `http://localhost:${testConfig.port}`,
    validateStatus: () => true,
  })

  get db(): Kysely<Database> {
    return this.#app!.db
  }

  before = async (): Promise<void> => {
    const adminDb = new Kysely<any>({
      dialect: new PostgresDialect({
        pool: new Pool(testConfig.adminDatabase),
      }),
    })

    // Create our test database
    const { database } = testConfig.database
    await sql`drop database if exists ${sql.id(database!)}`.execute(adminDb)
    await sql`create database ${sql.id(database!)}`.execute(adminDb)
    await adminDb.destroy()

    // Now connect to the test database and run the migrations
    const db = new Kysely<any>({
      dialect: new PostgresDialect({
        pool: new Pool(testConfig.database),
      }),
    })

    const migrator = new Migrator({
      db,
      provider: new FileMigrationProvider({
        fs,
        path,
        migrationFolder: path.join(__dirname, '../src/migrations'),
      }),
    })

    await migrator.migrateToLatest()
    await db.destroy()
  }

  after = async (): Promise<void> => {
    // Nothing to do here at the moment
  }

  beforeEach = async (): Promise<void> => {
    this.#app = new App(testConfig)

    // Clear the database
    await this.db.deleteFrom('user').execute()

    await this.#app.start()
  }

  afterEach = async (): Promise<void> => {
    await this.#app?.stop()
    this.#app = undefined
  }

  createUser = async (): Promise<{
    user: User
    authToken: string
    refreshToken: string
  }> => {
    const res = await this.request.post(`/api/v1/user`, {
      firstName: 'Test',
      lastName: 'Testerson',
    })

    return res.data
  }
}


================================================
FILE: example/test/user/user.test.ts
================================================
import { expect } from 'chai'

import { TestContext } from '../test-context'
import { User } from '../../src/user/user'
import { AxiosResponse } from 'axios'

const EMAIL = 'foo@bar.fake'
const PASSWORD = '12345678'

describe('user tests', () => {
  const ctx = new TestContext()

  before(ctx.before)
  beforeEach(ctx.beforeEach)

  after(ctx.after)
  afterEach(ctx.afterEach)

  it('should create an anonoymous user', async () => {
    const res = await ctx.request.post(`/api/v1/user`, {
      firstName: 'Anon',
    })

    expect(res.status).to.equal(201)
    expect(res.data.user.firstName).to.equal('Anon')
    expect(res.data.user.lastName).to.equal(null)
    expect(res.data.user.email).to.equal(null)

    // The returned auth token should be usable.
    const getRes = await ctx.request.get<{ user: User }>(
      `/api/v1/user/${res.data.user.id}`,
      createAuthHeaders(res.data.authToken),
    )

    expect(getRes.status).to.equal(200)
    expect(getRes.data.user).to.eql(res.data.user)
  })

  it('should get user by id', async () => {
    const { user, authToken } = await ctx.createUser()

    const res = await ctx.request.get<{ user: User }>(
      `/api/v1/user/${user.id}`,
      createAuthHeaders(authToken),
    )

    expect(res.status).to.equal(200)
    expect(res.data).to.eql({ user })
  })

  it('should add a password sign in method for a user', async () => {
    const { user, authToken } = await ctx.createUser()
    const res = await createPasswordSignInMethod(user.id, authToken)

    expect(res.status).to.equal(201)
    expect(res.data.success).to.equal(true)
  })

  it('should sign in a user', async () => {
    const { user, authToken } = await ctx.createUser()
    await createPasswordSignInMethod(user.id, authToken)

    const res = await ctx.request.post(`/api/v1/user/sign-in`, {
      email: EMAIL,
      password: PASSWORD,
    })

    expect(res.status).to.equal(200)

    // The returned auth token should be usable.
    const getRes = await ctx.request.get<{ user: User }>(
      `/api/v1/user/${res.data.user.id}`,
      createAuthHeaders(authToken),
    )

    expect(getRes.status).to.equal(200)
    expect(getRes.data.user).to.eql(res.data.user)
  })

  it('should fail to sign in user with the wrong password', async () => {
    const { user, authToken } = await ctx.createUser()
    await createPasswordSignInMethod(user.id, authToken)

    const res = await ctx.request.post(`/api/v1/user/sign-in`, {
      email: EMAIL,
      password: 'wrong password',
    })

    expect(res.status).to.equal(401)
    expect(res.data).to.eql({
      error: {
        code: 'InvalidCredentials',
        message: 'wrong email or password',
      },
    })

    // Only the one refresh token created for the anonymous user should exists.
    expect(
      await ctx.db
        .selectFrom('refresh_token')
        .select('refresh_token.user_id')
        .execute(),
    ).to.have.length(1)
  })

  it('should sign out a user', async () => {
    const { user, authToken, refreshToken } = await ctx.createUser()

    const res = await ctx.request.post(
      `/api/v1/user/${user.id}/sign-out`,
      { refreshToken },
      createAuthHeaders(authToken),
    )

    expect(res.status).to.equal(200)

    // The auth token should no longer be usable.
    const getRes = await ctx.request.get(
      `/api/v1/user/${user.id}`,
      createAuthHeaders(authToken),
    )

    expect(getRes.status).to.equal(404)
    expect(getRes.data.error.code).to.equal('UserOrRefreshTokenNotFound')
  })

  function createAuthHeaders(authToken: string) {
    return {
      headers: {
        Authorization: `Bearer ${authToken}`,
      },
    }
  }

  async function createPasswordSignInMethod(
    userId: string,
    authToken: string,
  ): Promise<AxiosResponse<{ success: true }>> {
    return await ctx.request.post<{ success: true }>(
      `/api/v1/user/${userId}/sign-in-methods`,
      { email: EMAIL, password: PASSWORD },
      createAuthHeaders(authToken),
    )
  }
})


================================================
FILE: example/tsconfig.json
================================================
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "ESNext",
    "declaration": true,
    "outDir": "./dist",
    "strict": true,
    "noImplicitAny": true
  },
  "include": ["src/**/*"]
}


================================================
FILE: jsr.json
================================================
{
  "$schema": "https://jsr.io/schema/config-file.v1.json",
  "name": "@kysely/kysely",
  "version": "0.28.14",
  "license": "MIT",
  "exports": {
    ".": "./src/index.ts",
    "./helpers/mysql": "./src/helpers/mysql.ts",
    "./helpers/mssql": "./src/helpers/mssql.ts",
    "./helpers/postgres": "./src/helpers/postgres.ts",
    "./helpers/sqlite": "./src/helpers/sqlite.ts"
  },
  "publish": {
    "include": [
      "LICENSE",
      "README.md",
      "src/**/*.ts"
    ]
  }
}


================================================
FILE: outdated-typescript.d.ts
================================================
import type { KyselyTypeError } from './dist/cjs/util/type-error'

declare const Kysely: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 4.6 or newer.'>
declare const RawBuilder: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 4.6 or newer.'>
declare const sql: KyselyTypeError<'The installed TypeScript version is outdated and cannot guarantee type-safety with Kysely. Please upgrade to version 4.6 or newer.'>


================================================
FILE: package.json
================================================
{
  "name": "kysely",
  "version": "0.28.14",
  "description": "Type safe SQL query builder",
  "repository": {
    "type": "git",
    "url": "git://github.com/kysely-org/kysely.git"
  },
  "homepage": "https://kysely.dev",
  "keywords": [
    "query",
    "builder",
    "query builder",
    "sql",
    "typescript",
    "postgres",
    "postgresql",
    "mysql",
    "sqlite",
    "mssql",
    "ms sql server",
    "sql server",
    "type-safe",
    "type-safety",
    "plugins"
  ],
  "engines": {
    "node": ">=20.0.0"
  },
  "main": "dist/cjs/index.js",
  "module": "dist/esm/index.js",
  "typesVersions": {
    "<4.6": {
      "*": [
        "outdated-typescript.d.ts"
      ]
    }
  },
  "files": [
    "dist",
    "helpers",
    "outdated-typescript.d.ts"
  ],
  "exports": {
    ".": {
      "import": "./dist/esm/index.js",
      "require": "./dist/cjs/index.js",
      "default": "./dist/cjs/index.js"
    },
    "./helpers/postgres": {
      "import": "./dist/esm/helpers/postgres.js",
      "require": "./dist/cjs/helpers/postgres.js",
      "default": "./dist/cjs/helpers/postgres.js"
    },
    "./helpers/mysql": {
      "import": "./dist/esm/helpers/mysql.js",
      "require": "./dist/cjs/helpers/mysql.js",
      "default": "./dist/cjs/helpers/mysql.js"
    },
    "./helpers/mssql": {
      "import": "./dist/esm/helpers/mssql.js",
      "require": "./dist/cjs/helpers/mssql.js",
      "default": "./dist/cjs/helpers/mssql.js"
    },
    "./helpers/sqlite": {
      "import": "./dist/esm/helpers/sqlite.js",
      "require": "./dist/cjs/helpers/sqlite.js",
      "default": "./dist/cjs/helpers/sqlite.js"
    }
  },
  "sideEffects": false,
  "scripts": {
    "clean": "rm -rf dist & rm -rf test/node/dist & rm -rf test/browser/bundle.js & rm -rf helpers",
    "bench:ts": "pnpm build && cd ./test/ts-benchmarks && node --experimental-strip-types ./index.ts",
    "test": "pnpm build && pnpm test:node:build && pnpm test:node:run && pnpm test:typings && pnpm test:esmimports && pnpm test:exports",
    "test:node:build": "tsc -p test/node",
    "test:node": "pnpm build && pnpm test:node:build && pnpm test:node:run",
    "test:node:run": "mocha --timeout 15000 test/node/dist/**/*.test.js",
    "test:browser:build": "rm -rf test/browser/bundle.js && esbuild test/browser/main.ts --bundle --outfile=test/browser/bundle.js",
    "test:browser": "pnpm build && pnpm test:browser:build && node test/browser/test.js",
    "test:bun": "pnpm build && bun link && cd test/bun && bun install && bun run test",
    "test:cloudflare-workers": "pnpm build && pnpm -r test --filter kysely-cloudflare-workers-test",
    "test:deno": "deno run --allow-env --allow-read --allow-net --no-lock test/deno/local.test.ts && deno run --allow-env --allow-read --allow-net --no-lock test/deno/cdn.test.ts",
    "test:typings": "tsd test/typings",
    "test:esmimports": "node scripts/check-esm-imports.js",
    "test:esbuild": "esbuild --bundle --platform=node --external:pg-native dist/esm/index.js --outfile=/dev/null",
    "test:exports": "attw --pack . && node scripts/check-exports.js",
    "test:jsdocs": "deno check --doc-only --no-lock --unstable-sloppy-imports --config=\"deno.check.json\" ./src",
    "test:outdatedts": "pnpm build && cd test/outdated-ts && pnpm i && pnpm test",
    "lint:deno": "deno lint --config=\"deno.lint.json\" ./src",
    "prettier": "prettier --write 'src/**/*.ts' 'test/**/*.ts'",
    "build": "pnpm clean && (pnpm build:esm & pnpm build:cjs) && pnpm script:module-fixup && pnpm script:copy-interface-doc",
    "build:esm": "tsc -p tsconfig.json && pnpm script:add-deno-type-references",
    "build:cjs": "tsc -p tsconfig-cjs.json",
    "script:module-fixup": "node scripts/module-fixup.js",
    "script:copy-interface-doc": "node scripts/copy-interface-documentation.js",
    "script:add-deno-type-references": "node scripts/add-deno-type-references.js",
    "script:align-versions": "node --experimental-strip-types scripts/align-versions.mts",
    "script:generate-site-examples": "node scripts/generate-site-examples.js",
    "script:exclude-test-files-for-backwards-compat": "node --experimental-strip-types scripts/exclude-test-files-for-backwards-compat.mts",
    "script:remove-global-augmentations": "node --experimental-strip-types scripts/remove-global-augmentations.mts",
    "prepublishOnly": "pnpm build && pnpm test:exports",
    "version": "pnpm script:align-versions && git add ."
  },
  "author": "Sami Koskimäki <sami@jakso.me>",
  "license": "MIT",
  "contributors": [
    "Sami Koskimäki <sami@jakso.me>",
    "Igal Klebanov <igalklebanov@gmail.com>"
  ],
  "devDependencies": {
    "@arethetypeswrong/cli": "^0.18.2",
    "@ark/attest": "^0.56.0",
    "@types/better-sqlite3": "^7.6.13",
    "@types/chai": "^5.2.3",
    "@types/chai-as-promised": "^8.0.2",
    "@types/mocha": "^10.0.10",
    "@types/node": "^25.5.0",
    "@types/pg": "^8.18.0",
    "@types/pg-cursor": "^2.7.2",
    "@types/semver": "^7.7.1",
    "@types/sinon": "^21.0.0",
    "better-sqlite3": "^12.8.0",
    "chai": "^6.2.2",
    "chai-as-promised": "^8.0.2",
    "esbuild": "^0.27.4",
    "jsr": "^0.14.3",
    "lodash": "^4.17.23",
    "mocha": "^11.7.5",
    "mysql2": "^3.20.0",
    "pathe": "^2.0.3",
    "pg": "^8.20.0",
    "pg-cursor": "^2.19.0",
    "pkg-types": "^2.3.0",
    "playwright": "^1.58.2",
    "prettier": "^3.8.1",
    "semver": "^7.7.4",
    "sinon": "^21.0.3",
    "std-env": "^4.0.0",
    "tarn": "^3.0.2",
    "tedious": "^19.2.1",
    "tsd": "^0.33.0",
    "typescript": "~5.9.3"
  },
  "packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264"
}


================================================
FILE: pnpm-workspace.yaml
================================================
packages:
  - './site'
  - './test/cloudflare-workers'

# Allow (true) or disallow (false) script execution.
# https://pnpm.io/settings#allowbuilds
allowBuilds:
  better-sqlite3@12.8.0: true
  core-js: false # site dependency, useless scripts
  core-js-pure: false # site dependency, useless scripts
  esbuild@0.27.4: true
  sharp: false # wrangler dependency, useless scripts
  workerd@1.20260317.1: true # wrangler@4.75.0 dependency

# All transitive dependencies must be resolved from a trusted source.
# Packages from trusted sources are considered safer, as they are typically subject
# to more reliable verification and scanning for malware and vulnerabilities.
# https://pnpm.io/settings#blockexoticsubdeps
blockExoticSubdeps: true

# The minimum number of minutes that must pass after a version is published before
# pnpm will install it.
# https://pnpm.io/settings#minimumreleaseage
minimumReleaseAge: 1440 # 1 day old in minutes.

# Fail if a package's trust level has decreased compared to previous releases.
# https://pnpm.io/settings#trustpolicy
trustPolicy: no-downgrade

# A list of package selectors that should be excluded from the trust policy check.
# https://pnpm.io/settings#trustpolicyexclude
trustPolicyExclude:
  - semver@5.7.2 || 6.3.1 # tsd@0.20.0 || @docusaurus/core@3.9.2 - https://socket.dev/npm/package/semver/overview/5.7.2 || https://socket.dev/npm/package/semver/overview/6.3.1


================================================
FILE: scripts/add-deno-type-references.js
================================================
/**
 * This scripts adds a `/// <reference types="./file.d.ts" />` directive
 * at the beginning of each ESM JavaScript file so that they work with
 * deno.
 */

const fs = require('fs')
const path = require('path')
const forEachFile = require('./util/for-each-file')

const ESM_DIST_PATH = path.join(__dirname, '..', 'dist', 'esm')

forEachFile(ESM_DIST_PATH, (filePath) => {
  if (filePath.endsWith('.js')) {
    const dTsFile = path.basename(filePath).replace(/\.js$/, '.d.ts')
    const content = fs.readFileSync(filePath, { encoding: 'utf-8' })

    fs.writeFileSync(
      filePath,
      `/// <reference types="./${dTsFile}" />\n${content}`,
    )
  }
})


================================================
FILE: scripts/align-versions.mts
================================================
/**
 * This script aligns docs site package.json AND jsr versions with
 * Kysely's version so we use only the latest published version in the docs and JSR publish.
 */
import { writeFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { dirname, join } from 'pathe'
import jsrJson from '../jsr.json' with { type: 'json' }
import pkgJson from '../package.json' with { type: 'json' }
import sitePkgJson from '../site/package.json' with { type: 'json' }

const __dirname = dirname(fileURLToPath(import.meta.url))

const { version } = pkgJson

writeFileSync(
  join(__dirname, '../site/package.json'),
  JSON.stringify({ ...sitePkgJson, version }, null, 2) + '\n',
)

writeFileSync(
  join(__dirname, '../jsr.json'),
  JSON.stringify({ ...jsrJson, version }, null, 2) + '\n',
)


================================================
FILE: scripts/check-esm-imports.js
================================================
/**
 * This script goes through all source files and makes sure
 * imports end with '.js'. If they don't, the ESM version will
 * not work. ESM imports must have the full file name.
 */

const fs = require('fs')
const path = require('path')
const forEachFile = require('./util/for-each-file')

let errorsFound = false

function checkDir(dir) {
  forEachFile(dir, (filePath) => {
    let errorsFoundInFile = false

    if (filePath.endsWith('.ts')) {
      for (const row of readLines(filePath)) {
        if (isLocalImport(row) && !isDotJsImport(row)) {
          if (!errorsFoundInFile) {
            if (errorsFound) {
              console.log(' ')
            }

            console.log(`invalid imports in file ${filePath}`)
            errorsFoundInFile = true
          }

          console.log(row)
          errorsFound = true
        }
      }
    }
  })
}

function readLines(filePath) {
  const data = fs.readFileSync(filePath).toString('utf-8')
  return data.split('\n')
}

function isLocalImport(row) {
  return /from ['"]\./.test(row)
}

function isDotJsImport(row) {
  return /.js['"][\n\t\s]*$/.test(row)
}

checkDir(path.join(__dirname, '..', 'src'))

if (errorsFound) {
  console.log(' ')
  console.log('check-esm-imports.js failed!')
  process.exit(1)
}


================================================
FILE: scripts/check-exports.js
================================================
/**
 * This script ensures all files in a path are exported in the index.ts file.
 * For now it only checks the operation-node folder, as we've had issues with
 * missing exports there.
 */

const fs = require('node:fs')
const path = require('node:path')
const forEachFile = require('./util/for-each-file')

let errorsFound = false

function checkExports(dir) {
  const indexFileContents = fs.readFileSync(
    path.join(__dirname, '..', 'src/index.ts'),
    'utf-8',
  )

  forEachFile(dir, (filePath) => {
    if (filePath.endsWith('.ts')) {
      const expectedExportPath = filePath.replace(
        /^.+\/src\/(.+)\.ts$/,
        "'./$1.js'",
      )

      if (!indexFileContents.includes(expectedExportPath)) {
        console.log(`Missing export: ${expectedExportPath}`)
        errorsFound = true
      }
    }
  })
}

checkExports(path.join(__dirname, '..', 'src/operation-node'))

if (errorsFound) {
  console.log(' ')
  console.log('check-exports.js failed!')
  process.exit(1)
}


================================================
FILE: scripts/copy-interface-documentation.js
================================================
/**
 * This script goes through all generated type definition files and copies
 * method/property documentation from interfaces to the implementing methods
 * IF the implementation doesn't have its own documentation.
 *
 * This is done for convenience: users can cmd-click method names and immediately
 * see the documentation. If we don't do this, users need to cmd-click the method
 * and then manually find the correct interface that contains the documentation.
 *
 * Hovering over a method/property works even without this script, but not all
 * people are happy reading docs from the small hovering window.
 */

const fs = require('fs')
const path = require('path')
const forEachFile = require('./util/for-each-file')

const DIST_PATH = path.join(__dirname, '..', 'dist')

const PROPERTY_REGEX = /^\s+(?:get )?(?:readonly )?(?:abstract )?(\w+)[\(:<]/
const OBJECT_REGEXES = [
  /^(?:export )?declare (?:abstract )?class (\w+)/,
  /^(?:export )?interface (\w+)/,
]
const GENERIC_ARGUMENTS_REGEX = /<[\w"'`,{}=|\[\] ]+>/g
const JSDOC_START_REGEX = /^\s+\/\*\*/
const JSDOC_END_REGEX = /^\s+\*\//

function main() {
  for (const distSubDir of ['cjs', 'esm']) {
    const subDirPath = path.join(DIST_PATH, distSubDir)
    const files = []

    if (!fs.existsSync(subDirPath)) {
      continue
    }

    forEachFile(subDirPath, (filePath) => {
      if (filePath.endsWith('.d.ts')) {
        const file = {
          path: filePath,
          lines: readLines(filePath),
        }

        file.objects = parseObjects(file)

        if (file.objects.length > 0) {
          files.push(file)
        }
      }
    })

    copyDocumentation(files)
  }
}

function readLines(filePath) {
  const data = fs.readFileSync(filePath).toString('utf-8')
  return data.split('\n')
}

/**
 * Parses all object (class, interface) declarations from the given
 * type declaration file.
 */
function parseObjects(file) {
  const objects = []
  let lineIdx = 0

  while (lineIdx < file.lines.length) {
    for (const regex of OBJECT_REGEXES) {
      const objectMatch = regex.exec(file.lines[lineIdx])

      if (objectMatch) {
        const object = {
          name: objectMatch[1],
          lineIdx,
          implements: parseImplements(file.lines[lineIdx]),
          properties: [],
        }

        while (!file.lines[++lineIdx].startsWith('}')) {
          const propertyMatch = PROPERTY_REGEX.exec(file.lines[lineIdx])

          if (propertyMatch) {
            const property = {
              name: propertyMatch[1],
              lineIdx: lineIdx,
              doc: parseDocumentation(file.lines, lineIdx),
            }

            Object.defineProperty(property, 'object', { value: object })
            object.properties.push(property)
          }
        }

        Object.defineProperty(object, 'file', { value: file })
        objects.push(object)

        continue
      }
    }

    ++lineIdx
  }

  return objects
}

/**
 * Given an object declaration line like
 *
 *   export class A extends B implements C, D<number> {
 *
 * or
 *
 *   interface A<T> extends B<T> {
 *
 * extracts the names of the extended and implemented objects.
 * The first example would return ['B', 'C', 'D'] and the second
 * would return ['B'].
 */
function parseImplements(line) {
  if (!line.endsWith('{')) {
    console.warn(
      `skipping object declaration "${line}". Expected it to end with "{"'`,
    )
    return []
  }

  // Remove { from the end.
  line = line.substring(0, line.length - 1)

  // Strip generics. We need to do this in a loop to strip nested generics.
  while (line.includes('<')) {
    let strippedLine = line.replace(GENERIC_ARGUMENTS_REGEX, '')

    if (strippedLine === line) {
      console.warn(`unable to strip generics from "${line}"`)
      return []
    }

    line = strippedLine
  }

  if (line.includes('extends')) {
    line = line.split('extends')[1].replace('implements', ',')
  } else if (line.includes('implements')) {
    line = line.split('implements')[1]
  } else {
    return []
  }

  return line.split(',').map((it) => it.trim())
}

/**
 * Given the line index of a property (method, getter) declaration
 * extracts the jsdoc comment above it if one exists.
 */
function parseDocumentation(lines, propertyLineIdx) {
  const doc = []
  let lineIdx = propertyLineIdx - 1

  if (JSDOC_END_REGEX.test(lines[lineIdx])) {
    doc.push(lines[lineIdx])
    --lineIdx

    while (!JSDOC_START_REGEX.test(lines[lineIdx])) {
      doc.push(lines[lineIdx])
      --lineIdx
    }

    doc.push(lines[lineIdx])
    return doc.reverse()
  }

  return undefined
}

function copyDocumentation(files) {
  for (const file of files) {
    for (const object of file.objects) {
      const undocumentedProperties = new Set()

      // Only keep one undocumented property by same name.
      object.properties = object.properties.filter((it) => {
        if (it.doc) {
          return true
        }

        if (undocumentedProperties.has(it.name)) {
          return false
        }

        undocumentedProperties.add(it.name)
        return true
      })
    }
  }

  for (const file of files) {
    for (const object of file.objects.slice().reverse()) {
      for (const property of object.properties.slice().reverse()) {
        if (!property.doc) {
          const docProperty = findDocProperty(files, object, property.name)

          if (docProperty) {
            file.lines.splice(property.lineIdx, 0, ...docProperty.doc)
          }
        }
      }
    }

    fs.writeFileSync(file.path, file.lines.join('\n'))
  }
}

function findDocProperty(files, object, propertyName) {
  for (const interfaceName of object.implements) {
    const interfaceObject = findObject(files, interfaceName)

    if (!interfaceObject) {
      continue
    }

    const interfaceProperty = interfaceObject.properties.find(
      (it) => it.name === propertyName,
    )

    if (interfaceProperty?.doc) {
      return interfaceProperty
    }

    // Search all parents even if this object didn't have the
    // proprty. It may be defined and documented in an ancestor.
    const doc = findDocProperty(files, interfaceObject, propertyName)

    if (doc) {
      return doc
    }
  }

  return undefined
}

function findObject(files, objectName) {
  for (const file of files) {
    for (const object of file.objects) {
      if (object.name === objectName) {
        return object
      }
    }
  }

  return undefined
}

main()


================================================
FILE: scripts/exclude-test-files-for-backwards-compat.mts
================================================
import { unlink } from 'node:fs/promises'
import { dirname, resolve } from 'pathe'
import { readPackageJSON, readTSConfig, writeTSConfig } from 'pkg-types'
import { lt } from 'semver'

const { devDependencies } = await readPackageJSON()

const typescriptVersion = devDependencies!.typescript.replace(/^[~^]/, '')

console.log('typescriptVersion', typescriptVersion)

if (lt(typescriptVersion, '5.2.0')) {
  const tsconfigPath = resolve(
    dirname(new URL(import.meta.url).pathname),
    '../test/node/tsconfig.json',
  )

  const tsconfig = await readTSConfig(tsconfigPath)

  const updatedTSConfig = {
    ...tsconfig,
    // `using` keyword support was only added in 5.2.0
    exclude: (tsconfig.exclude || []).concat('src/async-dispose.test.ts'),
  }

  await writeTSConfig(tsconfigPath, updatedTSConfig)

  console.log(
    `Updated ${tsconfigPath} to exclude async-dispose.test.ts`,
    JSON.stringify(updatedTSConfig, null, 2),
  )
}

if (lt(typescriptVersion, '5.4.0')) {
  // inference from generics was only fixed in 5.4.0, before that you had to explicitly pass type arguments, and the inferred results were wider.
  const typingsTestFilePath = resolve(
    dirname(new URL(import.meta.url).pathname),
    '../test/typings/test-d/generic.test-d.ts',
  )

  await unlink(typingsTestFilePath)

  console.log(`Deleted ${typingsTestFilePath}`)
}


================================================
FILE: scripts/generate-site-examples.js
================================================
/**
 * This script goes through all generated type definitions and creates
 * playground examples in the site for all code examples that are
 * annotated using the `<!-- siteExample(category: string, name: string, prority: int) -->
 * comment.
 */

const fs = require('fs')
const path = require('path')
const forEachFile = require('./util/for-each-file')
const _ = require('lodash')

const ESM_PATH = path.join(__dirname, '..', 'dist', 'esm')
const SITE_EXAMPLE_PATH = path.join(__dirname, '..', 'site', 'docs', 'examples')

const SITE_EXAMPLE_START_REGEX = /<!--\s*siteExample\(/
const SITE_EXAMPLE_ANNOTATION_REGEX =
  /<!--\s*siteExample\("([^"]+)",\s*"([^"]+)",\s*(\d+)\s*\)\s*-->/

const CODE_BLOCK_START_REGEX = /\*\s*```/
const CODE_BLOCK_END_REGEX = /\*\s*```/
const COMMENT_LINE_REGEX = /\*\s*(.*)/
const CODE_LINE_REGEX = /\*(.*)/

const moreExamplesByCategory = {
  select: {
    'select method':
      'https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select',
    'selectAll method':
      'https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll',
    'selectFrom method':
      'https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom',
  },
  where: {
    'where method':
      'https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#where',
    'whereRef method':
      'https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#whereRef',
  },
  join: {
    'innerJoin method':
      'https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#innerJoin',
    'leftJoin method':
      'https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#leftJoin',
    'rightJoin method':
      'https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#rightJoin',
    'fullJoin method':
      'https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#fullJoin',
  },
  insert: {
    'values method':
      'https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#values',
    'onConflict method':
      'https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#onConflict',
    'returning method':
      'https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#returning',
    'insertInto method':
      'https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#insertInto',
  },
  update: {
    'set method':
      'https://kysely-org.github.io/kysely-apidoc/classes/UpdateQueryBuilder.html#set',
    'returning method':
      'https://kysely-org.github.io/kysely-apidoc/classes/UpdateQueryBuilder.html#returning',
    'updateTable method':
      'https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#updateTable',
  },
  delete: {
    'deleteFrom method':
      'https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#deleteFrom',
    'returning method':
      'https://kysely-org.github.io/kysely-apidoc/classes/DeleteQueryBuilder.html#returning',
  },
  merge: {
    'mergeInto method':
      'https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#mergeInto',
    'using method':
      'https://kysely-org.github.io/kysely-apidoc/classes/MergeQueryBuilder.html#using',
    'whenMatched method':
      'https://kysely-org.github.io/kysely-apidoc/classes/WheneableMergeQueryBuilder.html#whenMatched',
    'thenUpdateSet method':
      'https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenUpdateSet',
    'thenDelete method':
      'https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenDelete',
    'thenDoNothing method':
      'https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenDoNothing',
    'whenNotMatched method':
      'https://kysely-org.github.io/kysely-apidoc/classes/WheneableMergeQueryBuilder.html#whenNotMatched',
    'thenInsertValues method':
      'https://kysely-org.github.io/kysely-apidoc/classes/NotMatchedThenableMergeQueryBuilder.html#thenInsertValues',
  },
  transactions: {
    'transaction method':
      'https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#transaction',
  },
}

function main() {
  deleteAllExamples()

  forEachFile(ESM_PATH, (filePath) => {
    if (!filePath.endsWith('.d.ts')) {
      return
    }

    const lines = readLines(filePath)
    const state = {
      filePath,
      /** @type {string | null} */
      line: null,
      lineIndex: 0,
      annotation: null,
      inExample: false,
      inCodeBlock: false,
      commentLines: [],
      codeLines: [],
    }

    for (let l = 0; l < lines.length; ++l) {
      state.line = lines[l]
      state.lineIndex = l + 1

      if (state.inExample) {
        if (state.inCodeBlock) {
          if (isCodeBlockEnd(state)) {
            writeSiteExample(state)
            exitExample(state)
          } else {
            addCodeLine(state)
          }
        } else if (isCodeBlockStart(state)) {
          enterCodeBlock(state)
        } else {
          addCommentLine(state)
        }
      } else if (isExampleStart(state)) {
        enterExample(state)
      }
    }
  })

  overwritePlaygroundTypes()
}

function deleteAllExamples() {
  for (const category of fs.readdirSync(SITE_EXAMPLE_PATH)) {
    const folderPath = path.join(SITE_EXAMPLE_PATH, category)

    if (!fs.statSync(folderPath).isFile()) {
      for (const file of fs.readdirSync(folderPath)) {
        const filePath = path.join(folderPath, file)

        if (file.endsWith('.js') || file.endsWith('.mdx')) {
          fs.unlinkSync(filePath)
        }
      }
    }
  }
}

function readLines(filePath) {
  const data = fs.readFileSync(filePath).toString('utf-8')
  return data.split('\n')
}

function isCodeBlockEnd(state) {
  return CODE_BLOCK_END_REGEX.test(state.line)
}

function writeSiteExample(state) {
  const [, category, name, priority] = state.annotation
  const code = trimEmptyLines(state.codeLines).join('\n')
  const comment = trimEmptyLines(state.commentLines).join('\n')
  const codeVariable = _.camelCase(name)

  const fileName = `${priority.padStart(4, '0')}-${_.kebabCase(name)}`
  const folderPath = path.join(SITE_EXAMPLE_PATH, category)
  const filePath = path.join(folderPath, fileName)

  const codeFile = `export const ${codeVariable} = \`${deindent(code)
    .replaceAll('`', '\\`')
    .replaceAll('${', '\\${')}\``

  const parts = [
    deindent(`
      ---
      title: '${name}'
      ---

      # ${name}
    `),
  ]

  if (comment?.trim()) {
    parts.push(comment, '')
  }

  parts.push(
    deindent(`
      import { Playground } from '../../../src/components/Playground'

      import {
        ${codeVariable}
      } from './${fileName}'

      <div style={{ marginBottom: '1em' }}>
        <Playground code={${codeVariable}} />
      </div>
    `),
  )

  const moreExamples = buildMoreExamplesMarkdown(category)
  if (moreExamples?.trim()) {
    parts.push(moreExamples)
  }

  const exampleFile = parts.join('\n')

  if (!fs.existsSync(folderPath)) {
    fs.mkdirSync(folderPath, { recursive: true })
    fs.writeFileSync(
      path.join(folderPath, '_category_.json'),
      `{
  "label": "${_.startCase(category)}",
  "position": 0, // TODO: set the position of the category.
  "link": {
    "type": "generated-index",
    "description": "Short and simple examples of using the ${category} functionality." // TODO: review this.
  }
}`,
    )
  }

  fs.writeFileSync(filePath + '.js', codeFile, {})
  fs.writeFileSync(filePath + '.mdx', exampleFile)
}

function buildMoreExamplesMarkdown(category) {
  const links = moreExamplesByCategory[category]
  if (!links) {
    return undefined
  }

  const lines = [
    ':::info[More examples]',
    'The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),',
    'but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always',
    'just one hover away!',
    '',
    'For example, check out these sections:',
  ]

  for (const linkName of Object.keys(links)) {
    lines.push(` - [${linkName}](${links[linkName]})`)
  }

  lines.push(':::\n')

  return lines.join('\n')
}

function exitExample(state) {
  state.annotation = null
  state.inExample = false
  state.inCodeBlock = false
  state.commentLines = []
  state.codeLines = []
}

function addCodeLine(state) {
  const code = CODE_LINE_REGEX.exec(state.line)

  if (!code) {
    console.error(
      `found invalid code block in a site example in ${state.filePath}:${state.lineIndex}`,
    )

    process.exit(1)
  }

  state.codeLines.push(code[1])
}

function isCodeBlockStart(state) {
  return CODE_BLOCK_START_REGEX.test(state.line)
}

function enterCodeBlock(state) {
  state.inCodeBlock = true
}

function addCommentLine(state) {
  const comment = COMMENT_LINE_REGEX.exec(state.line)

  if (!comment) {
    console.error(
      `found invalid comment in a site example in ${state.filePath}:${state.lineIndex}`,
    )

    process.exit(1)
  }

  state.commentLines.push(comment[1])
}

function isExampleStart(state) {
  return SITE_EXAMPLE_START_REGEX.test(state.line)
}

function enterExample(state) {
  state.annotation = SITE_EXAMPLE_ANNOTATION_REGEX.exec(state.line)

  if (!state.annotation) {
    console.error(
      `found invalid site example annotation in ${state.filePath}:${state.lineIndex}`,
    )

    process.exit(1)
  }

  state.inExample = true
}

function deindent(str) {
  let lines = str.split('\n')

  // Remove empty lines from the beginning.
  while (lines[0].trim().length === 0) {
    lines = lines.slice(1)
  }

  let ws = Number.MAX_SAFE_INTEGER
  for (const line of lines) {
    if (line.trim().length > 0) {
      const [, wsExec] = /^(\s*)/.exec(line) || []

      if (wsExec != null && wsExec.length < ws) {
        ws = wsExec.length
      }
    }
  }

  return lines.map((line) => line.substring(ws)).join('\n')
}

function trimEmptyLines(lines) {
  while (lines.length && lines[0].trim().length === 0) {
    lines = lines.slice(1)
  }

  while (lines.length && lines[lines.length - 1].trim().length === 0) {
    lines = lines.slice(0, lines.length - 1)
  }

  return lines
}

function overwritePlaygroundTypes() {
  const jsdocsTestTypes = fs.readFileSync(
    path.join(__dirname, '../deno.check.d.ts'),
    { encoding: 'utf-8' },
  )

  const playgroundTypes = `// THIS FILE IS GENERATED BY \`${path.relative('.', __filename)}\`
// DO NOT EDIT THIS FILE DIRECTLY
export const GENERATED_PLAYGROUND_EXAMPLE_TYPES = \`${jsdocsTestTypes
    .replace(/['"`].*dist\/.*['"`]/g, "'kysely'")
    .replaceAll('`', '\\`')}\`;`

  fs.writeFileSync(
    path.join(__dirname, '../site/src/components/playground-example-types.ts'),
    playgroundTypes,
    { encoding: 'utf-8' },
  )
}

main()


================================================
FILE: scripts/module-fixup.js
================================================
/**
 * Adds a package.json file to both commonjs and ESM distribution
 * folders with a correct module type. This is needed in order to
 * be able to export both commonjs and ESM versions.
 *
 * This script also creates a dummy files for all `exports` in the
 * package.json to make CJS happy.
 */

const fs = require('fs')
const path = require('path')
const package = require('../package.json')

const ROOT_PATH = path.join(__dirname, '..')
const DIST_PATH = path.join(ROOT_PATH, 'dist')

for (const [folder, type] of [
  ['cjs', 'commonjs'],
  ['esm', 'module'],
]) {
  fs.writeFileSync(
    path.join(DIST_PATH, folder, 'package.json'),
    JSON.stringify({ type, sideEffects: false }),
  )
}

for (const ex of Object.keys(package.exports)) {
  if (ex === '.') {
    continue
  }

  const [, ...folders] = ex.split('/')
  const fileName = folders.pop()

  const [, ...targetFolders] = package.exports[ex].require.split('/')
  const targetFileName = targetFolders.pop()
  const target = path.posix.relative(
    path.posix.join(ROOT_PATH, ...folders),
    path.posix.join(ROOT_PATH, ...targetFolders, targetFileName),
  )

  fs.mkdirSync(path.join(ROOT_PATH, ...folders), {
    recursive: true,
  })

  fs.writeFileSync(
    path.join(ROOT_PATH, ...folders, fileName + '.js'),
    `module.exports = require('${target}')`,
  )

  fs.writeFileSync(
    path.join(ROOT_PATH, ...folders, fileName + '.d.ts'),
    `export * from '${target}'`,
  )
}


================================================
FILE: scripts/remove-global-augmentations.mts
================================================
/**
 * This script removes global augmentations so we could publish to JSR.
 * https://github.com/denoland/deno/issues/23427
 */
import { readFileSync, writeFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { dirname, join } from 'pathe'
import ts from 'typescript'

const __dirname = dirname(fileURLToPath(import.meta.url))

const kyselyTSPath = join(__dirname, '../src/kysely.ts')

const sourceCode = readFileSync(kyselyTSPath, 'utf8')

const sourceFile = ts.createSourceFile(
  kyselyTSPath,
  sourceCode,
  ts.ScriptTarget.Latest,
  true,
)

const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed })

const nodesToRemove = new Set<ts.Node>()

function visit(node: ts.Node) {
  if (ts.isModuleDeclaration(node) && node.name.text === 'global') {
    return nodesToRemove.add(node)
  }

  ts.forEachChild(node, visit)
}

visit(sourceFile)

const newStatements = sourceFile.statements.filter(
  (stmt) => !nodesToRemove.has(stmt),
)

const newSourceFile = ts.factory.updateSourceFile(sourceFile, newStatements)

const result = printer.printFile(newSourceFile)

writeFileSync(kyselyTSPath, result, 'utf8')


================================================
FILE: scripts/tsconfig.json
================================================
{
  "extends": "../tsconfig-base.json",
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "module": "ESNext",
    "resolveJsonModule": true
  },
  "include": ["./"]
}


================================================
FILE: scripts/util/for-each-file.js
================================================
const fs = require('fs')
const path = require('path')

function forEachFile(dir, callback) {
  const files = fs.readdirSync(dir).filter((it) => it !== '.' && it !== '..')

  for (const file of files) {
    const filePath = path.join(dir, file)

    if (isDir(filePath)) {
      forEachFile(filePath, callback)
    } else {
      callback(filePath)
    }
  }
}

function isDir(file) {
  return fs.lstatSync(file).isDirectory()
}

module.exports = forEachFile


================================================
FILE: site/.gitignore
================================================
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vercel


================================================
FILE: site/babel.config.js
================================================
module.exports = {
  presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
}


================================================
FILE: site/docs/dialects.md
================================================
# Dialects

A dialect is the glue between Kysely and the underlying database engine. Check the [API docs](https://kysely-org.github.io/kysely-apidoc/interfaces/Dialect.html) to learn how to build your own.

## Core dialects

| Dialect | Link |
| --- | --- |
| PostgreSQL | https://kysely-org.github.io/kysely-apidoc/classes/PostgresDialect.html |
| MySQL | https://kysely-org.github.io/kysely-apidoc/classes/MysqlDialect.html |
| Microsoft SQL Server (MSSQL) | https://kysely-org.github.io/kysely-apidoc/classes/MssqlDialect.html |
| SQLite | https://kysely-org.github.io/kysely-apidoc/classes/SqliteDialect.html |

## Organization dialects

| Dialect | Link |
| --- | --- |
| Postgres.js | https://github.com/kysely-org/kysely-postgres-js |
| SingleStore Data API | https://github.com/kysely-org/kysely-singlestore |

## Community dialects

| Dialect                       | Link                                                                        |
|-------------------------------|-----------------------------------------------------------------------------|
| PlanetScale Serverless Driver | https://github.com/depot/kysely-planetscale                                 |
| Cloudflare D1                 | https://github.com/aidenwallis/kysely-d1                                    |
| Cloudflare Durable Objects    | https://github.com/benallfree/kysely-do                                     |
| AWS RDS Data API              | https://github.com/serverless-stack/kysely-data-api                         |
| SurrealDB                     | https://github.com/igalklebanov/kysely-surrealdb                            |
| Neon                          | https://github.com/seveibar/kysely-neon                                     |
| Xata                          | https://github.com/xataio/client-ts/tree/main/packages/plugin-client-kysely |
| AWS S3 Select                 | https://github.com/igalklebanov/kysely-s3-select                            |
| libSQL/sqld                   | https://github.com/libsql/kysely-libsql                                     |
| Fetch driver                  | https://github.com/andersgee/kysely-fetch-driver                            |
| SQLite WASM                   | https://github.com/DallasHoff/sqlocal                                       |
| Deno SQLite                   | https://gitlab.com/soapbox-pub/kysely-deno-sqlite                           |
| Node SQLite                   | https://github.com/wolfie/kysely-node-native-sqlite                         |
| TiDB Cloud Serverless Driver  | https://github.com/tidbcloud/kysely                                         |
| Capacitor SQLite Kysely       | https://github.com/DawidWetzler/capacitor-sqlite-kysely                     |
| BigQuery                      | https://github.com/maktouch/kysely-bigquery                                 |
| Clickhouse                    | https://github.com/founderpathcom/kysely-clickhouse                         |
| PGLite                        | https://github.com/czeidler/kysely-pglite-dialect                           |
| Oracle                        | https://github.com/griffiths-waite/kysely-oracledb                          |
| Firebird                      | https://github.com/benkoppe/kysely-firebird                                 |
| MariaDB                       | https://github.com/awaludinar/kysely-mariadb                                |


================================================
FILE: site/docs/examples/_category_.json
================================================
{
  "label": "Examples",
  "position": 5,
  "link": {
    "type": "generated-index",
    "description": "Short and simple examples of how to use Kysely to achieve common tasks."
  }
}


================================================
FILE: site/docs/examples/cte/0010-simple-selects.js
================================================
export const simpleSelects = `const result = await db
  // Create a CTE called \`jennifers\` that selects all
  // persons named 'Jennifer'.
  .with('jennifers', (db) => db
    .selectFrom('person')
    .where('first_name', '=', 'Jennifer')
    .select(['id', 'age'])
  )
  // Select all rows from the \`jennifers\` CTE and
  // further filter it.
  .with('adult_jennifers', (db) => db
    .selectFrom('jennifers')
    .where('age', '>', 18)
    .select(['id', 'age'])
  )
  // Finally select all adult jennifers that are
  // also younger than 60.
  .selectFrom('adult_jennifers')
  .where('age', '<', 60)
  .selectAll()
  .execute()`

================================================
FILE: site/docs/examples/cte/0010-simple-selects.mdx
================================================
---
title: 'Simple selects'
---

# Simple selects

Common table expressions (CTE) are a great way to modularize complex queries.
Essentially they allow you to run multiple separate queries within a
single roundtrip to the DB.

Since CTEs are a part of the main query, query optimizers inside DB
engines are able to optimize the overall query. For example, postgres
is able to inline the CTEs inside the using queries if it decides it's
faster.

import { Playground } from '../../../src/components/Playground'

import {
  simpleSelects
} from './0010-simple-selects'

<div style={{ marginBottom: '1em' }}>
  <Playground code={simpleSelects} />
</div>


================================================
FILE: site/docs/examples/cte/0020-inserts-updates-and-deletions.js
================================================
export const insertsUpdatesAndDeletions = `const result = await db
  .with('new_person', (db) => db
    .insertInto('person')
    .values({
      first_name: 'Jennifer',
      age: 35,
    })
    .returning('id')
  )
  .with('new_pet', (db) => db
    .insertInto('pet')
    .values({
      name: 'Doggo',
      species: 'dog',
      is_favorite: true,
      // Use the id of the person we just inserted.
      owner_id: db
        .selectFrom('new_person')
        .select('id')
    })
    .returning('id')
  )
  .selectFrom(['new_person', 'new_pet'])
  .select([
    'new_person.id as person_id',
    'new_pet.id as pet_id'
  ])
  .execute()`

================================================
FILE: site/docs/examples/cte/0020-inserts-updates-and-deletions.mdx
================================================
---
title: 'Inserts, updates and deletions'
---

# Inserts, updates and deletions

Some databases like postgres also allow you to run other queries than selects
in CTEs. On these databases CTEs are extremely powerful:

import { Playground } from '../../../src/components/Playground'

import {
  insertsUpdatesAndDeletions
} from './0020-inserts-updates-and-deletions'

<div style={{ marginBottom: '1em' }}>
  <Playground code={insertsUpdatesAndDeletions} />
</div>


================================================
FILE: site/docs/examples/cte/_category_.json
================================================
{
  "label": "CTE",
  "position": 9,
  "link": {
    "type": "generated-index",
    "description": "Short and simple examples of how to use Common Table Expressions (CTE) in queries."
  }
}


================================================
FILE: site/docs/examples/delete/0010-single-row.js
================================================
export const singleRow = `const result = await db
  .deleteFrom('person')
  .where('person.id', '=', 1)
  .executeTakeFirst()

console.log(result.numDeletedRows)`

================================================
FILE: site/docs/examples/delete/0010-single-row.mdx
================================================
---
title: 'Single row'
---

# Single row

Delete a single row:

import { Playground } from '../../../src/components/Playground'

import {
  singleRow
} from './0010-single-row'

<div style={{ marginBottom: '1em' }}>
  <Playground code={singleRow} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [deleteFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#deleteFrom)
 - [returning method](https://kysely-org.github.io/kysely-apidoc/classes/DeleteQueryBuilder.html#returning)
:::


================================================
FILE: site/docs/examples/delete/_category_.json
================================================
{
  "label": "DELETE",
  "position": 6,
  "link": {
    "type": "generated-index",
    "description": "Short and simple examples of how to write DELETE queries."
  }
}


================================================
FILE: site/docs/examples/insert/0010-single-row.js
================================================
export const singleRow = `const result = await db
  .insertInto('person')
  .values({
    first_name: 'Jennifer',
    last_name: 'Aniston',
    age: 40
  })
  .executeTakeFirst()

// \`insertId\` is only available on dialects that
// automatically return the id of the inserted row
// such as MySQL and SQLite. On PostgreSQL, for example,
// you need to add a \`returning\` clause to the query to
// get anything out. See the "returning data" example.
console.log(result.insertId)`

================================================
FILE: site/docs/examples/insert/0010-single-row.mdx
================================================
---
title: 'Single row'
---

# Single row

Insert a single row:

import { Playground } from '../../../src/components/Playground'

import {
  singleRow
} from './0010-single-row'

<div style={{ marginBottom: '1em' }}>
  <Playground code={singleRow} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [values method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#values)
 - [onConflict method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#onConflict)
 - [returning method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#returning)
 - [insertInto method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#insertInto)
:::


================================================
FILE: site/docs/examples/insert/0020-multiple-rows.js
================================================
export const multipleRows = `await db
  .insertInto('person')
  .values([{
    first_name: 'Jennifer',
    last_name: 'Aniston',
    age: 40,
  }, {
    first_name: 'Arnold',
    last_name: 'Schwarzenegger',
    age: 70,
  }])
  .execute()`

================================================
FILE: site/docs/examples/insert/0020-multiple-rows.mdx
================================================
---
title: 'Multiple rows'
---

# Multiple rows

On dialects that support it (for example PostgreSQL) you can insert multiple
rows by providing an array. Note that the return value is once again very
dialect-specific. Some databases may only return the id of the *last* inserted
row and some return nothing at all unless you call `returning`.

import { Playground } from '../../../src/components/Playground'

import {
  multipleRows
} from './0020-multiple-rows'

<div style={{ marginBottom: '1em' }}>
  <Playground code={multipleRows} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [values method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#values)
 - [onConflict method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#onConflict)
 - [returning method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#returning)
 - [insertInto method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#insertInto)
:::


================================================
FILE: site/docs/examples/insert/0030-returning-data.js
================================================
export const returningData = `const result = await db
  .insertInto('person')
  .values({
    first_name: 'Jennifer',
    last_name: 'Aniston',
    age: 40,
  })
  .returning(['id', 'first_name as name'])
  .executeTakeFirstOrThrow()`

================================================
FILE: site/docs/examples/insert/0030-returning-data.mdx
================================================
---
title: 'Returning data'
---

# Returning data

On supported dialects like PostgreSQL you need to chain `returning` to the query to get
the inserted row's columns (or any other expression) as the return value. `returning`
works just like `select`. Refer to `select` method's examples and documentation for
more info.

import { Playground } from '../../../src/components/Playground'

import {
  returningData
} from './0030-returning-data'

<div style={{ marginBottom: '1em' }}>
  <Playground code={returningData} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [values method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#values)
 - [onConflict method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#onConflict)
 - [returning method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#returning)
 - [insertInto method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#insertInto)
:::


================================================
FILE: site/docs/examples/insert/0040-complex-values.js
================================================
export const complexValues = `import { sql } from 'kysely'

const ani = "Ani"
const ston = "ston"

const result = await db
  .insertInto('person')
  .values(({ ref, selectFrom, fn }) => ({
    first_name: 'Jennifer',
    last_name: sql<string>\`concat(\${ani}, \${ston})\`,
    middle_name: ref('first_name'),
    age: selectFrom('person')
      .select(fn.avg<number>('age').as('avg_age')),
  }))
  .executeTakeFirst()`

================================================
FILE: site/docs/examples/insert/0040-complex-values.mdx
================================================
---
title: 'Complex values'
---

# Complex values

In addition to primitives, the values can also be arbitrary expressions.
You can build the expressions by using a callback and calling the methods
on the expression builder passed to it:

import { Playground } from '../../../src/components/Playground'

import {
  complexValues
} from './0040-complex-values'

<div style={{ marginBottom: '1em' }}>
  <Playground code={complexValues} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [values method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#values)
 - [onConflict method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#onConflict)
 - [returning method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#returning)
 - [insertInto method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#insertInto)
:::


================================================
FILE: site/docs/examples/insert/0050-insert-subquery.js
================================================
export const insertSubquery = `const result = await db.insertInto('person')
  .columns(['first_name', 'last_name', 'age'])
  .expression((eb) => eb
    .selectFrom('pet')
    .select((eb) => [
      'pet.name',
      eb.val('Petson').as('last_name'),
      eb.lit(7).as('age'),
    ])
  )
  .execute()`

================================================
FILE: site/docs/examples/insert/0050-insert-subquery.mdx
================================================
---
title: 'Insert subquery'
---

# Insert subquery

You can create an `INSERT INTO SELECT FROM` query using the `expression` method.
This API doesn't follow our WYSIWYG principles and might be a bit difficult to
remember. The reasons for this design stem from implementation difficulties.

import { Playground } from '../../../src/components/Playground'

import {
  insertSubquery
} from './0050-insert-subquery'

<div style={{ marginBottom: '1em' }}>
  <Playground code={insertSubquery} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [values method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#values)
 - [onConflict method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#onConflict)
 - [returning method](https://kysely-org.github.io/kysely-apidoc/classes/InsertQueryBuilder.html#returning)
 - [insertInto method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#insertInto)
:::


================================================
FILE: site/docs/examples/insert/_category_.json
================================================
{
  "label": "INSERT",
  "position": 4,
  "link": {
    "type": "generated-index",
    "description": "Short and simple examples of how to write INSERT queries."
  }
}


================================================
FILE: site/docs/examples/join/0010-simple-inner-join.js
================================================
export const simpleInnerJoin = `const result = await db
  .selectFrom('person')
  .innerJoin('pet', 'pet.owner_id', 'person.id')
  // \`select\` needs to come after the call to \`innerJoin\` so
  // that you can select from the joined table.
  .select(['person.id', 'pet.name as pet_name'])
  .execute()`

================================================
FILE: site/docs/examples/join/0010-simple-inner-join.mdx
================================================
---
title: 'Simple inner join'
---

# Simple inner join

Simple `inner join`s can be done by providing a table name and two columns to join:

import { Playground } from '../../../src/components/Playground'

import {
  simpleInnerJoin
} from './0010-simple-inner-join'

<div style={{ marginBottom: '1em' }}>
  <Playground code={simpleInnerJoin} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [innerJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#innerJoin)
 - [leftJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#leftJoin)
 - [rightJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#rightJoin)
 - [fullJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#fullJoin)
:::


================================================
FILE: site/docs/examples/join/0020-aliased-inner-join.js
================================================
export const aliasedInnerJoin = `await db.selectFrom('person')
  .innerJoin('pet as p', 'p.owner_id', 'person.id')
  .where('p.name', '=', 'Doggo')
  .selectAll()
  .execute()`

================================================
FILE: site/docs/examples/join/0020-aliased-inner-join.mdx
================================================
---
title: 'Aliased inner join'
---

# Aliased inner join

You can give an alias for the joined table like this:

import { Playground } from '../../../src/components/Playground'

import {
  aliasedInnerJoin
} from './0020-aliased-inner-join'

<div style={{ marginBottom: '1em' }}>
  <Playground code={aliasedInnerJoin} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [innerJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#innerJoin)
 - [leftJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#leftJoin)
 - [rightJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#rightJoin)
 - [fullJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#fullJoin)
:::


================================================
FILE: site/docs/examples/join/0030-complex-join.js
================================================
export const complexJoin = `await db.selectFrom('person')
  .innerJoin(
    'pet',
    (join) => join
      .onRef('pet.owner_id', '=', 'person.id')
      .on('pet.name', '=', 'Doggo')
      .on((eb) => eb.or([
        eb('person.age', '>', 18),
        eb('person.age', '<', 100)
      ]))
  )
  .selectAll()
  .execute()`

================================================
FILE: site/docs/examples/join/0030-complex-join.mdx
================================================
---
title: 'Complex join'
---

# Complex join

You can provide a function as the second argument to get a join
builder for creating more complex joins. The join builder has a
bunch of `on*` methods for building the `on` clause of the join.
There's basically an equivalent for every `where` method
(`on`, `onRef` etc.).

You can do all the same things with the
`on` method that you can with the corresponding `where` method (like [OR expressions for example](https://kysely.dev/docs/examples/WHERE/or-where)).
See the `where` method documentation for more examples.

import { Playground } from '../../../src/components/Playground'

import {
  complexJoin
} from './0030-complex-join'

<div style={{ marginBottom: '1em' }}>
  <Playground code={complexJoin} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [innerJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#innerJoin)
 - [leftJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#leftJoin)
 - [rightJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#rightJoin)
 - [fullJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#fullJoin)
:::


================================================
FILE: site/docs/examples/join/0040-subquery-join.js
================================================
export const subqueryJoin = `const result = await db.selectFrom('person')
  .innerJoin(
    (eb) => eb
      .selectFrom('pet')
      .select(['owner_id as owner', 'name'])
      .where('name', '=', 'Doggo')
      .as('doggos'),
    (join) => join
      .onRef('doggos.owner', '=', 'person.id'),
  )
  .selectAll('doggos')
  .execute()`

================================================
FILE: site/docs/examples/join/0040-subquery-join.mdx
================================================
---
title: 'Subquery join'
---

# Subquery join

You can join a subquery by providing two callbacks:

import { Playground } from '../../../src/components/Playground'

import {
  subqueryJoin
} from './0040-subquery-join'

<div style={{ marginBottom: '1em' }}>
  <Playground code={subqueryJoin} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [innerJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#innerJoin)
 - [leftJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#leftJoin)
 - [rightJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#rightJoin)
 - [fullJoin method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#fullJoin)
:::


================================================
FILE: site/docs/examples/join/_category_.json
================================================
{
  "label": "JOIN",
  "position": 3,
  "link": {
    "type": "generated-index",
    "description": "Examples of queries that use JOINs."
  }
}


================================================
FILE: site/docs/examples/merge/0010-source-row-existence.js
================================================
export const sourceRowExistence = `const result = await db
  .mergeInto('person as target')
  .using('pet as source', 'source.owner_id', 'target.id')
  .whenMatchedAnd('target.has_pets', '!=', 'Y')
  .thenUpdateSet({ has_pets: 'Y' })
  .whenNotMatchedBySourceAnd('target.has_pets', '=', 'Y')
  .thenUpdateSet({ has_pets: 'N' })
  .executeTakeFirstOrThrow()

console.log(result.numChangedRows)`

================================================
FILE: site/docs/examples/merge/0010-source-row-existence.mdx
================================================
---
title: 'Source row existence'
---

# Source row existence

Update a target column based on the existence of a source row:

import { Playground } from '../../../src/components/Playground'

import {
  sourceRowExistence
} from './0010-source-row-existence'

<div style={{ marginBottom: '1em' }}>
  <Playground code={sourceRowExistence} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [mergeInto method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#mergeInto)
 - [using method](https://kysely-org.github.io/kysely-apidoc/classes/MergeQueryBuilder.html#using)
 - [whenMatched method](https://kysely-org.github.io/kysely-apidoc/classes/WheneableMergeQueryBuilder.html#whenMatched)
 - [thenUpdateSet method](https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenUpdateSet)
 - [thenDelete method](https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenDelete)
 - [thenDoNothing method](https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenDoNothing)
 - [whenNotMatched method](https://kysely-org.github.io/kysely-apidoc/classes/WheneableMergeQueryBuilder.html#whenNotMatched)
 - [thenInsertValues method](https://kysely-org.github.io/kysely-apidoc/classes/NotMatchedThenableMergeQueryBuilder.html#thenInsertValues)
:::


================================================
FILE: site/docs/examples/merge/0020-temporary-changes-table.js
================================================
export const temporaryChangesTable = `const result = await db
  .mergeInto('wine as target')
  .using(
    'wine_stock_change as source',
    'source.wine_name',
    'target.name',
  )
  .whenNotMatchedAnd('source.stock_delta', '>', 0)
  .thenInsertValues(({ ref }) => ({
    name: ref('source.wine_name'),
    stock: ref('source.stock_delta'),
  }))
  .whenMatchedAnd(
    (eb) => eb('target.stock', '+', eb.ref('source.stock_delta')),
    '>',
    0,
  )
  .thenUpdateSet('stock', (eb) =>
    eb('target.stock', '+', eb.ref('source.stock_delta')),
  )
  .whenMatched()
  .thenDelete()
  .executeTakeFirstOrThrow()`

================================================
FILE: site/docs/examples/merge/0020-temporary-changes-table.mdx
================================================
---
title: 'Temporary changes table'
---

# Temporary changes table

Merge new entries from a temporary changes table:

import { Playground } from '../../../src/components/Playground'

import {
  temporaryChangesTable
} from './0020-temporary-changes-table'

<div style={{ marginBottom: '1em' }}>
  <Playground code={temporaryChangesTable} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [mergeInto method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#mergeInto)
 - [using method](https://kysely-org.github.io/kysely-apidoc/classes/MergeQueryBuilder.html#using)
 - [whenMatched method](https://kysely-org.github.io/kysely-apidoc/classes/WheneableMergeQueryBuilder.html#whenMatched)
 - [thenUpdateSet method](https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenUpdateSet)
 - [thenDelete method](https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenDelete)
 - [thenDoNothing method](https://kysely-org.github.io/kysely-apidoc/classes/MatchedThenableMergeQueryBuilder.html#thenDoNothing)
 - [whenNotMatched method](https://kysely-org.github.io/kysely-apidoc/classes/WheneableMergeQueryBuilder.html#whenNotMatched)
 - [thenInsertValues method](https://kysely-org.github.io/kysely-apidoc/classes/NotMatchedThenableMergeQueryBuilder.html#thenInsertValues)
:::


================================================
FILE: site/docs/examples/merge/_category_.json
================================================
{
  "label": "MERGE",
  "position": 7,
  "link": {
    "type": "generated-index",
    "description": "Short and simple examples of how to write MERGE queries."
  }
}


================================================
FILE: site/docs/examples/select/0010-a-single-column.js
================================================
export const aSingleColumn = `const persons = await db
  .selectFrom('person')
  .select('id')
  .where('first_name', '=', 'Arnold')
  .execute()`

================================================
FILE: site/docs/examples/select/0010-a-single-column.mdx
================================================
---
title: 'A single column'
---

# A single column

Select a single column:

import { Playground } from '../../../src/components/Playground'

import {
  aSingleColumn
} from './0010-a-single-column'

<div style={{ marginBottom: '1em' }}>
  <Playground code={aSingleColumn} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0020-column-with-a-table.js
================================================
export const columnWithATable = `const persons = await db
  .selectFrom(['person', 'pet'])
  .select('person.id')
  .execute()`

================================================
FILE: site/docs/examples/select/0020-column-with-a-table.mdx
================================================
---
title: 'Column with a table'
---

# Column with a table

Select a single column and specify a table:

import { Playground } from '../../../src/components/Playground'

import {
  columnWithATable
} from './0020-column-with-a-table'

<div style={{ marginBottom: '1em' }}>
  <Playground code={columnWithATable} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0030-multiple-columns.js
================================================
export const multipleColumns = `const persons = await db
  .selectFrom('person')
  .select(['person.id', 'first_name'])
  .execute()`

================================================
FILE: site/docs/examples/select/0030-multiple-columns.mdx
================================================
---
title: 'Multiple columns'
---

# Multiple columns

Select multiple columns:

import { Playground } from '../../../src/components/Playground'

import {
  multipleColumns
} from './0030-multiple-columns'

<div style={{ marginBottom: '1em' }}>
  <Playground code={multipleColumns} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0040-aliases.js
================================================
export const aliases = `const persons = await db
  .selectFrom('person as p')
  .select([
    'first_name as fn',
    'p.last_name as ln'
  ])
  .execute()`

================================================
FILE: site/docs/examples/select/0040-aliases.mdx
================================================
---
title: 'Aliases'
---

# Aliases

You can give an alias for selections and tables by appending `as the_alias` to the name:

import { Playground } from '../../../src/components/Playground'

import {
  aliases
} from './0040-aliases'

<div style={{ marginBottom: '1em' }}>
  <Playground code={aliases} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0050-complex-selections.js
================================================
export const complexSelections = `import { sql } from 'kysely'

const persons = await db.selectFrom('person')
  .select(({ eb, selectFrom, or, val, lit }) => [
    // Select a correlated subquery
    selectFrom('pet')
      .whereRef('person.id', '=', 'pet.owner_id')
      .select('pet.name')
      .orderBy('pet.name')
      .limit(1)
      .as('first_pet_name'),

    // Build and select an expression using
    // the expression builder
    or([
      eb('first_name', '=', 'Jennifer'),
      eb('first_name', '=', 'Arnold')
    ]).as('is_jennifer_or_arnold'),

    // Select a raw sql expression
    sql<string>\`concat(first_name, ' ', last_name)\`.as('full_name'),

    // Select a static string value
    val('Some value').as('string_value'),

    // Select a literal value
    lit(42).as('literal_value'),
  ])
  .execute()`

================================================
FILE: site/docs/examples/select/0050-complex-selections.mdx
================================================
---
title: 'Complex selections'
---

# Complex selections

You can select arbitrary expression including subqueries and raw sql snippets.
When you do that, you need to give a name for the selections using the `as` method:

import { Playground } from '../../../src/components/Playground'

import {
  complexSelections
} from './0050-complex-selections'

<div style={{ marginBottom: '1em' }}>
  <Playground code={complexSelections} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0051-not-null.js
================================================
export const notNull = `import { NotNull } from 'kysely'
import { jsonObjectFrom } from 'kysely/helpers/postgres'

const persons = db
  .selectFrom('person')
  .select((eb) => [
    'last_name',
     // Let's assume we know the person has at least one
     // pet. We can use the \`.$notNull()\` method to make
     // the expression not null. You could just as well
     // add \`pet\` to the \`$narrowType\` call below.
     jsonObjectFrom(
       eb.selectFrom('pet')
         .selectAll()
         .limit(1)
         .whereRef('person.id', '=', 'pet.owner_id')
     ).$notNull().as('pet')
  ])
  .where('last_name', 'is not', null)
  // $narrowType can be used to narrow the output type.
  // The special \`NotNull\` type can be used to make a
  // selection not null. You could add \`pet: NotNull\`
  // here and omit the \`$notNull()\` call on it.
  // Use whichever way you prefer.
  .$narrowType<{ last_name: NotNull }>()
  .execute()`

================================================
FILE: site/docs/examples/select/0051-not-null.mdx
================================================
---
title: 'Not null'
---

# Not null

Sometimes you can be sure something's not null, but Kysely isn't able to infer
it. For example calling `where('last_name', 'is not', null)` doesn't make
`last_name` not null in the result type, but unless you have other where statements
you can be sure it's never null.

Kysely has a couple of helpers for dealing with these cases: `$notNull()` and `$narrowType`.
Both are used in the following example:

import { Playground } from '../../../src/components/Playground'

import {
  notNull
} from './0051-not-null'

<div style={{ marginBottom: '1em' }}>
  <Playground code={notNull} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0060-function-calls.js
================================================
export const functionCalls = `import { sql } from 'kysely'

const result = await db.selectFrom('person')
  .innerJoin('pet', 'pet.owner_id', 'person.id')
  .select(({ fn, val, ref }) => [
    'person.id',

    // The \`fn\` module contains the most common
    // functions.
    fn.count<number>('pet.id').as('pet_count'),

    // You can call any function by calling \`fn\`
    // directly. The arguments are treated as column
    // references by default. If you want  to pass in
    // values, use the \`val\` function.
    fn<string>('concat', [
      val('Ms. '),
      'first_name',
      val(' '),
      'last_name'
    ]).as('full_name_with_title'),

    // You can call any aggregate function using the
    // \`fn.agg\` function.
    fn.agg<string[]>('array_agg', ['pet.name']).as('pet_names'),

    // And once again, you can use the \`sql\`
    // template tag. The template tag substitutions
    // are treated as values by default. If you want
    // to reference columns, you can use the \`ref\`
    // function.
    sql<string>\`concat(
      \${ref('first_name')},
      ' ',
      \${ref('last_name')}
    )\`.as('full_name')
  ])
  .groupBy('person.id')
  .having((eb) => eb.fn.count('pet.id'), '>', 10)
  .execute()`

================================================
FILE: site/docs/examples/select/0060-function-calls.mdx
================================================
---
title: 'Function calls'
---

# Function calls

This example shows how to create function calls. These examples also work in any
other place (`where` calls, updates, inserts etc.). The only difference is that you
leave out the alias (the `as` call) if you use these in any other place than `select`.

import { Playground } from '../../../src/components/Playground'

import {
  functionCalls
} from './0060-function-calls'

<div style={{ marginBottom: '1em' }}>
  <Playground code={functionCalls} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0070-distinct.js
================================================
export const distinct = `const persons = await db.selectFrom('person')
  .select('first_name')
  .distinct()
  .execute()`

================================================
FILE: site/docs/examples/select/0070-distinct.mdx
================================================
---
title: 'Distinct'
---

# Distinct

import { Playground } from '../../../src/components/Playground'

import {
  distinct
} from './0070-distinct'

<div style={{ marginBottom: '1em' }}>
  <Playground code={distinct} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0080-distinct-on.js
================================================
export const distinctOn = `const persons = await db.selectFrom('person')
  .innerJoin('pet', 'pet.owner_id', 'person.id')
  .where('pet.name', '=', 'Doggo')
  .distinctOn('person.id')
  .selectAll('person')
  .execute()`

================================================
FILE: site/docs/examples/select/0080-distinct-on.mdx
================================================
---
title: 'Distinct on'
---

# Distinct on

import { Playground } from '../../../src/components/Playground'

import {
  distinctOn
} from './0080-distinct-on'

<div style={{ marginBottom: '1em' }}>
  <Playground code={distinctOn} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#select)
 - [selectAll method](https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#selectAll)
 - [selectFrom method](https://kysely-org.github.io/kysely-apidoc/classes/Kysely.html#selectFrom)
:::


================================================
FILE: site/docs/examples/select/0090-all-columns.js
================================================
export const allColumns = `const persons = await db
  .selectFrom('person')
  .selectAll()
  .execute()`

================================================
FILE: site/docs/examples/select/0090-all-columns.mdx
================================================
---
title: 'All columns'
---

# All columns

The `selectAll` method generates `SELECT *`:

import { Playground } from '../../../src/components/Playground'

import {
  allColumns
} from './0090-all-columns'

<div style={{ marginBottom: '1em' }}>
  <Playground code={allColumns} />
</div>

:::info[More examples]
The API documentation is packed with examples. The API docs are hosted [here](https://kysely-org.github.io/kysely-apidoc/),
but you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always
just one hover away!

For example, check out these sections:
 - [select method](https://kysely-org.gi
Download .txt
gitextract_h4793jw5/

├── .github/
│   └── workflows/
│       ├── bench.yml
│       ├── compare.yml
│       ├── preview.yml
│       ├── publish.yml
│       └── test.yml
├── .gitignore
├── .mocharc.js
├── .node-version
├── .npmrc
├── .nvmrc
├── .prettierignore
├── .prettierrc.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── FUNDING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── deno.check.d.ts
├── deno.check.json
├── deno.lint.json
├── docker-compose.yml
├── docs/
│   └── index.html
├── example/
│   ├── .gitignore
│   ├── .prettierrc.json
│   ├── README.md
│   ├── package.json
│   ├── src/
│   │   ├── app.ts
│   │   ├── authentication/
│   │   │   ├── auth-token.service.ts
│   │   │   ├── auth-token.ts
│   │   │   ├── authentication.service.ts
│   │   │   ├── refresh-token.repository.ts
│   │   │   ├── refresh-token.table.ts
│   │   │   └── refresh-token.ts
│   │   ├── config.ts
│   │   ├── context.ts
│   │   ├── database.ts
│   │   ├── migrate-to-latest.ts
│   │   ├── migrations/
│   │   │   ├── 2021_09_18_06_54_59_create_user.ts
│   │   │   ├── 2021_09_18_14_05_20_create_refresh_token.ts
│   │   │   └── 2021_09_18_18_22_45_create_sign_in_method.ts
│   │   ├── router.ts
│   │   ├── user/
│   │   │   ├── sign-in-method/
│   │   │   │   ├── password-sign-in-method.table.ts
│   │   │   │   ├── sign-in-method.controller.ts
│   │   │   │   ├── sign-in-method.repository.ts
│   │   │   │   ├── sign-in-method.service.ts
│   │   │   │   ├── sign-in-method.table.ts
│   │   │   │   └── sign-in-method.ts
│   │   │   ├── signed-in-user.ts
│   │   │   ├── user.controller.ts
│   │   │   ├── user.repository.ts
│   │   │   ├── user.service.ts
│   │   │   ├── user.table.ts
│   │   │   └── user.ts
│   │   └── util/
│   │       ├── ajv.ts
│   │       ├── errors.ts
│   │       └── object.ts
│   ├── test/
│   │   ├── test-config.ts
│   │   ├── test-context.ts
│   │   └── user/
│   │       └── user.test.ts
│   └── tsconfig.json
├── jsr.json
├── outdated-typescript.d.ts
├── package.json
├── pnpm-workspace.yaml
├── scripts/
│   ├── add-deno-type-references.js
│   ├── align-versions.mts
│   ├── check-esm-imports.js
│   ├── check-exports.js
│   ├── copy-interface-documentation.js
│   ├── exclude-test-files-for-backwards-compat.mts
│   ├── generate-site-examples.js
│   ├── module-fixup.js
│   ├── remove-global-augmentations.mts
│   ├── tsconfig.json
│   └── util/
│       └── for-each-file.js
├── site/
│   ├── .gitignore
│   ├── babel.config.js
│   ├── docs/
│   │   ├── dialects.md
│   │   ├── examples/
│   │   │   ├── _category_.json
│   │   │   ├── cte/
│   │   │   │   ├── 0010-simple-selects.js
│   │   │   │   ├── 0010-simple-selects.mdx
│   │   │   │   ├── 0020-inserts-updates-and-deletions.js
│   │   │   │   ├── 0020-inserts-updates-and-deletions.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── delete/
│   │   │   │   ├── 0010-single-row.js
│   │   │   │   ├── 0010-single-row.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── insert/
│   │   │   │   ├── 0010-single-row.js
│   │   │   │   ├── 0010-single-row.mdx
│   │   │   │   ├── 0020-multiple-rows.js
│   │   │   │   ├── 0020-multiple-rows.mdx
│   │   │   │   ├── 0030-returning-data.js
│   │   │   │   ├── 0030-returning-data.mdx
│   │   │   │   ├── 0040-complex-values.js
│   │   │   │   ├── 0040-complex-values.mdx
│   │   │   │   ├── 0050-insert-subquery.js
│   │   │   │   ├── 0050-insert-subquery.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── join/
│   │   │   │   ├── 0010-simple-inner-join.js
│   │   │   │   ├── 0010-simple-inner-join.mdx
│   │   │   │   ├── 0020-aliased-inner-join.js
│   │   │   │   ├── 0020-aliased-inner-join.mdx
│   │   │   │   ├── 0030-complex-join.js
│   │   │   │   ├── 0030-complex-join.mdx
│   │   │   │   ├── 0040-subquery-join.js
│   │   │   │   ├── 0040-subquery-join.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── merge/
│   │   │   │   ├── 0010-source-row-existence.js
│   │   │   │   ├── 0010-source-row-existence.mdx
│   │   │   │   ├── 0020-temporary-changes-table.js
│   │   │   │   ├── 0020-temporary-changes-table.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── select/
│   │   │   │   ├── 0010-a-single-column.js
│   │   │   │   ├── 0010-a-single-column.mdx
│   │   │   │   ├── 0020-column-with-a-table.js
│   │   │   │   ├── 0020-column-with-a-table.mdx
│   │   │   │   ├── 0030-multiple-columns.js
│   │   │   │   ├── 0030-multiple-columns.mdx
│   │   │   │   ├── 0040-aliases.js
│   │   │   │   ├── 0040-aliases.mdx
│   │   │   │   ├── 0050-complex-selections.js
│   │   │   │   ├── 0050-complex-selections.mdx
│   │   │   │   ├── 0051-not-null.js
│   │   │   │   ├── 0051-not-null.mdx
│   │   │   │   ├── 0060-function-calls.js
│   │   │   │   ├── 0060-function-calls.mdx
│   │   │   │   ├── 0070-distinct.js
│   │   │   │   ├── 0070-distinct.mdx
│   │   │   │   ├── 0080-distinct-on.js
│   │   │   │   ├── 0080-distinct-on.mdx
│   │   │   │   ├── 0090-all-columns.js
│   │   │   │   ├── 0090-all-columns.mdx
│   │   │   │   ├── 0100-all-columns-of-a-table.js
│   │   │   │   ├── 0100-all-columns-of-a-table.mdx
│   │   │   │   ├── 0110-nested-array.js
│   │   │   │   ├── 0110-nested-array.mdx
│   │   │   │   ├── 0120-nested-object.js
│   │   │   │   ├── 0120-nested-object.mdx
│   │   │   │   ├── 0130-generic-find-query.js
│   │   │   │   ├── 0130-generic-find-query.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── transactions/
│   │   │   │   ├── 0010-simple-transaction.js
│   │   │   │   ├── 0010-simple-transaction.mdx
│   │   │   │   ├── 0011-controlled-transaction.js
│   │   │   │   ├── 0011-controlled-transaction.mdx
│   │   │   │   ├── 0012-controlled-transaction-w-savepoints.js
│   │   │   │   ├── 0012-controlled-transaction-w-savepoints.mdx
│   │   │   │   └── _category_.json
│   │   │   ├── update/
│   │   │   │   ├── 0010-single-row.js
│   │   │   │   ├── 0010-single-row.mdx
│   │   │   │   ├── 0020-complex-values.js
│   │   │   │   ├── 0020-complex-values.mdx
│   │   │   │   ├── 0030-my-sql-joins.js
│   │   │   │   ├── 0030-my-sql-joins.mdx
│   │   │   │   └── _category_.json
│   │   │   └── where/
│   │   │       ├── 0010-simple-where-clause.js
│   │   │       ├── 0010-simple-where-clause.mdx
│   │   │       ├── 0020-where-in.js
│   │   │       ├── 0020-where-in.mdx
│   │   │       ├── 0030-object-filter.js
│   │   │       ├── 0030-object-filter.mdx
│   │   │       ├── 0040-or-where.js
│   │   │       ├── 0040-or-where.mdx
│   │   │       ├── 0050-conditional-where-calls.js
│   │   │       ├── 0050-conditional-where-calls.mdx
│   │   │       ├── 0060-complex-where-clause.js
│   │   │       ├── 0060-complex-where-clause.mdx
│   │   │       └── _category_.json
│   │   ├── execution.mdx
│   │   ├── generating-types.md
│   │   ├── getting-started/
│   │   │   ├── Dialects.tsx
│   │   │   ├── IUseADifferentDialect.tsx
│   │   │   ├── IUseADifferentPackageManager.tsx
│   │   │   ├── Installation.tsx
│   │   │   ├── Instantiation.tsx
│   │   │   ├── Querying.tsx
│   │   │   ├── Summary.tsx
│   │   │   ├── _prerequisites.mdx
│   │   │   ├── _types.mdx
│   │   │   └── shared.tsx
│   │   ├── getting-started.mdx
│   │   ├── integrations/
│   │   │   ├── _category_.json
│   │   │   ├── llms.mdx
│   │   │   └── supabase.mdx
│   │   ├── intro.mdx
│   │   ├── migrations.mdx
│   │   ├── playground.mdx
│   │   ├── plugins.md
│   │   ├── recipes/
│   │   │   ├── 0001-relations.md
│   │   │   ├── 0001-reusable-helpers.md
│   │   │   ├── 0002-data-types.md
│   │   │   ├── 0003-raw-sql.md
│   │   │   ├── 0004-splitting-query-building-and-execution.md
│   │   │   ├── 0005-conditional-selects.md
│   │   │   ├── 0006-expressions.md
│   │   │   ├── 0007-schemas.md
│   │   │   ├── 0008-deduplicate-joins.md
│   │   │   ├── 0009-excessively-deep-types.md
│   │   │   ├── 0010-extending-kysely.md
│   │   │   ├── 0011-introspecting-relation-metadata.md
│   │   │   ├── 0012-logging.md
│   │   │   └── _category_.json
│   │   └── runtimes/
│   │       ├── _category_.json
│   │       ├── browser.md
│   │       └── deno.mdx
│   ├── docusaurus.config.ts
│   ├── package.json
│   ├── sidebars.js
│   ├── src/
│   │   ├── components/
│   │   │   ├── DemoVideo.module.css
│   │   │   ├── DemoVideo.tsx
│   │   │   ├── Playground.module.css
│   │   │   ├── Playground.tsx
│   │   │   ├── SectionFeatures/
│   │   │   │   ├── index.tsx
│   │   │   │   └── styles.module.css
│   │   │   ├── SectionQuotes/
│   │   │   │   ├── Quote.tsx
│   │   │   │   ├── index.tsx
│   │   │   │   ├── quotes.ts
│   │   │   │   ├── reddit.module.css
│   │   │   │   └── styles.module.css
│   │   │   └── playground-example-types.ts
│   │   ├── css/
│   │   │   └── custom.css
│   │   └── pages/
│   │       ├── index.module.css
│   │       └── index.tsx
│   ├── static/
│   │   ├── .nojekyll
│   │   └── demo_optimized.webm
│   └── tsconfig.json
├── src/
│   ├── dialect/
│   │   ├── database-introspector.ts
│   │   ├── dialect-adapter-base.ts
│   │   ├── dialect-adapter.ts
│   │   ├── dialect.ts
│   │   ├── mssql/
│   │   │   ├── mssql-adapter.ts
│   │   │   ├── mssql-dialect-config.ts
│   │   │   ├── mssql-dialect.ts
│   │   │   ├── mssql-driver.ts
│   │   │   ├── mssql-introspector.ts
│   │   │   └── mssql-query-compiler.ts
│   │   ├── mysql/
│   │   │   ├── mysql-adapter.ts
│   │   │   ├── mysql-dialect-config.ts
│   │   │   ├── mysql-dialect.ts
│   │   │   ├── mysql-driver.ts
│   │   │   ├── mysql-introspector.ts
│   │   │   └── mysql-query-compiler.ts
│   │   ├── postgres/
│   │   │   ├── postgres-adapter.ts
│   │   │   ├── postgres-dialect-config.ts
│   │   │   ├── postgres-dialect.ts
│   │   │   ├── postgres-driver.ts
│   │   │   ├── postgres-introspector.ts
│   │   │   └── postgres-query-compiler.ts
│   │   └── sqlite/
│   │       ├── sqlite-adapter.ts
│   │       ├── sqlite-dialect-config.ts
│   │       ├── sqlite-dialect.ts
│   │       ├── sqlite-driver.ts
│   │       ├── sqlite-introspector.ts
│   │       └── sqlite-query-compiler.ts
│   ├── driver/
│   │   ├── connection-provider.ts
│   │   ├── database-connection.ts
│   │   ├── default-connection-provider.ts
│   │   ├── driver.ts
│   │   ├── dummy-driver.ts
│   │   ├── runtime-driver.ts
│   │   └── single-connection-provider.ts
│   ├── dynamic/
│   │   ├── dynamic-reference-builder.ts
│   │   ├── dynamic-table-builder.ts
│   │   └── dynamic.ts
│   ├── expression/
│   │   ├── expression-builder.ts
│   │   ├── expression-wrapper.ts
│   │   └── expression.ts
│   ├── helpers/
│   │   ├── mssql.ts
│   │   ├── mysql.ts
│   │   ├── postgres.ts
│   │   └── sqlite.ts
│   ├── index.ts
│   ├── kysely.ts
│   ├── migration/
│   │   ├── file-migration-provider.ts
│   │   └── migrator.ts
│   ├── operation-node/
│   │   ├── add-column-node.ts
│   │   ├── add-constraint-node.ts
│   │   ├── add-index-node.ts
│   │   ├── aggregate-function-node.ts
│   │   ├── alias-node.ts
│   │   ├── alter-column-node.ts
│   │   ├── alter-table-node.ts
│   │   ├── and-node.ts
│   │   ├── binary-operation-node.ts
│   │   ├── case-node.ts
│   │   ├── cast-node.ts
│   │   ├── check-constraint-node.ts
│   │   ├── collate-node.ts
│   │   ├── column-definition-node.ts
│   │   ├── column-node.ts
│   │   ├── column-update-node.ts
│   │   ├── common-table-expression-name-node.ts
│   │   ├── common-table-expression-node.ts
│   │   ├── constraint-node.ts
│   │   ├── create-index-node.ts
│   │   ├── create-schema-node.ts
│   │   ├── create-table-node.ts
│   │   ├── create-type-node.ts
│   │   ├── create-view-node.ts
│   │   ├── data-type-node.ts
│   │   ├── default-insert-value-node.ts
│   │   ├── default-value-node.ts
│   │   ├── delete-query-node.ts
│   │   ├── drop-column-node.ts
│   │   ├── drop-constraint-node.ts
│   │   ├── drop-index-node.ts
│   │   ├── drop-schema-node.ts
│   │   ├── drop-table-node.ts
│   │   ├── drop-type-node.ts
│   │   ├── drop-view-node.ts
│   │   ├── explain-node.ts
│   │   ├── fetch-node.ts
│   │   ├── foreign-key-constraint-node.ts
│   │   ├── from-node.ts
│   │   ├── function-node.ts
│   │   ├── generated-node.ts
│   │   ├── group-by-item-node.ts
│   │   ├── group-by-node.ts
│   │   ├── having-node.ts
│   │   ├── identifier-node.ts
│   │   ├── insert-query-node.ts
│   │   ├── join-node.ts
│   │   ├── json-operator-chain-node.ts
│   │   ├── json-path-leg-node.ts
│   │   ├── json-path-node.ts
│   │   ├── json-reference-node.ts
│   │   ├── limit-node.ts
│   │   ├── list-node.ts
│   │   ├── matched-node.ts
│   │   ├── merge-query-node.ts
│   │   ├── modify-column-node.ts
│   │   ├── offset-node.ts
│   │   ├── on-conflict-node.ts
│   │   ├── on-duplicate-key-node.ts
│   │   ├── on-node.ts
│   │   ├── operation-node-source.ts
│   │   ├── operation-node-transformer.ts
│   │   ├── operation-node-visitor.ts
│   │   ├── operation-node.ts
│   │   ├── operator-node.ts
│   │   ├── or-action-node.ts
│   │   ├── or-node.ts
│   │   ├── order-by-item-node.ts
│   │   ├── order-by-node.ts
│   │   ├── output-node.ts
│   │   ├── over-node.ts
│   │   ├── parens-node.ts
│   │   ├── partition-by-item-node.ts
│   │   ├── partition-by-node.ts
│   │   ├── primary-key-constraint-node.ts
│   │   ├── primitive-value-list-node.ts
│   │   ├── query-node.ts
│   │   ├── raw-node.ts
│   │   ├── reference-node.ts
│   │   ├── references-node.ts
│   │   ├── refresh-materialized-view-node.ts
│   │   ├── rename-column-node.ts
│   │   ├── rename-constraint-node.ts
│   │   ├── returning-node.ts
│   │   ├── schemable-identifier-node.ts
│   │   ├── select-all-node.ts
│   │   ├── select-modifier-node.ts
│   │   ├── select-query-node.ts
│   │   ├── selection-node.ts
│   │   ├── set-operation-node.ts
│   │   ├── simple-reference-expression-node.ts
│   │   ├── table-node.ts
│   │   ├── top-node.ts
│   │   ├── tuple-node.ts
│   │   ├── unary-operation-node.ts
│   │   ├── unique-constraint-node.ts
│   │   ├── update-query-node.ts
│   │   ├── using-node.ts
│   │   ├── value-list-node.ts
│   │   ├── value-node.ts
│   │   ├── values-node.ts
│   │   ├── when-node.ts
│   │   ├── where-node.ts
│   │   └── with-node.ts
│   ├── parser/
│   │   ├── binary-operation-parser.ts
│   │   ├── coalesce-parser.ts
│   │   ├── collate-parser.ts
│   │   ├── data-type-parser.ts
│   │   ├── default-value-parser.ts
│   │   ├── delete-from-parser.ts
│   │   ├── expression-parser.ts
│   │   ├── fetch-parser.ts
│   │   ├── group-by-parser.ts
│   │   ├── identifier-parser.ts
│   │   ├── insert-values-parser.ts
│   │   ├── join-parser.ts
│   │   ├── merge-into-parser.ts
│   │   ├── merge-parser.ts
│   │   ├── on-commit-action-parse.ts
│   │   ├── on-modify-action-parser.ts
│   │   ├── order-by-parser.ts
│   │   ├── parse-utils.ts
│   │   ├── partition-by-parser.ts
│   │   ├── reference-parser.ts
│   │   ├── returning-parser.ts
│   │   ├── savepoint-parser.ts
│   │   ├── select-from-parser.ts
│   │   ├── select-parser.ts
│   │   ├── set-operation-parser.ts
│   │   ├── table-parser.ts
│   │   ├── top-parser.ts
│   │   ├── tuple-parser.ts
│   │   ├── unary-operation-parser.ts
│   │   ├── update-parser.ts
│   │   ├── update-set-parser.ts
│   │   ├── value-parser.ts
│   │   └── with-parser.ts
│   ├── plugin/
│   │   ├── camel-case/
│   │   │   ├── camel-case-plugin.ts
│   │   │   ├── camel-case-transformer.ts
│   │   │   └── camel-case.ts
│   │   ├── deduplicate-joins/
│   │   │   ├── deduplicate-joins-plugin.ts
│   │   │   └── deduplicate-joins-transformer.ts
│   │   ├── handle-empty-in-lists/
│   │   │   ├── handle-empty-in-lists-plugin.ts
│   │   │   ├── handle-empty-in-lists-transformer.ts
│   │   │   └── handle-empty-in-lists.ts
│   │   ├── immediate-value/
│   │   │   ├── immediate-value-plugin.ts
│   │   │   └── immediate-value-transformer.ts
│   │   ├── kysely-plugin.ts
│   │   ├── noop-plugin.ts
│   │   ├── parse-json-results/
│   │   │   └── parse-json-results-plugin.ts
│   │   └── with-schema/
│   │       ├── with-schema-plugin.ts
│   │       └── with-schema-transformer.ts
│   ├── query-builder/
│   │   ├── aggregate-function-builder.ts
│   │   ├── case-builder.ts
│   │   ├── cte-builder.ts
│   │   ├── delete-query-builder.ts
│   │   ├── delete-result.ts
│   │   ├── function-module.ts
│   │   ├── having-interface.ts
│   │   ├── insert-query-builder.ts
│   │   ├── insert-result.ts
│   │   ├── join-builder.ts
│   │   ├── json-path-builder.ts
│   │   ├── merge-query-builder.ts
│   │   ├── merge-result.ts
│   │   ├── no-result-error.ts
│   │   ├── on-conflict-builder.ts
│   │   ├── order-by-interface.ts
│   │   ├── order-by-item-builder.ts
│   │   ├── output-interface.ts
│   │   ├── over-builder.ts
│   │   ├── returning-interface.ts
│   │   ├── select-query-builder-expression.ts
│   │   ├── select-query-builder.ts
│   │   ├── update-query-builder.ts
│   │   ├── update-result.ts
│   │   └── where-interface.ts
│   ├── query-compiler/
│   │   ├── compiled-query.ts
│   │   ├── default-query-compiler.ts
│   │   └── query-compiler.ts
│   ├── query-creator.ts
│   ├── query-executor/
│   │   ├── default-query-executor.ts
│   │   ├── noop-query-executor.ts
│   │   ├── query-executor-base.ts
│   │   ├── query-executor-provider.ts
│   │   └── query-executor.ts
│   ├── raw-builder/
│   │   ├── raw-builder.ts
│   │   └── sql.ts
│   ├── schema/
│   │   ├── alter-column-builder.ts
│   │   ├── alter-table-add-foreign-key-constraint-builder.ts
│   │   ├── alter-table-add-index-builder.ts
│   │   ├── alter-table-builder.ts
│   │   ├── alter-table-drop-constraint-builder.ts
│   │   ├── alter-table-executor.ts
│   │   ├── check-constraint-builder.ts
│   │   ├── column-definition-builder.ts
│   │   ├── create-index-builder.ts
│   │   ├── create-schema-builder.ts
│   │   ├── create-table-builder.ts
│   │   ├── create-type-builder.ts
│   │   ├── create-view-builder.ts
│   │   ├── drop-index-builder.ts
│   │   ├── drop-schema-builder.ts
│   │   ├── drop-table-builder.ts
│   │   ├── drop-type-builder.ts
│   │   ├── drop-view-builder.ts
│   │   ├── foreign-key-constraint-builder.ts
│   │   ├── primary-key-constraint-builder.ts
│   │   ├── refresh-materialized-view-builder.ts
│   │   ├── schema.ts
│   │   └── unique-constraint-builder.ts
│   └── util/
│       ├── assert.ts
│       ├── column-type.ts
│       ├── compilable.ts
│       ├── deferred.ts
│       ├── explainable.ts
│       ├── infer-result.ts
│       ├── json-object-args.ts
│       ├── log-once.ts
│       ├── log.ts
│       ├── object-utils.ts
│       ├── performance-now.ts
│       ├── provide-controlled-connection.ts
│       ├── query-id.ts
│       ├── random-string.ts
│       ├── require-all-props.ts
│       ├── stack-trace-utils.ts
│       ├── streamable.ts
│       ├── type-error.ts
│       └── type-utils.ts
├── test/
│   ├── browser/
│   │   ├── index.html
│   │   ├── main.ts
│   │   └── test.js
│   ├── bun/
│   │   ├── bun.test.ts
│   │   ├── package.json
│   │   └── tsconfig.json
│   ├── cloudflare-workers/
│   │   ├── .dev.vars
│   │   ├── api.ts
│   │   ├── package.json
│   │   └── test.ts
│   ├── composite-ts/
│   │   ├── index.mts
│   │   ├── package.json
│   │   └── tsconfig.json
│   ├── deno/
│   │   ├── cdn.test.ts
│   │   ├── deno.json
│   │   └── local.test.ts
│   ├── node/
│   │   ├── src/
│   │   │   ├── aggregate-function.test.ts
│   │   │   ├── array.test.ts
│   │   │   ├── async-dispose.test.ts
│   │   │   ├── camel-case.test.ts
│   │   │   ├── case.test.ts
│   │   │   ├── clear.test.ts
│   │   │   ├── coalesce.test.ts
│   │   │   ├── controlled-transaction.test.ts
│   │   │   ├── deduplicate-joins.test.ts
│   │   │   ├── delete.test.ts
│   │   │   ├── disconnects.test.ts
│   │   │   ├── error-stack.test.ts
│   │   │   ├── execute.test.ts
│   │   │   ├── explain.test.ts
│   │   │   ├── expression.test.ts
│   │   │   ├── group-by.test.ts
│   │   │   ├── handle-empty-in-lists-plugin.test.ts
│   │   │   ├── having.test.ts
│   │   │   ├── immediate-value-plugin.test.ts
│   │   │   ├── insert.test.ts
│   │   │   ├── introspect.test.ts
│   │   │   ├── join.test.ts
│   │   │   ├── json-traversal.test.ts
│   │   │   ├── json.test.ts
│   │   │   ├── log-once.test.ts
│   │   │   ├── logging.test.ts
│   │   │   ├── merge.test.ts
│   │   │   ├── migration.test.ts
│   │   │   ├── object-util.test.ts
│   │   │   ├── order-by.test.ts
│   │   │   ├── parse-json-results-plugin.test.ts
│   │   │   ├── performance.test.ts
│   │   │   ├── query-id.test.ts
│   │   │   ├── raw-query.test.ts
│   │   │   ├── raw-sql.test.ts
│   │   │   ├── replace.test.ts
│   │   │   ├── sanitize-identifiers.test.ts
│   │   │   ├── schema.test.ts
│   │   │   ├── select.test.ts
│   │   │   ├── set-operation.test.ts
│   │   │   ├── sql-injection.test.ts
│   │   │   ├── stream.test.ts
│   │   │   ├── test-migrations/
│   │   │   │   ├── migration1.ts
│   │   │   │   └── migration2.ts
│   │   │   ├── test-setup.ts
│   │   │   ├── transaction.test.ts
│   │   │   ├── update.test.ts
│   │   │   ├── where.test.ts
│   │   │   ├── with-schema.test.ts
│   │   │   └── with.test.ts
│   │   └── tsconfig.json
│   ├── outdated-ts/
│   │   ├── outdated-ts.test.ts
│   │   ├── package.json
│   │   └── tsconfig.json
│   ├── scripts/
│   │   └── mysql-init.sql
│   ├── ts-benchmarks/
│   │   ├── index.ts
│   │   ├── order-by.bench.ts
│   │   ├── package.json
│   │   ├── select-from.bench.ts
│   │   └── tsconfig.json
│   └── typings/
│       ├── index.d.ts
│       ├── package.json
│       ├── shared.d.ts
│       └── test-d/
│           ├── aggregate-function.test-d.ts
│           ├── alter-table.test-d.ts
│           ├── assert-type.test-d.ts
│           ├── case.test-d.ts
│           ├── clear.test-d.ts
│           ├── coalesce.test-d.ts
│           ├── create-table.test-d.ts
│           ├── delete-query-builder.test-d.ts
│           ├── expression.test-d.ts
│           ├── generic-pre-5.4.test-d.ts
│           ├── generic.test-d.ts
│           ├── huge-db.test-d.ts
│           ├── if.test-d.ts
│           ├── index.test-d.ts
│           ├── infer-result.test-d.ts
│           ├── insert.test-d.ts
│           ├── join.test-d.ts
│           ├── json-traversal.test-d.ts
│           ├── kysely-any.test-d.ts
│           ├── merge.test-d.ts
│           ├── postgres-json.test-d.ts
│           ├── select-from.test-d.ts
│           ├── select-no-from.test-d.ts
│           ├── select.test-d.ts
│           ├── set-operation.test-d.ts
│           ├── update.test-d.ts
│           ├── where.test-d.ts
│           └── with.test-d.ts
├── tsconfig-base.json
├── tsconfig-cjs.json
└── tsconfig.json
Download .txt
Showing preview only (282K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3234 symbols across 393 files)

FILE: deno.check.d.ts
  type Database (line 12) | interface Database {
  type AuditTable (line 22) | interface AuditTable {
  type PersonTable (line 27) | interface PersonTable {
  type PetTable (line 50) | interface PetTable {
  type ToyTable (line 59) | interface ToyTable {
  type WineTable (line 66) | interface WineTable {
  type WineStockChangeTable (line 72) | interface WineStockChangeTable {
  type Person (line 78) | type Person = Selectable<PersonTable>
  type NewPerson (line 79) | type NewPerson = Insertable<PersonTable>
  type PersonUpdate (line 80) | type PersonUpdate = Updateable<PersonTable>
  type Pet (line 81) | type Pet = Selectable<PetTable>
  type NewPet (line 82) | type NewPet = Insertable<PetTable>
  type PetUpdate (line 83) | type PetUpdate = Updateable<PetTable>
  type Species (line 84) | type Species = 'dog' | 'cat' | 'hamster'
  class Buffer (line 88) | class Buffer {

FILE: example/src/app.ts
  class App (line 17) | class App {
    method constructor (line 24) | constructor(config: Config) {
    method db (line 47) | get db(): Kysely<Database> {
    method start (line 51) | async start(): Promise<void> {
    method stop (line 57) | async stop(): Promise<void> {
  function respondError (line 95) | function respondError(ctx: Context, error: ControllerError): void {
  function createUnknownError (line 100) | function createUnknownError(error: unknown): ControllerError {

FILE: example/src/authentication/auth-token.service.ts
  class AuthTokenError (line 9) | class AuthTokenError extends Error {}
  class InvalidAuthTokenError (line 10) | class InvalidAuthTokenError extends AuthTokenError {}
  class AuthTokenExpiredError (line 11) | class AuthTokenExpiredError extends AuthTokenError {}
  class RefreshTokenUserIdMismatchError (line 12) | class RefreshTokenUserIdMismatchError extends Error {}
  type AuthTokenPayload (line 14) | interface AuthTokenPayload {
  type RefreshTokenPayload (line 19) | interface RefreshTokenPayload {
  function createRefreshToken (line 25) | async function createRefreshToken(
  function signRefreshToken (line 41) | function signRefreshToken(tokenPayload: RefreshTokenPayload): RefreshTok...
  function createAuthToken (line 46) | async function createAuthToken(
  function verifyRefreshToken (line 59) | function verifyRefreshToken(token: RefreshToken): RefreshTokenPayload {
  function signAuthToken (line 79) | function signAuthToken(tokenPayload: AuthTokenPayload): AuthToken {
  function verifyAuthToken (line 87) | function verifyAuthToken(token: AuthToken): AuthTokenPayload {
  function verifyToken (line 105) | function verifyToken(token: string): string | jwt.JwtPayload {
  function deleteRefreshToken (line 117) | async function deleteRefreshToken(

FILE: example/src/authentication/auth-token.ts
  type AuthToken (line 1) | interface AuthToken {

FILE: example/src/authentication/authentication.service.ts
  function authenticateUser (line 9) | async function authenticateUser(

FILE: example/src/authentication/refresh-token.repository.ts
  function insertRefreshToken (line 8) | async function insertRefreshToken(
  function findRefreshToken (line 24) | async function findRefreshToken(
  function updateRefreshToken (line 40) | async function updateRefreshToken(

FILE: example/src/authentication/refresh-token.table.ts
  type RefreshTokenTable (line 3) | interface RefreshTokenTable {
  type RefreshTokenRow (line 10) | type RefreshTokenRow = Selectable<RefreshTokenTable>
  type InsertableRefreshTokenRow (line 11) | type InsertableRefreshTokenRow = Insertable<RefreshTokenTable>
  type UpdateableRefreshTokenRow (line 12) | type UpdateableRefreshTokenRow = Updateable<RefreshTokenTable>

FILE: example/src/authentication/refresh-token.ts
  type RefreshToken (line 3) | interface RefreshToken {

FILE: example/src/config.ts
  type Config (line 6) | interface Config {
  function getEnvVariable (line 24) | function getEnvVariable(name: string): string {

FILE: example/src/context.ts
  type ContextExtension (line 7) | interface ContextExtension {
  type Context (line 11) | type Context = Koa.ParameterizedContext<

FILE: example/src/database.ts
  type Database (line 6) | interface Database {

FILE: example/src/migrate-to-latest.ts
  function migrateToLatest (line 13) | async function migrateToLatest() {

FILE: example/src/migrations/2021_09_18_06_54_59_create_user.ts
  function up (line 3) | async function up(db: Kysely<any>): Promise<void> {
  function down (line 16) | async function down(db: Kysely<any>): Promise<void> {

FILE: example/src/migrations/2021_09_18_14_05_20_create_refresh_token.ts
  function up (line 3) | async function up(db: Kysely<any>): Promise<void> {
  function down (line 25) | async function down(db: Kysely<any>): Promise<void> {

FILE: example/src/migrations/2021_09_18_18_22_45_create_sign_in_method.ts
  function up (line 3) | async function up(db: Kysely<any>): Promise<void> {
  function down (line 34) | async function down(db: Kysely<any>): Promise<void> {

FILE: example/src/router.ts
  class Router (line 5) | class Router extends KoaRouter<any, ContextExtension> {}

FILE: example/src/user/sign-in-method/password-sign-in-method.table.ts
  type PasswordSignInMethodTable (line 3) | interface PasswordSignInMethodTable {
  type PasswordSignInMethodRow (line 8) | type PasswordSignInMethodRow = Selectable<PasswordSignInMethodTable>
  type InsertablePasswordSignInMethodRow (line 10) | type InsertablePasswordSignInMethodRow =
  type UpdateablePasswordSignInMethodRow (line 13) | type UpdateablePasswordSignInMethodRow =

FILE: example/src/user/sign-in-method/sign-in-method.controller.ts
  function signInMethodController (line 18) | function signInMethodController(router: Router): void {

FILE: example/src/user/sign-in-method/sign-in-method.repository.ts
  function findPasswordSignInMethod (line 8) | async function findPasswordSignInMethod(
  function insertPasswordSignInMethod (line 23) | async function insertPasswordSignInMethod(

FILE: example/src/user/sign-in-method/sign-in-method.service.ts
  constant MIN_PASSWORD_LENGTH (line 12) | const MIN_PASSWORD_LENGTH = 8
  constant MAX_PASSWORD_LENGTH (line 13) | const MAX_PASSWORD_LENGTH = 255
  class UserAlreadyHasSignInMethodError (line 15) | class UserAlreadyHasSignInMethodError extends Error {}
  class SignInMethodNotFoundError (line 16) | class SignInMethodNotFoundError extends Error {}
  class WrongPasswordError (line 17) | class WrongPasswordError extends Error {}
  class PasswordTooWeakError (line 18) | class PasswordTooWeakError extends Error {}
  class PasswordTooLongError (line 19) | class PasswordTooLongError extends Error {}
  function addPasswordSignInMethod (line 21) | async function addPasswordSignInMethod(
  function encryptPassword (line 44) | async function encryptPassword(password: string): Promise<string> {
  function encryptSecret (line 56) | async function encryptSecret(secret: string): Promise<string> {
  function verifySecret (line 61) | async function verifySecret(secret: string, hash: string): Promise<boole...
  function scrypt (line 66) | async function scrypt(secret: string, salt: string): Promise<string> {
  function singInUsingPassword (line 84) | async function singInUsingPassword(
  function verifyPassword (line 117) | async function verifyPassword(

FILE: example/src/user/sign-in-method/sign-in-method.table.ts
  type SignInMethodTable (line 3) | interface SignInMethodTable {
  type SignInMethodRow (line 8) | type SignInMethodRow = Selectable<SignInMethodTable>
  type InsertableSignInMethodRow (line 9) | type InsertableSignInMethodRow = Insertable<SignInMethodTable>
  type UpdateableSignInMethodRow (line 10) | type UpdateableSignInMethodRow = Updateable<SignInMethodTable>

FILE: example/src/user/sign-in-method/sign-in-method.ts
  type SignInMethod (line 3) | type SignInMethod = PasswordSignInMethod
  type PasswordSignInMethod (line 5) | interface PasswordSignInMethod {

FILE: example/src/user/signed-in-user.ts
  type SignedInUser (line 5) | interface SignedInUser {

FILE: example/src/user/user.controller.ts
  function userController (line 9) | function userController(router: Router): void {

FILE: example/src/user/user.repository.ts
  function insertUser (line 5) | async function insertUser(
  function findUserById (line 18) | async function findUserById(
  function lockUserById (line 31) | async function lockUserById(
  function lockUserByEmail (line 38) | async function lockUserByEmail(
  function lockUser (line 45) | async function lockUser(
  function setUserEmail (line 60) | async function setUserEmail(

FILE: example/src/user/user.service.ts
  function createAnonymousUser (line 10) | async function createAnonymousUser(
  function findUserById (line 33) | async function findUserById(
  function lockUserById (line 44) | async function lockUserById(
  function lockUserByEmail (line 55) | async function lockUserByEmail(
  function setUserEmail (line 66) | async function setUserEmail(
  function userRowToUser (line 74) | function userRowToUser(user: UserRow): User {

FILE: example/src/user/user.table.ts
  type UserTable (line 3) | interface UserTable {
  type UserRow (line 11) | type UserRow = Selectable<UserTable>
  type InsertableUserRow (line 12) | type InsertableUserRow = Insertable<UserTable>
  type UpdateableUserRow (line 13) | type UpdateableUserRow = Updateable<UserTable>

FILE: example/src/user/user.ts
  type User (line 3) | interface User {
  type CreateAnonymousUserRequest (line 10) | interface CreateAnonymousUserRequest {

FILE: example/src/util/errors.ts
  type AuthenticationErrors (line 1) | type AuthenticationErrors =
  type UserApiErrors (line 9) | type UserApiErrors = 'InvalidUser' | 'UserNotFound'
  type SignInMethodApiErrors (line 11) | type SignInMethodApiErrors =
  type ErrorCode (line 20) | type ErrorCode =
  type ErrorStatus (line 26) | type ErrorStatus = 400 | 401 | 403 | 404 | 409 | 500
  class ControllerError (line 28) | class ControllerError extends Error {
    method constructor (line 33) | constructor(
    method toJSON (line 45) | toJSON() {
  class UserNotFoundError (line 52) | class UserNotFoundError extends Error {}

FILE: example/src/util/object.ts
  function isObject (line 1) | function isObject(value: unknown): value is Record<string, any> {

FILE: example/test/test-config.ts
  type TestConfig (line 4) | interface TestConfig extends Config {

FILE: example/test/test-context.ts
  class TestContext (line 18) | class TestContext {
    method db (line 26) | get db(): Kysely<Database> {

FILE: example/test/user/user.test.ts
  constant EMAIL (line 7) | const EMAIL = 'foo@bar.fake'
  constant PASSWORD (line 8) | const PASSWORD = '12345678'
  function createAuthHeaders (line 127) | function createAuthHeaders(authToken: string) {
  function createPasswordSignInMethod (line 135) | async function createPasswordSignInMethod(

FILE: scripts/add-deno-type-references.js
  constant ESM_DIST_PATH (line 11) | const ESM_DIST_PATH = path.join(__dirname, '..', 'dist', 'esm')

FILE: scripts/check-esm-imports.js
  function checkDir (line 13) | function checkDir(dir) {
  function readLines (line 37) | function readLines(filePath) {
  function isLocalImport (line 42) | function isLocalImport(row) {
  function isDotJsImport (line 46) | function isDotJsImport(row) {

FILE: scripts/check-exports.js
  function checkExports (line 13) | function checkExports(dir) {

FILE: scripts/copy-interface-documentation.js
  constant DIST_PATH (line 18) | const DIST_PATH = path.join(__dirname, '..', 'dist')
  constant PROPERTY_REGEX (line 20) | const PROPERTY_REGEX = /^\s+(?:get )?(?:readonly )?(?:abstract )?(\w+)[\...
  constant OBJECT_REGEXES (line 21) | const OBJECT_REGEXES = [
  constant GENERIC_ARGUMENTS_REGEX (line 25) | const GENERIC_ARGUMENTS_REGEX = /<[\w"'`,{}=|\[\] ]+>/g
  constant JSDOC_START_REGEX (line 26) | const JSDOC_START_REGEX = /^\s+\/\*\*/
  constant JSDOC_END_REGEX (line 27) | const JSDOC_END_REGEX = /^\s+\*\//
  function main (line 29) | function main() {
  function readLines (line 57) | function readLines(filePath) {
  function parseObjects (line 66) | function parseObjects(file) {
  function parseImplements (line 123) | function parseImplements(line) {
  function parseDocumentation (line 161) | function parseDocumentation(lines, propertyLineIdx) {
  function copyDocumentation (line 181) | function copyDocumentation(files) {
  function findDocProperty (line 219) | function findDocProperty(files, object, propertyName) {
  function findObject (line 247) | function findObject(files, objectName) {

FILE: scripts/generate-site-examples.js
  constant ESM_PATH (line 13) | const ESM_PATH = path.join(__dirname, '..', 'dist', 'esm')
  constant SITE_EXAMPLE_PATH (line 14) | const SITE_EXAMPLE_PATH = path.join(__dirname, '..', 'site', 'docs', 'ex...
  constant SITE_EXAMPLE_START_REGEX (line 16) | const SITE_EXAMPLE_START_REGEX = /<!--\s*siteExample\(/
  constant SITE_EXAMPLE_ANNOTATION_REGEX (line 17) | const SITE_EXAMPLE_ANNOTATION_REGEX =
  constant CODE_BLOCK_START_REGEX (line 20) | const CODE_BLOCK_START_REGEX = /\*\s*```/
  constant CODE_BLOCK_END_REGEX (line 21) | const CODE_BLOCK_END_REGEX = /\*\s*```/
  constant COMMENT_LINE_REGEX (line 22) | const COMMENT_LINE_REGEX = /\*\s*(.*)/
  constant CODE_LINE_REGEX (line 23) | const CODE_LINE_REGEX = /\*(.*)/
  function main (line 98) | function main() {
  function deleteAllExamples (line 145) | function deleteAllExamples() {
  function readLines (line 161) | function readLines(filePath) {
  function isCodeBlockEnd (line 166) | function isCodeBlockEnd(state) {
  function writeSiteExample (line 170) | function writeSiteExample(state) {
  function buildMoreExamplesMarkdown (line 238) | function buildMoreExamplesMarkdown(category) {
  function exitExample (line 262) | function exitExample(state) {
  function addCodeLine (line 270) | function addCodeLine(state) {
  function isCodeBlockStart (line 284) | function isCodeBlockStart(state) {
  function enterCodeBlock (line 288) | function enterCodeBlock(state) {
  function addCommentLine (line 292) | function addCommentLine(state) {
  function isExampleStart (line 306) | function isExampleStart(state) {
  function enterExample (line 310) | function enterExample(state) {
  function deindent (line 324) | function deindent(str) {
  function trimEmptyLines (line 346) | function trimEmptyLines(lines) {
  function overwritePlaygroundTypes (line 358) | function overwritePlaygroundTypes() {

FILE: scripts/module-fixup.js
  constant ROOT_PATH (line 14) | const ROOT_PATH = path.join(__dirname, '..')
  constant DIST_PATH (line 15) | const DIST_PATH = path.join(ROOT_PATH, 'dist')

FILE: scripts/util/for-each-file.js
  function forEachFile (line 4) | function forEachFile(dir, callback) {
  function isDir (line 18) | function isDir(file) {

FILE: site/docs/getting-started/Dialects.tsx
  type DialectsProps (line 24) | type DialectsProps = PropsWithPackageManager
  type BuiltInDialect (line 26) | interface BuiltInDialect {
  function Dialects (line 54) | function Dialects(props: DialectsProps) {
  type UnsupportedDriverProps (line 156) | interface UnsupportedDriverProps {
  function UnsupportedDriver (line 162) | function UnsupportedDriver(props: UnsupportedDriverProps) {

FILE: site/docs/getting-started/IUseADifferentDialect.tsx
  function IUseADifferentDialect (line 8) | function IUseADifferentDialect(

FILE: site/docs/getting-started/IUseADifferentPackageManager.tsx
  function IUseADifferentPackageManager (line 8) | function IUseADifferentPackageManager(

FILE: site/docs/getting-started/Installation.tsx
  type PackageManagerDetails (line 14) | interface PackageManagerDetails {
  function Installation (line 99) | function Installation() {

FILE: site/docs/getting-started/Instantiation.tsx
  type InstantiationProps (line 23) | type InstantiationProps = PropsWithDialect<PropsWithPackageManager>
  function Instantiation (line 25) | function Instantiation(props: InstantiationProps) {
  function getNotSupportedCode (line 109) | function getNotSupportedCode(
  function getDialectSpecificCodeSnippet (line 121) | function getDialectSpecificCodeSnippet(

FILE: site/docs/getting-started/Querying.tsx
  function Querying (line 75) | function Querying(props: PropsWithDialect) {

FILE: site/docs/getting-started/Summary.tsx
  function Summary (line 60) | function Summary(props: PropsWithDialect) {

FILE: site/docs/getting-started/shared.tsx
  constant DIALECTS (line 5) | const DIALECTS = ['postgresql', 'mysql', 'sqlite', 'mssql'] as const
  type Dialect (line 7) | type Dialect = (typeof DIALECTS)[number]
  constant DEFAULT_DIALECT (line 9) | const DEFAULT_DIALECT = 'postgresql' satisfies Dialect
  type PropsWithDialect (line 11) | type PropsWithDialect<P = {}> = P & {
  type PropsWithPackageManager (line 17) | type PropsWithPackageManager<P = {}> = P & {
  constant PACKAGE_MANAGERS (line 23) | const PACKAGE_MANAGERS = ['npm', 'pnpm', 'yarn', 'deno', 'bun'] as const
  type PackageManager (line 25) | type PackageManager = (typeof PACKAGE_MANAGERS)[number]
  constant DEFAULT_PACKAGE_MANAGER (line 27) | const DEFAULT_PACKAGE_MANAGER = 'npm' satisfies PackageManager
  constant PACKAGE_MANAGER_UNSUPPORTED_DIALECTS (line 29) | const PACKAGE_MANAGER_UNSUPPORTED_DIALECTS: Record<PackageManager, Diale...
  function isDialectSupported (line 38) | function isDialectSupported(
  constant DIALECT_CLASS_NAMES (line 45) | const DIALECT_CLASS_NAMES = {
  constant POOL_NPM_PACKAGE_NAMES (line 62) | const POOL_NPM_PACKAGE_NAMES = {
  constant PRETTY_DIALECT_NAMES (line 66) | const PRETTY_DIALECT_NAMES = {
  constant PRETTY_PACKAGE_MANAGER_NAMES (line 73) | const PRETTY_PACKAGE_MANAGER_NAMES = {
  constant PACKAGE_MANAGER_INSTALL_COMMANDS (line 81) | const PACKAGE_MANAGER_INSTALL_COMMANDS = {
  type Command (line 88) | interface Command {
  function getBashCommand (line 95) | function getBashCommand(
  function getDenoCommand (line 116) | function getDenoCommand(
  type UseSearchStateProps (line 144) | interface UseSearchStateProps<Value extends string> {
  function useSearchState (line 151) | function useSearchState<Value extends string>(

FILE: site/src/components/DemoVideo.tsx
  function DemoVideo (line 4) | function DemoVideo() {

FILE: site/src/components/Playground.tsx
  function Playground (line 8) | function Playground(props: PlaygroundProps) {
  function useSrc (line 65) | function useSrc(props: PlaygroundProps) {
  function getPlaygroundStateHash (line 87) | function getPlaygroundStateHash(props: PlaygroundProps) {
  type PlaygroundProps (line 103) | interface PlaygroundProps {
  type PlaygroundState (line 111) | interface PlaygroundState {

FILE: site/src/components/SectionFeatures/index.tsx
  type FeatureItem (line 5) | type FeatureItem = {
  function TickIcon (line 101) | function TickIcon(props: SVGProps<SVGSVGElement>) {
  function Feature (line 119) | function Feature({ title, description }: FeatureItem) {
  function SectionFeatures (line 135) | function SectionFeatures(): JSX.Element {

FILE: site/src/components/SectionQuotes/Quote.tsx
  type QuoteProps (line 7) | interface QuoteProps {
  function Quote (line 22) | function Quote(props: QuoteProps) {
  function XIcon (line 54) | function XIcon() {
  function DiscordIcon (line 68) | function DiscordIcon() {
  function GithubIcon (line 89) | function GithubIcon() {
  function RedditIcon (line 108) | function RedditIcon() {

FILE: site/src/components/SectionQuotes/index.tsx
  function SectionQuotes (line 7) | function SectionQuotes() {

FILE: site/src/components/playground-example-types.ts
  constant GENERATED_PLAYGROUND_EXAMPLE_TYPES (line 3) | const GENERATED_PLAYGROUND_EXAMPLE_TYPES = `import type {

FILE: site/src/pages/index.tsx
  function HomepageHeader (line 13) | function HomepageHeader() {
  function Home (line 66) | function Home(): JSX.Element {
  constant STACKBLITZ_URL (line 87) | const STACKBLITZ_URL = 'https://stackblitz.com/edit/react-ts-pppzf5'
  constant STACKBLITZ_PARAMS (line 88) | const STACKBLITZ_PARAMS = new URLSearchParams({
  function SectionPlayground (line 98) | function SectionPlayground() {
  function SectionExamplesCTA (line 130) | function SectionExamplesCTA() {

FILE: src/dialect/database-introspector.ts
  type DatabaseIntrospector (line 4) | interface DatabaseIntrospector {
  type DatabaseMetadataOptions (line 23) | interface DatabaseMetadataOptions {
  type SchemaMetadata (line 31) | interface SchemaMetadata {
  type DatabaseMetadata (line 35) | interface DatabaseMetadata {
  type TableMetadata (line 43) | interface TableMetadata {
  type ColumnMetadata (line 50) | interface ColumnMetadata {

FILE: src/dialect/dialect-adapter-base.ts
  method supportsCreateIfNotExists (line 11) | get supportsCreateIfNotExists(): boolean {
  method supportsTransactionalDdl (line 15) | get supportsTransactionalDdl(): boolean {
  method supportsReturning (line 19) | get supportsReturning(): boolean {
  method supportsOutput (line 23) | get supportsOutput(): boolean {

FILE: src/dialect/dialect-adapter.ts
  type DialectAdapter (line 11) | interface DialectAdapter {
  type MigrationLockOptions (line 113) | interface MigrationLockOptions {

FILE: src/dialect/dialect.ts
  type Dialect (line 14) | interface Dialect {

FILE: src/dialect/mssql/mssql-adapter.ts
  class MssqlAdapter (line 6) | class MssqlAdapter extends DialectAdapterBase {
    method supportsCreateIfNotExists (line 7) | override get supportsCreateIfNotExists(): boolean {
    method supportsTransactionalDdl (line 11) | override get supportsTransactionalDdl(): boolean {
    method supportsOutput (line 15) | override get supportsOutput(): boolean {
    method acquireMigrationLock (line 19) | override async acquireMigrationLock(db: Kysely<any>): Promise<void> {
    method releaseMigrationLock (line 29) | override async releaseMigrationLock(): Promise<void> {

FILE: src/dialect/mssql/mssql-dialect-config.ts
  type MssqlDialectConfig (line 3) | interface MssqlDialectConfig {
  type Tedious (line 78) | interface Tedious {
  type TediousConnection (line 90) | interface TediousConnection {
  type TediousIsolationLevel (line 124) | type TediousIsolationLevel = Record<string, number>
  type TediousRequestClass (line 126) | interface TediousRequestClass {
  class TediousRequest (line 136) | class TediousRequest {
  type TediousTypes (line 158) | interface TediousTypes {
  type TediousDataType (line 169) | interface TediousDataType {}
  type TediousColumnValue (line 171) | interface TediousColumnValue {
  type Tarn (line 178) | interface Tarn {
  class TarnPool (line 197) | class TarnPool<R> {
  type TarnPoolOptions (line 204) | interface TarnPoolOptions<R> {
  type TarnPendingRequest (line 220) | interface TarnPendingRequest<R> {

FILE: src/dialect/mssql/mssql-dialect.ts
  class MssqlDialect (line 52) | class MssqlDialect implements Dialect {
    method constructor (line 55) | constructor(config: MssqlDialectConfig) {
    method createDriver (line 59) | createDriver(): Driver {
    method createQueryCompiler (line 63) | createQueryCompiler(): QueryCompiler {
    method createAdapter (line 67) | createAdapter(): DialectAdapter {
    method createIntrospector (line 71) | createIntrospector(db: Kysely<any>): DatabaseIntrospector {

FILE: src/dialect/mssql/mssql-driver.ts
  constant PRIVATE_RESET_METHOD (line 34) | const PRIVATE_RESET_METHOD: unique symbol = Symbol()
  constant PRIVATE_DESTROY_METHOD (line 35) | const PRIVATE_DESTROY_METHOD: unique symbol = Symbol()
  constant PRIVATE_VALIDATE_METHOD (line 36) | const PRIVATE_VALIDATE_METHOD: unique symbol = Symbol()
  class MssqlDriver (line 38) | class MssqlDriver implements Driver {
    method constructor (line 42) | constructor(config: MssqlDialectConfig) {
    method init (line 71) | async init(): Promise<void> {
    method acquireConnection (line 75) | async acquireConnection(): Promise<DatabaseConnection> {
    method beginTransaction (line 79) | async beginTransaction(
    method commitTransaction (line 86) | async commitTransaction(connection: MssqlConnection): Promise<void> {
    method rollbackTransaction (line 90) | async rollbackTransaction(connection: MssqlConnection): Promise<void> {
    method savepoint (line 94) | async savepoint(
    method rollbackToSavepoint (line 101) | async rollbackToSavepoint(
    method releaseConnection (line 108) | async releaseConnection(connection: MssqlConnection): Promise<void> {
    method destroy (line 119) | async destroy(): Promise<void> {
  class MssqlConnection (line 124) | class MssqlConnection implements DatabaseConnection {
    method constructor (line 129) | constructor(connection: TediousConnection, tedious: Tedious) {
    method beginTransaction (line 135) | async beginTransaction(settings: TransactionSettings): Promise<void> {
    method commitTransaction (line 152) | async commitTransaction(): Promise<void> {
    method connect (line 161) | async connect(): Promise<this> {
    method executeQuery (line 202) | async executeQuery<O>(compiledQuery: CompiledQuery): Promise<QueryResu...
    method rollbackTransaction (line 225) | async rollbackTransaction(savepointName?: string): Promise<void> {
    method savepoint (line 234) | async savepoint(savepointName: string): Promise<void> {
    method streamQuery (line 243) | async *streamQuery<O>(
    method #getTediousIsolationLevel (line 278) | #getTediousIsolationLevel(isolationLevel: IsolationLevel) {
    method #cancelRequest (line 301) | #cancelRequest<O>(request: MssqlRequest<O>): Promise<void> {
    method [PRIVATE_DESTROY_METHOD] (line 314) | [PRIVATE_DESTROY_METHOD](): Promise<void> {
    method [PRIVATE_RESET_METHOD] (line 326) | async [PRIVATE_RESET_METHOD](): Promise<void> {
    method [PRIVATE_VALIDATE_METHOD] (line 338) | async [PRIVATE_VALIDATE_METHOD](): Promise<boolean> {
    method #isConnectionClosed (line 362) | #isConnectionClosed(): boolean {
  type OnDone (line 367) | interface OnDone<O> {
  type PlainDeferred (line 372) | interface PlainDeferred<O> {
  class MssqlRequest (line 377) | class MssqlRequest<O> {
    method constructor (line 388) | constructor(props: MssqlRequestProps<O>) {
    method request (line 437) | get request(): TediousRequest {
    method readChunk (line 441) | readChunk(): Promise<O[]> {
    method #addParametersToRequest (line 459) | #addParametersToRequest(parameters: readonly unknown[]): void {
    method #attachListeners (line 471) | #attachListeners(): void {
    method #getTediousDataType (line 506) | #getTediousDataType(value: unknown): any {
  type MssqlRequestProps (line 539) | interface MssqlRequestProps<O> {

FILE: src/dialect/mssql/mssql-introspector.ts
  class MssqlIntrospector (line 15) | class MssqlIntrospector implements DatabaseIntrospector {
    method constructor (line 18) | constructor(db: Kysely<any>) {
    method getSchemas (line 22) | async getSchemas(): Promise<SchemaMetadata[]> {
    method getTables (line 26) | async getTables(
    method getMetadata (line 172) | async getMetadata(
  type MssqlSysTables (line 181) | interface MssqlSysTables {

FILE: src/dialect/mssql/mssql-query-compiler.ts
  constant COLLATION_CHAR_REGEX (line 9) | const COLLATION_CHAR_REGEX = /^[a-z0-9_]$/i
  class MssqlQueryCompiler (line 11) | class MssqlQueryCompiler extends DefaultQueryCompiler {
    method getCurrentParameterPlaceholder (line 12) | protected override getCurrentParameterPlaceholder(): string {
    method visitOffset (line 16) | protected override visitOffset(node: OffsetNode): void {
    method compileColumnAlterations (line 26) | protected override compileColumnAlterations(
    method visitAddColumn (line 78) | protected override visitAddColumn(node: AddColumnNode): void {
    method visitDropColumn (line 82) | protected override visitDropColumn(node: DropColumnNode): void {
    method visitMergeQuery (line 86) | protected override visitMergeQuery(node: MergeQueryNode): void {
    method visitCollate (line 91) | protected override visitCollate(node: CollateNode): void {
    method announcesNewColumnDataType (line 105) | protected override announcesNewColumnDataType(): boolean {

FILE: src/dialect/mysql/mysql-adapter.ts
  constant LOCK_ID (line 6) | const LOCK_ID = 'ea586330-2c93-47c8-908d-981d9d270f9d'
  constant LOCK_TIMEOUT_SECONDS (line 7) | const LOCK_TIMEOUT_SECONDS = 60 * 60
  class MysqlAdapter (line 9) | class MysqlAdapter extends DialectAdapterBase {
    method supportsTransactionalDdl (line 10) | override get supportsTransactionalDdl(): boolean {
    method supportsReturning (line 14) | override get supportsReturning(): boolean {
    method acquireMigrationLock (line 18) | override async acquireMigrationLock(
    method releaseMigrationLock (line 33) | override async releaseMigrationLock(

FILE: src/dialect/mysql/mysql-dialect-config.ts
  type MysqlDialectConfig (line 8) | interface MysqlDialectConfig {
  type MysqlPool (line 37) | interface MysqlPool {
  type MysqlPoolConnection (line 44) | interface MysqlPoolConnection {
  type MysqlStreamOptions (line 57) | interface MysqlStreamOptions {
  type MysqlStream (line 62) | interface MysqlStream<T> {
  type MysqlOkPacket (line 66) | interface MysqlOkPacket {
  type MysqlQueryResult (line 72) | type MysqlQueryResult = MysqlOkPacket | Record<string, unknown>[]

FILE: src/dialect/mysql/mysql-dialect.ts
  class MysqlDialect (line 43) | class MysqlDialect implements Dialect {
    method constructor (line 46) | constructor(config: MysqlDialectConfig) {
    method createDriver (line 50) | createDriver(): Driver {
    method createQueryCompiler (line 54) | createQueryCompiler(): QueryCompiler {
    method createAdapter (line 58) | createAdapter(): DialectAdapter {
    method createIntrospector (line 62) | createIntrospector(db: Kysely<any>): DatabaseIntrospector {

FILE: src/dialect/mysql/mysql-driver.ts
  constant PRIVATE_RELEASE_METHOD (line 20) | const PRIVATE_RELEASE_METHOD: unique symbol = Symbol()
  class MysqlDriver (line 22) | class MysqlDriver implements Driver {
    method constructor (line 27) | constructor(configOrPool: MysqlDialectConfig) {
    method init (line 31) | async init(): Promise<void> {
    method acquireConnection (line 37) | async acquireConnection(): Promise<DatabaseConnection> {
    method #acquireConnection (line 60) | async #acquireConnection(): Promise<MysqlPoolConnection> {
    method beginTransaction (line 72) | async beginTransaction(
    method commitTransaction (line 96) | async commitTransaction(connection: DatabaseConnection): Promise<void> {
    method rollbackTransaction (line 100) | async rollbackTransaction(connection: DatabaseConnection): Promise<voi...
    method savepoint (line 104) | async savepoint(
    method rollbackToSavepoint (line 117) | async rollbackToSavepoint(
    method releaseSavepoint (line 130) | async releaseSavepoint(
    method releaseConnection (line 143) | async releaseConnection(connection: MysqlConnection): Promise<void> {
    method destroy (line 147) | async destroy(): Promise<void> {
  function isOkPacket (line 160) | function isOkPacket(obj: unknown): obj is MysqlOkPacket {
  class MysqlConnection (line 164) | class MysqlConnection implements DatabaseConnection {
    method constructor (line 167) | constructor(rawConnection: MysqlPoolConnection) {
    method executeQuery (line 171) | async executeQuery<O>(compiledQuery: CompiledQuery): Promise<QueryResu...
    method #executeQuery (line 209) | #executeQuery(compiledQuery: CompiledQuery): Promise<MysqlQueryResult> {
    method streamQuery (line 225) | async *streamQuery<O>(
    method [PRIVATE_RELEASE_METHOD] (line 257) | [PRIVATE_RELEASE_METHOD](): void {

FILE: src/dialect/mysql/mysql-introspector.ts
  class MysqlIntrospector (line 16) | class MysqlIntrospector implements DatabaseIntrospector {
    method constructor (line 19) | constructor(db: Kysely<any>) {
    method getSchemas (line 23) | async getSchemas(): Promise<SchemaMetadata[]> {
    method getTables (line 33) | async getTables(
    method getMetadata (line 70) | async getMetadata(
    method #parseTableMetadata (line 78) | #parseTableMetadata(columns: RawColumnMetadata[]): TableMetadata[] {
  type RawSchemaMetadata (line 109) | interface RawSchemaMetadata {
  type RawColumnMetadata (line 113) | interface RawColumnMetadata {

FILE: src/dialect/mysql/mysql-query-compiler.ts
  constant LITERAL_ESCAPE_REGEX (line 4) | const LITERAL_ESCAPE_REGEX = /\\|'/g
  constant ID_WRAP_REGEX (line 5) | const ID_WRAP_REGEX = /`/g
  class MysqlQueryCompiler (line 7) | class MysqlQueryCompiler extends DefaultQueryCompiler {
    method getCurrentParameterPlaceholder (line 8) | protected override getCurrentParameterPlaceholder(): string {
    method getLeftExplainOptionsWrapper (line 12) | protected override getLeftExplainOptionsWrapper(): string {
    method getExplainOptionAssignment (line 16) | protected override getExplainOptionAssignment(): string {
    method getExplainOptionsDelimiter (line 20) | protected override getExplainOptionsDelimiter(): string {
    method getRightExplainOptionsWrapper (line 24) | protected override getRightExplainOptionsWrapper(): string {
    method getLeftIdentifierWrapper (line 28) | protected override getLeftIdentifierWrapper(): string {
    method getRightIdentifierWrapper (line 32) | protected override getRightIdentifierWrapper(): string {
    method sanitizeIdentifier (line 36) | protected override sanitizeIdentifier(identifier: string): string {
    method sanitizeStringLiteral (line 47) | protected override sanitizeStringLiteral(value: string): string {
    method visitCreateIndex (line 53) | protected override visitCreateIndex(node: CreateIndexNode): void {

FILE: src/dialect/postgres/postgres-adapter.ts
  constant LOCK_ID (line 7) | const LOCK_ID = BigInt('3853314791062309107')
  class PostgresAdapter (line 9) | class PostgresAdapter extends DialectAdapterBase {
    method supportsTransactionalDdl (line 10) | override get supportsTransactionalDdl(): boolean {
    method supportsReturning (line 14) | override get supportsReturning(): boolean {
    method acquireMigrationLock (line 18) | override async acquireMigrationLock(
    method releaseMigrationLock (line 26) | override async releaseMigrationLock(

FILE: src/dialect/postgres/postgres-dialect-config.ts
  type PostgresDialectConfig (line 6) | interface PostgresDialectConfig {
  type PostgresPool (line 52) | interface PostgresPool {
  type PostgresPoolClient (line 57) | interface PostgresPoolClient {
  type PostgresCursor (line 66) | interface PostgresCursor<T> {
  type PostgresCursorConstructor (line 71) | type PostgresCursorConstructor = new <T>(
  type PostgresQueryResult (line 76) | interface PostgresQueryResult<R> {
  type PostgresStream (line 82) | interface PostgresStream<T> {

FILE: src/dialect/postgres/postgres-dialect.ts
  class PostgresDialect (line 43) | class PostgresDialect implements Dialect {
    method constructor (line 46) | constructor(config: PostgresDialectConfig) {
    method createDriver (line 50) | createDriver(): Driver {
    method createQueryCompiler (line 54) | createQueryCompiler(): QueryCompiler {
    method createAdapter (line 58) | createAdapter(): DialectAdapter {
    method createIntrospector (line 62) | createIntrospector(db: Kysely<any>): DatabaseIntrospector {

FILE: src/dialect/postgres/postgres-driver.ts
  constant PRIVATE_RELEASE_METHOD (line 19) | const PRIVATE_RELEASE_METHOD: unique symbol = Symbol()
  class PostgresDriver (line 21) | class PostgresDriver implements Driver {
    method constructor (line 26) | constructor(config: PostgresDialectConfig) {
    method init (line 30) | async init(): Promise<void> {
    method acquireConnection (line 36) | async acquireConnection(): Promise<DatabaseConnection> {
    method beginTransaction (line 61) | async beginTransaction(
    method commitTransaction (line 82) | async commitTransaction(connection: DatabaseConnection): Promise<void> {
    method rollbackTransaction (line 86) | async rollbackTransaction(connection: DatabaseConnection): Promise<voi...
    method savepoint (line 90) | async savepoint(
    method rollbackToSavepoint (line 103) | async rollbackToSavepoint(
    method releaseSavepoint (line 116) | async releaseSavepoint(
    method releaseConnection (line 129) | async releaseConnection(connection: PostgresConnection): Promise<void> {
    method destroy (line 133) | async destroy(): Promise<void> {
  type PostgresConnectionOptions (line 142) | interface PostgresConnectionOptions {
  class PostgresConnection (line 146) | class PostgresConnection implements DatabaseConnection {
    method constructor (line 150) | constructor(client: PostgresPoolClient, options: PostgresConnectionOpt...
    method executeQuery (line 155) | async executeQuery<O>(compiledQuery: CompiledQuery): Promise<QueryResu...
    method streamQuery (line 177) | async *streamQuery<O>(
    method [PRIVATE_RELEASE_METHOD] (line 215) | [PRIVATE_RELEASE_METHOD](): void {

FILE: src/dialect/postgres/postgres-introspector.ts
  class PostgresIntrospector (line 16) | class PostgresIntrospector implements DatabaseIntrospector {
    method constructor (line 19) | constructor(db: Kysely<any>) {
    method getSchemas (line 23) | async getSchemas(): Promise<SchemaMetadata[]> {
    method getTables (line 33) | async getTables(
    method getMetadata (line 99) | async getMetadata(
    method #parseTableMetadata (line 107) | #parseTableMetadata(columns: RawColumnMetadata[]): TableMetadata[] {
  type RawSchemaMetadata (line 141) | interface RawSchemaMetadata {
  type RawColumnMetadata (line 145) | interface RawColumnMetadata {

FILE: src/dialect/postgres/postgres-query-compiler.ts
  constant ID_WRAP_REGEX (line 3) | const ID_WRAP_REGEX = /"/g
  class PostgresQueryCompiler (line 5) | class PostgresQueryCompiler extends DefaultQueryCompiler {
    method sanitizeIdentifier (line 6) | protected override sanitizeIdentifier(identifier: string): string {

FILE: src/dialect/sqlite/sqlite-adapter.ts
  class SqliteAdapter (line 5) | class SqliteAdapter extends DialectAdapterBase {
    method supportsTransactionalDdl (line 6) | override get supportsTransactionalDdl(): boolean {
    method supportsReturning (line 10) | override get supportsReturning(): boolean {
    method acquireMigrationLock (line 14) | override async acquireMigrationLock(
    method releaseMigrationLock (line 23) | override async releaseMigrationLock(

FILE: src/dialect/sqlite/sqlite-dialect-config.ts
  type SqliteDialectConfig (line 6) | interface SqliteDialectConfig {
  type SqliteDatabase (line 32) | interface SqliteDatabase {
  type SqliteStatement (line 37) | interface SqliteStatement {

FILE: src/dialect/sqlite/sqlite-dialect.ts
  class SqliteDialect (line 38) | class SqliteDialect implements Dialect {
    method constructor (line 41) | constructor(config: SqliteDialectConfig) {
    method createDriver (line 45) | createDriver(): Driver {
    method createQueryCompiler (line 49) | createQueryCompiler(): QueryCompiler {
    method createAdapter (line 53) | createAdapter(): DialectAdapter {
    method createIntrospector (line 57) | createIntrospector(db: Kysely<any>): DatabaseIntrospector {

FILE: src/dialect/sqlite/sqlite-driver.ts
  class SqliteDriver (line 17) | class SqliteDriver implements Driver {
    method constructor (line 24) | constructor(config: SqliteDialectConfig) {
    method init (line 28) | async init(): Promise<void> {
    method acquireConnection (line 40) | async acquireConnection(): Promise<DatabaseConnection> {
    method beginTransaction (line 47) | async beginTransaction(connection: DatabaseConnection): Promise<void> {
    method commitTransaction (line 51) | async commitTransaction(connection: DatabaseConnection): Promise<void> {
    method rollbackTransaction (line 55) | async rollbackTransaction(connection: DatabaseConnection): Promise<voi...
    method savepoint (line 59) | async savepoint(
    method rollbackToSavepoint (line 72) | async rollbackToSavepoint(
    method releaseSavepoint (line 85) | async releaseSavepoint(
    method releaseConnection (line 98) | async releaseConnection(): Promise<void> {
    method destroy (line 102) | async destroy(): Promise<void> {
  class SqliteConnection (line 107) | class SqliteConnection implements DatabaseConnection {
    method constructor (line 110) | constructor(db: SqliteDatabase) {
    method executeQuery (line 114) | executeQuery<O>(compiledQuery: CompiledQuery): Promise<QueryResult<O>> {
    method streamQuery (line 137) | async *streamQuery<R>(
  class ConnectionMutex (line 156) | class ConnectionMutex {
    method lock (line 160) | async lock(): Promise<void> {
    method unlock (line 170) | unlock(): void {

FILE: src/dialect/sqlite/sqlite-introspector.ts
  type SqliteSystemDatabase (line 16) | interface SqliteSystemDatabase {
  type SQliteMasterTable (line 22) | interface SQliteMasterTable {
  type PragmaTableInfo (line 31) | interface PragmaTableInfo {
  class SqliteIntrospector (line 40) | class SqliteIntrospector implements DatabaseIntrospector {
    method constructor (line 43) | constructor(db: Kysely<any>) {
    method getSchemas (line 47) | async getSchemas(): Promise<SchemaMetadata[]> {
    method getTables (line 52) | async getTables(
    method getMetadata (line 58) | async getMetadata(
    method #tablesQuery (line 66) | #tablesQuery(
    method #getTableMetadata (line 85) | async #getTableMetadata(

FILE: src/dialect/sqlite/sqlite-query-compiler.ts
  constant ID_WRAP_REGEX (line 5) | const ID_WRAP_REGEX = /"/g
  class SqliteQueryCompiler (line 7) | class SqliteQueryCompiler extends DefaultQueryCompiler {
    method visitOrAction (line 8) | protected override visitOrAction(node: OrActionNode): void {
    method getCurrentParameterPlaceholder (line 13) | protected override getCurrentParameterPlaceholder(): string {
    method getLeftExplainOptionsWrapper (line 17) | protected override getLeftExplainOptionsWrapper(): string {
    method getRightExplainOptionsWrapper (line 21) | protected override getRightExplainOptionsWrapper(): string {
    method getLeftIdentifierWrapper (line 25) | protected override getLeftIdentifierWrapper(): string {
    method getRightIdentifierWrapper (line 29) | protected override getRightIdentifierWrapper(): string {
    method getAutoIncrement (line 33) | protected override getAutoIncrement(): string {
    method sanitizeIdentifier (line 37) | protected override sanitizeIdentifier(identifier: string): string {
    method visitDefaultInsertValue (line 41) | protected override visitDefaultInsertValue(_: DefaultInsertValueNode):...

FILE: src/driver/connection-provider.ts
  type ConnectionProvider (line 3) | interface ConnectionProvider {

FILE: src/driver/database-connection.ts
  type DatabaseConnection (line 8) | interface DatabaseConnection {
  type QueryResult (line 16) | interface QueryResult<O> {

FILE: src/driver/default-connection-provider.ts
  class DefaultConnectionProvider (line 5) | class DefaultConnectionProvider implements ConnectionProvider {
    method constructor (line 8) | constructor(driver: Driver) {
    method provideConnection (line 12) | async provideConnection<T>(

FILE: src/driver/driver.ts
  type Driver (line 9) | interface Driver {
  type TransactionSettings (line 79) | interface TransactionSettings {
  constant TRANSACTION_ACCESS_MODES (line 84) | const TRANSACTION_ACCESS_MODES = ['read only', 'read write'] as const
  type AccessMode (line 86) | type AccessMode = ArrayItemType<typeof TRANSACTION_ACCESS_MODES>
  constant TRANSACTION_ISOLATION_LEVELS (line 88) | const TRANSACTION_ISOLATION_LEVELS = [
  type IsolationLevel (line 96) | type IsolationLevel = ArrayItemType<typeof TRANSACTION_ISOLATION_LEVELS>
  function validateTransactionSettings (line 98) | function validateTransactionSettings(

FILE: src/driver/dummy-driver.ts
  class DummyDriver (line 41) | class DummyDriver implements Driver {
    method init (line 42) | async init(): Promise<void> {
    method acquireConnection (line 46) | async acquireConnection(): Promise<DatabaseConnection> {
    method beginTransaction (line 50) | async beginTransaction(): Promise<void> {
    method commitTransaction (line 54) | async commitTransaction(): Promise<void> {
    method rollbackTransaction (line 58) | async rollbackTransaction(): Promise<void> {
    method releaseConnection (line 62) | async releaseConnection(): Promise<void> {
    method destroy (line 66) | async destroy(): Promise<void> {
    method releaseSavepoint (line 70) | async releaseSavepoint(): Promise<void> {
    method rollbackToSavepoint (line 74) | async rollbackToSavepoint(): Promise<void> {
    method savepoint (line 78) | async savepoint(): Promise<void> {
  class DummyConnection (line 83) | class DummyConnection implements DatabaseConnection {
    method executeQuery (line 84) | async executeQuery<R>(): Promise<QueryResult<R>> {
    method streamQuery (line 90) | async *streamQuery<R>(): AsyncIterableIterator<QueryResult<R>> {

FILE: src/driver/runtime-driver.ts
  class RuntimeDriver (line 13) | class RuntimeDriver implements Driver {
    method constructor (line 22) | constructor(driver: Driver, log: Log) {
    method init (line 28) | async init(): Promise<void> {
    method acquireConnection (line 48) | async acquireConnection(): Promise<DatabaseConnection> {
    method releaseConnection (line 70) | async releaseConnection(connection: DatabaseConnection): Promise<void> {
    method beginTransaction (line 74) | beginTransaction(
    method commitTransaction (line 81) | commitTransaction(connection: DatabaseConnection): Promise<void> {
    method rollbackTransaction (line 85) | rollbackTransaction(connection: DatabaseConnection): Promise<void> {
    method savepoint (line 89) | savepoint(
    method rollbackToSavepoint (line 101) | rollbackToSavepoint(
    method releaseSavepoint (line 119) | releaseSavepoint(
    method destroy (line 137) | async destroy(): Promise<void> {
    method #needsLogging (line 154) | #needsLogging(): boolean {
    method #addLogging (line 163) | #addLogging(connection: DatabaseConnection): void {
    method #logError (line 214) | async #logError(
    method #logQuery (line 227) | async #logQuery(
    method #calculateDurationMillis (line 240) | #calculateDurationMillis(startTime: number): number {

FILE: src/driver/single-connection-provider.ts
  class SingleConnectionProvider (line 6) | class SingleConnectionProvider implements ConnectionProvider {
    method constructor (line 10) | constructor(connection: DatabaseConnection) {
    method provideConnection (line 14) | async provideConnection<T>(
    method #run (line 33) | async #run<T>(

FILE: src/dynamic/dynamic-reference-builder.ts
  class DynamicReferenceBuilder (line 9) | class DynamicReferenceBuilder<
    method dynamicReference (line 14) | get dynamicReference(): string {
    method refType (line 26) | protected get refType(): R {
    method constructor (line 30) | constructor(reference: string) {
    method toOperationNode (line 34) | toOperationNode(): SimpleReferenceExpressionNode {
  function isDynamicReferenceBuilder (line 39) | function isDynamicReferenceBuilder(

FILE: src/dynamic/dynamic-table-builder.ts
  class DynamicTableBuilder (line 10) | class DynamicTableBuilder<T extends string> {
    method table (line 13) | get table(): T {
    method constructor (line 17) | constructor(table: T) {
    method as (line 21) | as<A extends string>(alias: A): AliasedDynamicTableBuilder<T, A> {
  class AliasedDynamicTableBuilder (line 26) | class AliasedDynamicTableBuilder<
    method table (line 33) | get table(): T {
    method alias (line 37) | get alias(): A {
    method constructor (line 41) | constructor(table: T, alias: A) {
    method toOperationNode (line 46) | toOperationNode(): AliasNode {
  function isAliasedDynamicTableBuilder (line 54) | function isAliasedDynamicTableBuilder(

FILE: src/dynamic/dynamic.ts
  class DynamicModule (line 4) | class DynamicModule<DB> {
    method ref (line 90) | ref<R extends string = never>(reference: string): DynamicReferenceBuil...
    method table (line 127) | table<T extends keyof DB & string>(table: T): DynamicTableBuilder<T> {

FILE: src/expression/expression-builder.ts
  type ExpressionBuilder (line 82) | interface ExpressionBuilder<DB, TB extends keyof DB> {
  function createExpressionBuilder (line 1156) | function createExpressionBuilder<DB, TB extends keyof DB>(
  function expressionBuilder (line 1395) | function expressionBuilder<DB, TB extends keyof DB>(

FILE: src/expression/expression-wrapper.ts
  class ExpressionWrapper (line 23) | class ExpressionWrapper<
    method constructor (line 30) | constructor(node: OperationNode) {
    method expressionType (line 35) | get expressionType(): T | undefined {
    method as (line 70) | as(alias: string | Expression<any>): AliasedExpression<T, string> {
    method or (line 153) | or(...args: any[]): any {
    method and (line 238) | and(...args: any[]): any {
    method $castTo (line 250) | $castTo<C>(): ExpressionWrapper<DB, TB, C> {
    method $notNull (line 263) | $notNull(): ExpressionWrapper<DB, TB, Exclude<T, null>> {
    method toOperationNode (line 267) | toOperationNode(): OperationNode {
  class AliasedExpressionWrapper (line 272) | class AliasedExpressionWrapper<
    method constructor (line 279) | constructor(expr: Expression<T>, alias: A | Expression<unknown>) {
    method expression (line 285) | get expression(): Expression<T> {
    method alias (line 290) | get alias(): A | Expression<unknown> {
    method toOperationNode (line 294) | toOperationNode(): AliasNode {
  class OrWrapper (line 304) | class OrWrapper<
    method constructor (line 311) | constructor(node: OrNode) {
    method expressionType (line 316) | get expressionType(): T | undefined {
    method as (line 351) | as(alias: string | Expression<any>): AliasedExpression<T, string> {
    method or (line 367) | or(...args: any[]): any {
    method $castTo (line 379) | $castTo<C extends SqlBool>(): OrWrapper<DB, TB, C> {
    method toOperationNode (line 383) | toOperationNode(): ParensNode {
  class AndWrapper (line 388) | class AndWrapper<
    method constructor (line 395) | constructor(node: AndNode) {
    method expressionType (line 400) | get expressionType(): T | undefined {
    method as (line 435) | as(alias: string | Expression<any>): AliasedExpression<T, string> {
    method and (line 453) | and(...args: any[]): any {
    method $castTo (line 465) | $castTo<C extends SqlBool>(): AndWrapper<DB, TB, C> {
    method toOperationNode (line 469) | toOperationNode(): ParensNode {

FILE: src/expression/expression.ts
  type Expression (line 26) | interface Expression<T> extends OperationNodeSource {
  type AliasableExpression (line 81) | interface AliasableExpression<T> extends Expression<T> {
  type AliasedExpression (line 191) | interface AliasedExpression<
  function isExpression (line 211) | function isExpression(obj: unknown): obj is Expression<any> {
  function isAliasedExpression (line 215) | function isAliasedExpression(

FILE: src/helpers/mssql.ts
  function jsonArrayFrom (line 82) | function jsonArrayFrom<O>(
  function jsonObjectFrom (line 160) | function jsonObjectFrom<O>(
  function jsonBuildObject (line 226) | function jsonBuildObject<O extends Record<string, Expression<unknown>>>(

FILE: src/helpers/mysql.ts
  function jsonArrayFrom (line 61) | function jsonArrayFrom<O>(
  function jsonObjectFrom (line 119) | function jsonObjectFrom<O>(
  function jsonBuildObject (line 167) | function jsonBuildObject<O extends Record<string, Expression<unknown>>>(
  function getMysqlJsonObjectArgs (line 181) | function getMysqlJsonObjectArgs(

FILE: src/helpers/postgres.ts
  function jsonArrayFrom (line 59) | function jsonArrayFrom<O>(
  function jsonObjectFrom (line 116) | function jsonObjectFrom<O>(
  function jsonBuildObject (line 165) | function jsonBuildObject<O extends Record<string, Expression<unknown>>>(
  type MergeAction (line 179) | type MergeAction = 'INSERT' | 'UPDATE' | 'DELETE'
  function mergeAction (line 227) | function mergeAction(): RawBuilder<MergeAction> {

FILE: src/helpers/sqlite.ts
  function jsonArrayFrom (line 74) | function jsonArrayFrom<O>(
  function jsonObjectFrom (line 145) | function jsonObjectFrom<O>(
  function jsonBuildObject (line 209) | function jsonBuildObject<O extends Record<string, Expression<unknown>>>(
  function getSqliteJsonObjectArgs (line 223) | function getSqliteJsonObjectArgs(

FILE: src/kysely.ts
  type AsyncDisposable (line 54) | interface AsyncDisposable {}
  type SymbolConstructor (line 55) | interface SymbolConstructor {
  class Kysely (line 96) | class Kysely<DB>
    method constructor (line 104) | constructor(args: KyselyConfig | KyselyProps) {
    method schema (line 145) | get schema(): SchemaModule {
    method dynamic (line 155) | get dynamic(): DynamicModule<DB> {
    method introspection (line 162) | get introspection(): DatabaseIntrospector {
    method case (line 175) | case<V>(value?: Expression<V>): any {
    method fn (line 231) | get fn(): FunctionModule<DB, keyof DB> {
    method transaction (line 306) | transaction(): TransactionBuilder<DB> {
    method startTransaction (line 421) | startTransaction(): ControlledTransactionBuilder<DB> {
    method connection (line 445) | connection(): ConnectionBuilder<DB> {
    method withPlugin (line 452) | override withPlugin(plugin: KyselyPlugin): Kysely<DB> {
    method withoutPlugins (line 462) | override withoutPlugins(): Kysely<DB> {
    method withSchema (line 472) | override withSchema(schema: string): Kysely<DB> {
    method withTables (line 511) | withTables<T extends Record<string, Record<string, any>>>(): Kysely<
    method destroy (line 522) | async destroy(): Promise<void> {
    method isTransaction (line 531) | get isTransaction(): boolean {
    method getExecutor (line 539) | getExecutor(): QueryExecutor {
    method executeQuery (line 548) | executeQuery<R>(
  method [Symbol.asyncDispose] (line 564) | async [Symbol.asyncDispose]() {
  class Transaction (line 569) | class Transaction<DB> extends Kysely<DB> {
    method constructor (line 572) | constructor(props: KyselyProps) {
    method isTransaction (line 580) | override get isTransaction(): true {
    method transaction (line 584) | override transaction(): TransactionBuilder<DB> {
    method connection (line 590) | override connection(): ConnectionBuilder<DB> {
    method destroy (line 596) | override async destroy(): Promise<void> {
    method withPlugin (line 602) | override withPlugin(plugin: KyselyPlugin): Transaction<DB> {
    method withoutPlugins (line 609) | override withoutPlugins(): Transaction<DB> {
    method withSchema (line 616) | override withSchema(schema: string): Transaction<DB> {
    method withTables (line 625) | override withTables<
  type KyselyProps (line 632) | interface KyselyProps {
  function isKyselyProps (line 639) | function isKyselyProps(obj: unknown): obj is KyselyProps {
  type KyselyConfig (line 649) | interface KyselyConfig {
  class ConnectionBuilder (line 699) | class ConnectionBuilder<DB> {
    method constructor (line 702) | constructor(props: ConnectionBuilderProps) {
    method execute (line 706) | async execute<T>(callback: (db: Kysely<DB>) => Promise<T>): Promise<T> {
  type ConnectionBuilderProps (line 722) | interface ConnectionBuilderProps extends KyselyProps {}
  class TransactionBuilder (line 724) | class TransactionBuilder<DB> {
    method constructor (line 727) | constructor(props: TransactionBuilderProps) {
    method setAccessMode (line 731) | setAccessMode(accessMode: AccessMode): TransactionBuilder<DB> {
    method setIsolationLevel (line 738) | setIsolationLevel(isolationLevel: IsolationLevel): TransactionBuilder<...
    method execute (line 745) | async execute<T>(callback: (trx: Transaction<DB>) => Promise<T>): Prom...
  type TransactionBuilderProps (line 789) | interface TransactionBuilderProps extends KyselyProps {
  class ControlledTransactionBuilder (line 794) | class ControlledTransactionBuilder<DB> {
    method constructor (line 797) | constructor(props: TransactionBuilderProps) {
    method setAccessMode (line 801) | setAccessMode(accessMode: AccessMode): ControlledTransactionBuilder<DB> {
    method setIsolationLevel (line 808) | setIsolationLevel(
    method execute (line 817) | async execute(): Promise<ControlledTransaction<DB>> {
  class ControlledTransaction (line 837) | class ControlledTransaction<
    method constructor (line 845) | constructor(props: ControlledTransactionProps) {
    method isCommitted (line 864) | get isCommitted(): boolean {
    method isRolledBack (line 868) | get isRolledBack(): boolean {
    method commit (line 896) | commit(): Command<void> {
    method rollback (line 932) | rollback(): Command<void> {
    method savepoint (line 973) | savepoint<SN extends string>(
    method rollbackToSavepoint (line 1019) | rollbackToSavepoint<SN extends S[number]>(
    method releaseSavepoint (line 1072) | releaseSavepoint<SN extends S[number]>(
    method withPlugin (line 1090) | override withPlugin(plugin: KyselyPlugin): ControlledTransaction<DB, S> {
    method withoutPlugins (line 1097) | override withoutPlugins(): ControlledTransaction<DB, S> {
    method withSchema (line 1104) | override withSchema(schema: string): ControlledTransaction<DB, S> {
    method withTables (line 1113) | override withTables<
  type ControlledTransctionState (line 1120) | interface ControlledTransctionState {
  type ControlledTransactionProps (line 1125) | interface ControlledTransactionProps extends KyselyProps {
  class Command (line 1129) | class Command<T> {
    method constructor (line 1132) | constructor(cb: () => Promise<T>) {
    method execute (line 1139) | async execute(): Promise<T> {
  function assertNotCommittedOrRolledBack (line 1144) | function assertNotCommittedOrRolledBack(
  class NotCommittedOrRolledBackAssertingExecutor (line 1162) | class NotCommittedOrRolledBackAssertingExecutor implements QueryExecutor {
    method constructor (line 1166) | constructor(executor: QueryExecutor, state: ControlledTransctionState) {
    method adapter (line 1176) | get adapter() {
    method plugins (line 1180) | get plugins() {
    method transformQuery (line 1184) | transformQuery<T extends RootOperationNode>(node: T, queryId: QueryId)...
    method compileQuery (line 1188) | compileQuery<R = unknown>(
    method provideConnection (line 1195) | provideConnection<T>(
    method executeQuery (line 1201) | executeQuery<R>(compiledQuery: CompiledQuery<R>): Promise<QueryResult<...
    method stream (line 1206) | stream<R>(
    method withConnectionProvider (line 1214) | withConnectionProvider(
    method withPlugin (line 1223) | withPlugin(plugin: KyselyPlugin): QueryExecutor {
    method withPlugins (line 1230) | withPlugins(plugins: ReadonlyArray<KyselyPlugin>): QueryExecutor {
    method withPluginAtFront (line 1237) | withPluginAtFront(plugin: KyselyPlugin): QueryExecutor {
    method withoutPlugins (line 1244) | withoutPlugins(): QueryExecutor {

FILE: src/migration/file-migration-provider.ts
  class FileMigrationProvider (line 20) | class FileMigrationProvider implements MigrationProvider {
    method constructor (line 23) | constructor(props: FileMigrationProviderProps) {
    method getMigrations (line 27) | async getMigrations(): Promise<Record<string, Migration>> {
  function isMigration (line 59) | function isMigration(obj: unknown): obj is Migration {
  type FileMigrationProviderFS (line 63) | interface FileMigrationProviderFS {
  type FileMigrationProviderPath (line 67) | interface FileMigrationProviderPath {
  type FileMigrationProviderProps (line 71) | interface FileMigrationProviderProps {

FILE: src/migration/migrator.ts
  constant DEFAULT_MIGRATION_TABLE (line 10) | const DEFAULT_MIGRATION_TABLE = 'kysely_migration'
  constant DEFAULT_MIGRATION_LOCK_TABLE (line 11) | const DEFAULT_MIGRATION_LOCK_TABLE = 'kysely_migration_lock'
  constant DEFAULT_ALLOW_UNORDERED_MIGRATIONS (line 12) | const DEFAULT_ALLOW_UNORDERED_MIGRATIONS = false
  constant MIGRATION_LOCK_ID (line 13) | const MIGRATION_LOCK_ID = 'migration_lock'
  constant NO_MIGRATIONS (line 14) | const NO_MIGRATIONS: NoMigrations = freeze({ __noMigrations__: true })
  type Migration (line 16) | interface Migration {
  class Migrator (line 66) | class Migrator {
    method constructor (line 69) | constructor(props: MigratorProps) {
    method getMigrations (line 78) | async getMigrations(): Promise<ReadonlyArray<MigrationInfo>> {
    method migrateToLatest (line 149) | async migrateToLatest(): Promise<MigrationResultSet> {
    method migrateTo (line 204) | async migrateTo(
    method migrateUp (line 277) | async migrateUp(): Promise<MigrationResultSet> {
    method migrateDown (line 309) | async migrateDown(): Promise<MigrationResultSet> {
    method #migrate (line 313) | async #migrate(
    method #migrationTableSchema (line 335) | get #migrationTableSchema(): string | undefined {
    method #migrationTable (line 339) | get #migrationTable(): string {
    method #migrationLockTable (line 343) | get #migrationLockTable(): string {
    method #allowUnorderedMigrations (line 347) | get #allowUnorderedMigrations(): boolean {
    method #schemaPlugin (line 353) | get #schemaPlugin(): KyselyPlugin {
    method #ensureMigrationTableSchemaExists (line 361) | async #ensureMigrationTableSchemaExists(): Promise<void> {
    method #ensureMigrationTableExists (line 389) | async #ensureMigrationTableExists(): Promise<void> {
    method #ensureMigrationLockTableExists (line 420) | async #ensureMigrationLockTableExists(): Promise<void> {
    method #ensureLockRowExists (line 449) | async #ensureLockRowExists(): Promise<void> {
    method #doesSchemaExist (line 471) | async #doesSchemaExist(): Promise<boolean> {
    method #doesTableExist (line 477) | async #doesTableExist(tableName: string): Promise<boolean> {
    method #doesLockRowExists (line 489) | async #doesLockRowExists(): Promise<boolean> {
    method #runMigrations (line 500) | async #runMigrations(
    method #getState (line 549) | async #getState(db: Kysely<any>): Promise<MigrationState> {
    method #getPendingMigrations (line 571) | #getPendingMigrations(
    method #resolveMigrations (line 580) | async #resolveMigrations(): Promise<ReadonlyArray<NamedMigration>> {
    method #getExecutedMigrations (line 591) | async #getExecutedMigrations(
    method #ensureNoMissingMigrations (line 620) | #ensureNoMissingMigrations(
    method #ensureMigrationsInOrder (line 634) | #ensureMigrationsInOrder(
    method #migrateDown (line 648) | async #migrateDown(
    method #migrateUp (line 705) | async #migrateUp(
    method #createIfNotExists (line 757) | async #createIfNotExists(
  type MigratorProps (line 768) | interface MigratorProps {
  type MigrationResultSet (line 857) | interface MigrationResultSet {
  type MigrationDirection (line 887) | type MigrationDirection = 'Up' | 'Down'
  type MigrationResult (line 889) | interface MigrationResult {
  type MigrationProvider (line 914) | interface MigrationProvider {
  type NoMigrations (line 936) | interface NoMigrations {
  type MigrationInfo (line 940) | interface MigrationInfo {
  type NamedMigration (line 959) | interface NamedMigration extends Migration {
  type MigrationState (line 963) | interface MigrationState {
  class MigrationResultSetError (line 977) | class MigrationResultSetError extends Error {
    method constructor (line 980) | constructor(result: MigrationResultSet) {
    method resultSet (line 985) | get resultSet(): MigrationResultSet {

FILE: src/operation-node/add-column-node.ts
  type AddColumnNode (line 5) | interface AddColumnNode extends OperationNode {
  type AddColumnNodeFactory (line 10) | type AddColumnNodeFactory = Readonly<{
  method is (line 20) | is(node): node is AddColumnNode {
  method create (line 24) | create(column) {

FILE: src/operation-node/add-constraint-node.ts
  type AddConstraintNode (line 5) | interface AddConstraintNode extends OperationNode {
  type AddConstraintNodeFactory (line 10) | type AddConstraintNodeFactory = Readonly<{
  method is (line 20) | is(node): node is AddConstraintNode {
  method create (line 24) | create(constraint) {

FILE: src/operation-node/add-index-node.ts
  type AddIndexNodeProps (line 6) | type AddIndexNodeProps = Omit<AddIndexNode, 'kind' | 'name'>
  type AddIndexNode (line 8) | interface AddIndexNode extends OperationNode {
  type AddIndexNodeFactory (line 17) | type AddIndexNodeFactory = Readonly<{
  method is (line 34) | is(node): node is AddIndexNode {
  method create (line 38) | create(name) {
  method cloneWith (line 45) | cloneWith(node, props) {
  method cloneWithColumns (line 52) | cloneWithColumns(node, columns) {

FILE: src/operation-node/aggregate-function-node.ts
  type AggregateFunctionNode (line 8) | interface AggregateFunctionNode extends OperationNode {
  type AggregateFunctionNodeFactory (line 19) | type AggregateFunctionNodeFactory = Readonly<{
  method is (line 52) | is(node): node is AggregateFunctionNode {
  method create (line 56) | create(aggregateFunction, aggregated = []) {
  method cloneWithDistinct (line 64) | cloneWithDistinct(aggregateFunctionNode) {
  method cloneWithOrderBy (line 71) | cloneWithOrderBy(aggregateFunctionNode, orderItems, withinGroup = false) {
  method cloneWithFilter (line 82) | cloneWithFilter(aggregateFunctionNode, filter) {
  method cloneWithOrFilter (line 95) | cloneWithOrFilter(aggregateFunctionNode, filter) {
  method cloneWithOver (line 108) | cloneWithOver(aggregateFunctionNode, over?) {

FILE: src/operation-node/alias-node.ts
  type AliasNode (line 4) | interface AliasNode extends OperationNode {
  type AliasNodeFactory (line 10) | type AliasNodeFactory = Readonly<{
  method is (line 19) | is(node): node is AliasNode {
  method create (line 23) | create(node, alias) {

FILE: src/operation-node/alter-column-node.ts
  type AlterColumnNodeProps (line 6) | type AlterColumnNodeProps = Omit<AlterColumnNode, 'kind' | 'column'>
  type AlterColumnNode (line 8) | interface AlterColumnNode extends OperationNode {
  type AlterColumnNodeFactory (line 19) | type AlterColumnNodeFactory = Readonly<{
  method is (line 33) | is(node): node is AlterColumnNode {
  method create (line 37) | create(column, prop, value) {

FILE: src/operation-node/alter-table-node.ts
  type AlterTableNodeTableProps (line 16) | type AlterTableNodeTableProps = Pick<
  type AlterTableColumnAlterationNode (line 27) | type AlterTableColumnAlterationNode =
  type AlterTableNode (line 34) | interface AlterTableNode extends OperationNode {
  type AlterTableNodeFactory (line 47) | type AlterTableNodeFactory = Readonly<{
  method is (line 65) | is(node): node is AlterTableNode {
  method create (line 69) | create(table) {
  method cloneWithTableProps (line 76) | cloneWithTableProps(node, props) {
  method cloneWithColumnAlteration (line 83) | cloneWithColumnAlteration(node, columnAlteration) {

FILE: src/operation-node/and-node.ts
  type AndNode (line 4) | interface AndNode extends OperationNode {
  type AndNodeFactory (line 10) | type AndNodeFactory = Readonly<{
  method is (line 19) | is(node): node is AndNode {
  method create (line 23) | create(left, right) {

FILE: src/operation-node/binary-operation-node.ts
  type BinaryOperationNode (line 4) | interface BinaryOperationNode extends OperationNode {
  type BinaryOperationNodeFactory (line 11) | type BinaryOperationNodeFactory = Readonly<{
  method is (line 25) | is(node): node is BinaryOperationNode {
  method create (line 29) | create(leftOperand, operator, rightOperand) {

FILE: src/operation-node/case-node.ts
  type CaseNode (line 5) | interface CaseNode extends OperationNode {
  type CaseNodeFactory (line 13) | type CaseNodeFactory = Readonly<{
  method is (line 28) | is(node): node is CaseNode {
  method create (line 32) | create(value?) {
  method cloneWithWhen (line 39) | cloneWithWhen(caseNode, when) {
  method cloneWithThen (line 46) | cloneWithThen(caseNode, then) {
  method cloneWith (line 61) | cloneWith(caseNode, props) {

FILE: src/operation-node/cast-node.ts
  type CastNode (line 4) | interface CastNode extends OperationNode {
  type CastNodeFactory (line 10) | type CastNodeFactory = Readonly<{
  method is (line 19) | is(node): node is CastNode {
  method create (line 23) | create(expression, dataType) {

FILE: src/operation-node/check-constraint-node.ts
  type CheckConstraintNode (line 5) | interface CheckConstraintNode extends OperationNode {
  type CheckConstraintNodeFactory (line 11) | type CheckConstraintNodeFactory = Readonly<{
  method is (line 24) | is(node): node is CheckConstraintNode {
  method create (line 28) | create(expression, constraintName?) {

FILE: src/operation-node/collate-node.ts
  type CollateNode (line 5) | interface CollateNode extends OperationNode {
  type CollateNodeFactory (line 10) | type CollateNodeFactory = Readonly<{
  method is (line 19) | is(node): node is CollateNode {
  method create (line 23) | create(collation) {

FILE: src/operation-node/column-definition-node.ts
  type ColumnDefinitionNodeProps (line 9) | type ColumnDefinitionNodeProps = Omit<
  type ColumnDefinitionNode (line 14) | interface ColumnDefinitionNode extends OperationNode {
  type ColumnDefinitionNodeFactory (line 34) | type ColumnDefinitionNodeFactory = Readonly<{
  method is (line 59) | is(node): node is ColumnDefinitionNode {
  method create (line 63) | create(column, dataType) {
  method cloneWithFrontModifier (line 71) | cloneWithFrontModifier(node, modifier) {
  method cloneWithEndModifier (line 80) | cloneWithEndModifier(node, modifier) {
  method cloneWith (line 89) | cloneWith(node, props) {

FILE: src/operation-node/column-node.ts
  type ColumnNode (line 5) | interface ColumnNode extends OperationNode {
  type ColumnNodeFactory (line 10) | type ColumnNodeFactory = Readonly<{
  method is (line 19) | is(node): node is ColumnNode {
  method create (line 23) | create(column) {

FILE: src/operation-node/column-update-node.ts
  type ColumnUpdateNode (line 4) | interface ColumnUpdateNode extends OperationNode {
  type ColumnUpdateNodeFactory (line 10) | type ColumnUpdateNodeFactory = Readonly<{
  method is (line 23) | is(node): node is ColumnUpdateNode {
  method create (line 27) | create(column, value) {

FILE: src/operation-node/common-table-expression-name-node.ts
  type CommonTableExpressionNameNode (line 6) | interface CommonTableExpressionNameNode extends OperationNode {
  type CommonTableExpressionNameNodeFactory (line 12) | type CommonTableExpressionNameNodeFactory = Readonly<{
  method is (line 25) | is(node): node is CommonTableExpressionNameNode {
  method create (line 29) | create(tableName, columnNames?) {

FILE: src/operation-node/common-table-expression-node.ts
  type CommonTableExpressionNodeProps (line 5) | type CommonTableExpressionNodeProps = Pick<
  type CommonTableExpressionNode (line 10) | interface CommonTableExpressionNode extends OperationNode {
  type CommonTableExpressionNodeFactory (line 17) | type CommonTableExpressionNodeFactory = Readonly<{
  method is (line 34) | is(node): node is CommonTableExpressionNode {
  method create (line 38) | create(name, expression) {
  method cloneWith (line 46) | cloneWith(node, props) {

FILE: src/operation-node/constraint-node.ts
  type ConstraintNode (line 6) | type ConstraintNode =

FILE: src/operation-node/create-index-node.ts
  type CreateIndexNodeProps (line 8) | type CreateIndexNodeProps = Omit<CreateIndexNode, 'kind' | 'name'>
  type IndexType (line 9) | type IndexType = 'btree' | 'hash' | 'gist' | 'gin'
  type CreateIndexNode (line 11) | interface CreateIndexNode extends OperationNode {
  type CreateIndexNodeFactory (line 28) | type CreateIndexNodeFactory = Readonly<{
  method is (line 46) | is(node): node is CreateIndexNode {
  method create (line 50) | create(name) {
  method cloneWith (line 57) | cloneWith(node, props) {
  method cloneWithColumns (line 64) | cloneWithColumns(node, columns) {

FILE: src/operation-node/create-schema-node.ts
  type CreateSchemaNodeParams (line 5) | type CreateSchemaNodeParams = Omit<
  type CreateSchemaNode (line 10) | interface CreateSchemaNode extends OperationNode {
  type CreateSchemaNodeFactory (line 16) | type CreateSchemaNodeFactory = Readonly<{
  method is (line 33) | is(node): node is CreateSchemaNode {
  method create (line 37) | create(schema, params?) {
  method cloneWith (line 45) | cloneWith(createSchema, params) {

FILE: src/operation-node/create-table-node.ts
  constant ON_COMMIT_ACTIONS (line 8) | const ON_COMMIT_ACTIONS = ['preserve rows', 'delete rows', 'drop']
  type OnCommitAction (line 9) | type OnCommitAction = ArrayItemType<typeof ON_COMMIT_ACTIONS>
  type CreateTableNodeParams (line 11) | type CreateTableNodeParams = Omit<
  type CreateTableNode (line 21) | interface CreateTableNode extends OperationNode {
  type CreateTableNodeFactory (line 34) | type CreateTableNodeFactory = Readonly<{
  method is (line 64) | is(node): node is CreateTableNode {
  method create (line 68) | create(table) {
  method cloneWithColumn (line 76) | cloneWithColumn(createTable, column) {
  method cloneWithConstraint (line 83) | cloneWithConstraint(createTable, constraint) {
  method cloneWithFrontModifier (line 92) | cloneWithFrontModifier(createTable, modifier) {
  method cloneWithEndModifier (line 101) | cloneWithEndModifier(createTable, modifier) {
  method cloneWith (line 110) | cloneWith(createTable, params) {

FILE: src/operation-node/create-type-node.ts
  type CreateTypeNodeParams (line 7) | type CreateTypeNodeParams = Omit<Partial<CreateTypeNode>, 'kind'>
  type CreateTypeNode (line 9) | interface CreateTypeNode extends OperationNode {
  type CreateTypeNodeFactory (line 15) | type CreateTypeNodeFactory = Readonly<{
  method is (line 29) | is(node): node is CreateTypeNode {
  method create (line 33) | create(name) {
  method cloneWithEnum (line 40) | cloneWithEnum(createType, values) {

FILE: src/operation-node/create-view-node.ts
  type CreateViewNodeParams (line 8) | type CreateViewNodeParams = Omit<
  type CreateViewNode (line 13) | interface CreateViewNode extends OperationNode {
  type CreateViewNodeFactory (line 24) | type CreateViewNodeFactory = Readonly<{
  method is (line 38) | is(node): node is CreateViewNode {
  method create (line 42) | create(name) {
  method cloneWith (line 49) | cloneWith(createView, params) {

FILE: src/operation-node/data-type-node.ts
  constant SIMPLE_COLUMN_DATA_TYPES (line 4) | const SIMPLE_COLUMN_DATA_TYPES = [
  constant COLUMN_DATA_TYPE_REGEX (line 50) | const COLUMN_DATA_TYPE_REGEX = [
  type SimpleColumnDataType (line 64) | type SimpleColumnDataType = (typeof SIMPLE_COLUMN_DATA_TYPES)[number]
  type ColumnDataType (line 66) | type ColumnDataType =
  type DataTypeParams (line 80) | type DataTypeParams = Omit<DataTypeNode, 'kind' | 'dataType'>
  type DataTypeNode (line 82) | interface DataTypeNode extends OperationNode {
  type DataTypeNodeFactory (line 87) | type DataTypeNodeFactory = Readonly<{
  method is (line 96) | is(node): node is DataTypeNode {
  method create (line 100) | create(dataType) {
  function isColumnDataType (line 108) | function isColumnDataType(dataType: string): dataType is ColumnDataType {

FILE: src/operation-node/default-insert-value-node.ts
  type DefaultInsertValueNode (line 4) | interface DefaultInsertValueNode extends OperationNode {
  type DefaultInsertValueNodeFactory (line 8) | type DefaultInsertValueNodeFactory = Readonly<{
  method is (line 18) | is(node): node is DefaultInsertValueNode {
  method create (line 22) | create() {

FILE: src/operation-node/default-value-node.ts
  type DefaultValueNode (line 4) | interface DefaultValueNode extends OperationNode {
  type DefaultValueNodeFactory (line 9) | type DefaultValueNodeFactory = Readonly<{
  method is (line 19) | is(node): node is DefaultValueNode {
  method create (line 23) | create(defaultValue) {

FILE: src/operation-node/delete-query-node.ts
  type DeleteQueryNode (line 17) | interface DeleteQueryNode extends OperationNode {
  type DeleteQueryNodeFactory (line 33) | type DeleteQueryNodeFactory = Readonly<{
  method is (line 60) | is(node): node is DeleteQueryNode {
  method create (line 64) | create(fromItems, withNode?) {
  method cloneWithLimit (line 85) | cloneWithLimit(deleteNode, limit) {
  method cloneWithoutLimit (line 92) | cloneWithoutLimit(deleteNode) {
  method cloneWithUsing (line 99) | cloneWithUsing(deleteNode, tables) {

FILE: src/operation-node/drop-column-node.ts
  type DropColumnNode (line 5) | interface DropColumnNode extends OperationNode {
  type DropColumnNodeFactory (line 10) | type DropColumnNodeFactory = Readonly<{
  method is (line 20) | is(node): node is DropColumnNode {
  method create (line 24) | create(column) {

FILE: src/operation-node/drop-constraint-node.ts
  type DropConstraintNodeProps (line 5) | type DropConstraintNodeProps = Omit<
  type DropConstraintNode (line 10) | interface DropConstraintNode extends OperationNode {
  type DropConstraintNodeFactory (line 17) | type DropConstraintNodeFactory = Readonly<{
  method is (line 34) | is(node): node is DropConstraintNode {
  method create (line 38) | create(constraintName) {
  method cloneWith (line 45) | cloneWith(dropConstraint, props) {

FILE: src/operation-node/drop-index-node.ts
  type DropIndexNodeProps (line 6) | type DropIndexNodeProps = Omit<DropIndexNode, 'kind' | 'name'>
  type DropIndexNode (line 8) | interface DropIndexNode extends OperationNode {
  type DropIndexNodeFactory (line 16) | type DropIndexNodeFactory = Readonly<{
  method is (line 30) | is(node): node is DropIndexNode {
  method create (line 34) | create(name, params?) {
  method cloneWith (line 42) | cloneWith(dropIndex, props) {

FILE: src/operation-node/drop-schema-node.ts
  type DropSchemaNodeParams (line 5) | type DropSchemaNodeParams = Omit<
  type DropSchemaNode (line 10) | interface DropSchemaNode extends OperationNode {
  type DropSchemaNodeFactory (line 17) | type DropSchemaNodeFactory = Readonly<{
  method is (line 34) | is(node): node is DropSchemaNode {
  method create (line 38) | create(schema, params?) {
  method cloneWith (line 46) | cloneWith(dropSchema, params) {

FILE: src/operation-node/drop-table-node.ts
  type DropTablexNodeParams (line 5) | type DropTablexNodeParams = Omit<
  type DropTableNode (line 9) | interface DropTableNode extends OperationNode {
  type DropTableNodeFactory (line 16) | type DropTableNodeFactory = Readonly<{
  method is (line 33) | is(node): node is DropTableNode {
  method create (line 37) | create(table, params?) {
  method cloneWith (line 45) | cloneWith(dropIndex, params) {

FILE: src/operation-node/drop-type-node.ts
  type DropTypeNodeParams (line 5) | type DropTypeNodeParams = Omit<Partial<DropTypeNode>, 'kind' | 'name'>
  type DropTypeNode (line 7) | interface DropTypeNode extends OperationNode {
  type DropTypeNodeFactory (line 13) | type DropTypeNodeFactory = Readonly<{
  method is (line 26) | is(node): node is DropTypeNode {
  method create (line 30) | create(name) {
  method cloneWith (line 37) | cloneWith(dropType, params) {

FILE: src/operation-node/drop-view-node.ts
  type DropViewNodeParams (line 5) | type DropViewNodeParams = Omit<Partial<DropViewNode>, 'kind' | 'name'>
  type DropViewNode (line 7) | interface DropViewNode extends OperationNode {
  type DropViewNodeFactory (line 15) | type DropViewNodeFactory = Readonly<{
  method is (line 28) | is(node): node is DropViewNode {
  method create (line 32) | create(name) {
  method cloneWith (line 39) | cloneWith(dropView, params) {

FILE: src/operation-node/explain-node.ts
  type ExplainNode (line 5) | interface ExplainNode extends OperationNode {
  type ExplainNodeFactory (line 11) | type ExplainNodeFactory = Readonly<{
  method is (line 20) | is(node): node is ExplainNode {
  method create (line 24) | create(format?, options?) {

FILE: src/operation-node/fetch-node.ts
  type FetchModifier (line 5) | type FetchModifier = 'only' | 'with ties'
  type FetchNode (line 7) | interface FetchNode extends OperationNode {
  type FetchNodeFactory (line 13) | type FetchNodeFactory = Readonly<{
  method is (line 25) | is(node): node is FetchNode {
  method create (line 29) | create(rowCount, modifier) {

FILE: src/operation-node/foreign-key-constraint-node.ts
  type ForeignKeyConstraintNodeProps (line 11) | type ForeignKeyConstraintNodeProps = Omit<
  type ForeignKeyConstraintNode (line 16) | interface ForeignKeyConstraintNode extends OperationNode {
  type ForeignKeyConstraintNodeFactory (line 27) | type ForeignKeyConstraintNodeFactory = Readonly<{
  method is (line 46) | is(node): node is ForeignKeyConstraintNode {
  method create (line 50) | create(sourceColumns, targetTable, targetColumns, constraintName?) {
  method cloneWith (line 61) | cloneWith(node, props) {

FILE: src/operation-node/from-node.ts
  type FromNode (line 4) | interface FromNode extends OperationNode {
  type FromNodeFactory (line 9) | type FromNodeFactory = Readonly<{
  method is (line 22) | is(node): node is FromNode {
  method create (line 26) | create(froms) {
  method cloneWithFroms (line 33) | cloneWithFroms(from, froms) {

FILE: src/operation-node/function-node.ts
  type FunctionNode (line 4) | interface FunctionNode extends OperationNode {
  type FunctionNodeFactory (line 10) | type FunctionNodeFactory = Readonly<{
  method is (line 22) | is(node): node is FunctionNode {
  method create (line 26) | create(func, args) {

FILE: src/operation-node/generated-node.ts
  type GeneratedNodeParams (line 4) | type GeneratedNodeParams = Omit<GeneratedNode, 'kind' | 'expression'>
  type GeneratedNode (line 6) | interface GeneratedNode extends OperationNode {
  type GeneratedNodeFactory (line 15) | type GeneratedNodeFactory = Readonly<{
  method is (line 30) | is(node): node is GeneratedNode {
  method create (line 34) | create(params) {
  method createWithExpression (line 41) | createWithExpression(expression) {
  method cloneWith (line 49) | cloneWith(node, params) {

FILE: src/operation-node/group-by-item-node.ts
  type GroupByItemNode (line 4) | interface GroupByItemNode extends OperationNode {
  type GroupByItemNodeFactory (line 9) | type GroupByItemNodeFactory = Readonly<{
  method is (line 19) | is(node): node is GroupByItemNode {
  method create (line 23) | create(groupBy) {

FILE: src/operation-node/group-by-node.ts
  type GroupByNode (line 5) | interface GroupByNode extends OperationNode {
  type GroupByNodeFactory (line 10) | type GroupByNodeFactory = Readonly<{
  method is (line 23) | is(node): node is GroupByNode {
  method create (line 27) | create(items) {
  method cloneWithItems (line 34) | cloneWithItems(groupBy, items) {

FILE: src/operation-node/having-node.ts
  type HavingNode (line 6) | interface HavingNode extends OperationNode {
  type HavingNodeFactory (line 11) | type HavingNodeFactory = Readonly<{
  method is (line 25) | is(node): node is HavingNode {
  method create (line 29) | create(filter) {
  method cloneWithOperation (line 36) | cloneWithOperation(havingNode, operator, operation) {

FILE: src/operation-node/identifier-node.ts
  type IdentifierNode (line 4) | interface IdentifierNode extends OperationNode {
  type IdentifierNodeFactory (line 9) | type IdentifierNodeFactory = Readonly<{
  method is (line 19) | is(node): node is IdentifierNode {
  method create (line 23) | create(name) {

FILE: src/operation-node/insert-query-node.ts
  type InsertQueryNodeProps (line 14) | type InsertQueryNodeProps = Omit<InsertQueryNode, 'kind' | 'into'>
  type InsertQueryNode (line 16) | interface InsertQueryNode extends OperationNode {
  type InsertQueryNodeFactory (line 37) | type InsertQueryNodeFactory = Readonly<{
  method is (line 56) | is(node): node is InsertQueryNode {
  method create (line 60) | create(into, withNode?, replace?) {
  method createWithoutInto (line 69) | createWithoutInto() {
  method cloneWith (line 75) | cloneWith(insertQuery, props) {

FILE: src/operation-node/join-node.ts
  type JoinType (line 5) | type JoinType =
  type JoinNode (line 18) | interface JoinNode extends OperationNode {
  type JoinNodeFactory (line 25) | type JoinNodeFactory = Readonly<{
  method is (line 40) | is(node): node is JoinNode {
  method create (line 44) | create(joinType, table) {
  method createWithOn (line 53) | createWithOn(joinType, table, on) {
  method cloneWithOn (line 62) | cloneWithOn(joinNode, operation) {

FILE: src/operation-node/json-operator-chain-node.ts
  type JSONOperatorChainNode (line 6) | interface JSONOperatorChainNode extends OperationNode {
  type JSONOperatorChainNodeFactory (line 12) | type JSONOperatorChainNodeFactory = Readonly<{
  method is (line 26) | is(node): node is JSONOperatorChainNode {
  method create (line 30) | create(operator) {
  method cloneWithValue (line 38) | cloneWithValue(node, value) {

FILE: src/operation-node/json-path-leg-node.ts
  type JSONPathLegType (line 4) | type JSONPathLegType = 'Member' | 'ArrayLocation'
  type JSONPathLegNode (line 6) | interface JSONPathLegNode extends OperationNode {
  type JSONPathLegNodeFactory (line 12) | type JSONPathLegNodeFactory = Readonly<{
  method is (line 25) | is(node): node is JSONPathLegNode {
  method create (line 29) | create(type, value) {

FILE: src/operation-node/json-path-node.ts
  type JSONPathNode (line 6) | interface JSONPathNode extends OperationNode {
  type JSONPathNodeFactory (line 12) | type JSONPathNodeFactory = Readonly<{
  method is (line 25) | is(node): node is JSONPathNode {
  method create (line 29) | create(inOperator?) {
  method cloneWithLeg (line 37) | cloneWithLeg(jsonPathNode, pathLeg) {

FILE: src/operation-node/json-reference-node.ts
  type JSONReferenceNode (line 7) | interface JSONReferenceNode extends OperationNode {
  type JSONReferenceNodeFactory (line 13) | type JSONReferenceNodeFactory = Readonly<{
  method is (line 30) | is(node): node is JSONReferenceNode {
  method create (line 34) | create(reference, traversal) {
  method cloneWithTraversal (line 42) | cloneWithTraversal(node, traversal) {

FILE: src/operation-node/limit-node.ts
  type LimitNode (line 4) | interface LimitNode extends OperationNode {
  type LimitNodeFactory (line 9) | type LimitNodeFactory = Readonly<{
  method is (line 18) | is(node): node is LimitNode {
  method create (line 22) | create(limit) {

FILE: src/operation-node/list-node.ts
  type ListNode (line 4) | interface ListNode extends OperationNode {
  type ListNodeFactory (line 9) | type ListNodeFactory = Readonly<{
  method is (line 18) | is(node): node is ListNode {
  method create (line 22) | create(items) {

FILE: src/operation-node/matched-node.ts
  type MatchedNode (line 4) | interface MatchedNode extends OperationNode {
  type MatchedNodeFactory (line 10) | type MatchedNodeFactory = Readonly<{
  method is (line 19) | is(node): node is MatchedNode {
  method create (line 23) | create(not, bySource = false) {

FILE: src/operation-node/merge-query-node.ts
  type MergeQueryNode (line 12) | interface MergeQueryNode extends OperationNode {
  type MergeQueryNodeFactory (line 24) | type MergeQueryNodeFactory = Readonly<{
  method is (line 49) | is(node): node is MergeQueryNode {
  method create (line 53) | create(into, withNode?) {
  method cloneWithUsing (line 61) | cloneWithUsing(mergeNode, using) {
  method cloneWithWhen (line 68) | cloneWithWhen(mergeNode, when) {
  method cloneWithThen (line 77) | cloneWithThen(mergeNode, then) {

FILE: src/operation-node/modify-column-node.ts
  type ModifyColumnNode (line 5) | interface ModifyColumnNode extends OperationNode {
  type ModifyColumnNodeFactory (line 10) | type ModifyColumnNodeFactory = Readonly<{
  method is (line 20) | is(node): node is ModifyColumnNode {
  method create (line 24) | create(column) {

FILE: src/operation-node/offset-node.ts
  type OffsetNode (line 4) | interface OffsetNode extends OperationNode {
  type OffsetNodeFactory (line 9) | type OffsetNodeFactory = Readonly<{
  method is (line 18) | is(node): node is OffsetNode {
  method create (line 22) | create(offset) {

FILE: src/operation-node/on-conflict-node.ts
  type OnConflictNodeProps (line 8) | type OnConflictNodeProps = Omit<
  type OnConflictNode (line 13) | interface OnConflictNode extends OperationNode {
  type OnConflictNodeFactory (line 24) | type OnConflictNodeFactory = Readonly<{
  method is (line 55) | is(node): node is OnConflictNode {
  method create (line 59) | create() {
  method cloneWith (line 65) | cloneWith(node, props) {
  method cloneWithIndexWhere (line 72) | cloneWithIndexWhere(node, operation) {
  method cloneWithIndexOrWhere (line 81) | cloneWithIndexOrWhere(node, operation) {
  method cloneWithUpdateWhere (line 90) | cloneWithUpdateWhere(node, operation) {
  method cloneWithUpdateOrWhere (line 99) | cloneWithUpdateOrWhere(node, operation) {
  method cloneWithoutIndexWhere (line 108) | cloneWithoutIndexWhere(node) {
  method cloneWithoutUpdateWhere (line 115) | cloneWithoutUpdateWhere(node) {

FILE: src/operation-node/on-duplicate-key-node.ts
  type OnDuplicateKeyNodeProps (line 5) | type OnDuplicateKeyNodeProps = Omit<OnDuplicateKeyNode, 'kind'>
  type OnDuplicateKeyNode (line 7) | interface OnDuplicateKeyNode extends OperationNode {
  type OnDuplicateKeyNodeFactory (line 12) | type OnDuplicateKeyNodeFactory = Readonly<{
  method is (line 22) | is(node): node is OnDuplicateKeyNode {
  method create (line 26) | create(updates) {

FILE: src/operation-node/on-node.ts
  type OnNode (line 6) | interface OnNode extends OperationNode {
  type OnNodeFactory (line 11) | type OnNodeFactory = Readonly<{
  method is (line 25) | is(node): node is OnNode {
  method create (line 29) | create(filter) {
  method cloneWithOperation (line 36) | cloneWithOperation(onNode, operator, operation) {

FILE: src/operation-node/operation-node-source.ts
  type OperationNodeSource (line 4) | interface OperationNodeSource {
  function isOperationNodeSource (line 8) | function isOperationNodeSource(

FILE: src/operation-node/operation-node-transformer.ts
  class OperationNodeTransformer (line 138) | class OperationNodeTransformer {
    method transformNode (line 247) | transformNode<T extends OperationNode | undefined>(
    method transformNodeImpl (line 262) | protected transformNodeImpl<T extends OperationNode>(
    method transformNodeList (line 269) | protected transformNodeList<
    method transformSelectQuery (line 279) | protected transformSelectQuery(
    method transformSelection (line 305) | protected transformSelection(
    method transformColumn (line 315) | protected transformColumn(node: ColumnNode, queryId?: QueryId): Column...
    method transformAlias (line 322) | protected transformAlias(node: AliasNode, queryId?: QueryId): AliasNode {
    method transformTable (line 330) | protected transformTable(node: TableNode, queryId?: QueryId): TableNode {
    method transformFrom (line 337) | protected transformFrom(node: FromNode, queryId?: QueryId): FromNode {
    method transformReference (line 344) | protected transformReference(
    method transformAnd (line 355) | protected transformAnd(node: AndNode, queryId?: QueryId): AndNode {
    method transformOr (line 363) | protected transformOr(node: OrNode, queryId?: QueryId): OrNode {
    method transformValueList (line 371) | protected transformValueList(
    method transformParens (line 381) | protected transformParens(node: ParensNode, queryId?: QueryId): Parens...
    method transformJoin (line 388) | protected transformJoin(node: JoinNode, queryId?: QueryId): JoinNode {
    method transformRaw (line 397) | protected transformRaw(node: RawNode, queryId?: QueryId): RawNode {
    method transformWhere (line 405) | protected transformWhere(node: WhereNode, queryId?: QueryId): WhereNode {
    method transformInsertQuery (line 412) | protected transformInsertQuery(
    method transformValues (line 436) | protected transformValues(node: ValuesNode, queryId?: QueryId): Values...
    method transformDeleteQuery (line 443) | protected transformDeleteQuery(
    method transformReturning (line 464) | protected transformReturning(
    method transformCreateTable (line 474) | protected transformCreateTable(
    method transformColumnDefinition (line 492) | protected transformColumnDefinition(
    method transformAddColumn (line 517) | protected transformAddColumn(
    method transformDropTable (line 527) | protected transformDropTable(
    method transformOrderBy (line 539) | protected transformOrderBy(
    method transformOrderByItem (line 549) | protected transformOrderByItem(
    method transformGroupBy (line 562) | protected transformGroupBy(
    method transformGroupByItem (line 572) | protected transformGroupByItem(
    method transformUpdateQuery (line 582) | protected transformUpdateQuery(
    method transformColumnUpdate (line 604) | protected transformColumnUpdate(
    method transformLimit (line 615) | protected transformLimit(node: LimitNode, queryId?: QueryId): LimitNode {
    method transformOffset (line 622) | protected transformOffset(node: OffsetNode, queryId?: QueryId): Offset...
    method transformOnConflict (line 629) | protected transformOnConflict(
    method transformOnDuplicateKey (line 645) | protected transformOnDuplicateKey(
    method transformCreateIndex (line 655) | protected transformCreateIndex(
    method transformList (line 672) | protected transformList(node: ListNode, queryId?: QueryId): ListNode {
    method transformDropIndex (line 679) | protected transformDropIndex(
    method transformPrimaryKeyConstraint (line 692) | protected transformPrimaryKeyConstraint(
    method transformUniqueConstraint (line 705) | protected transformUniqueConstraint(
    method transformForeignKeyConstraint (line 719) | protected transformForeignKeyConstraint(
    method transformSetOperation (line 735) | protected transformSetOperation(
    method transformReferences (line 747) | protected transformReferences(
    method transformCheckConstraint (line 760) | protected transformCheckConstraint(
    method transformWith (line 771) | protected transformWith(node: WithNode, queryId?: QueryId): WithNode {
    method transformCommonTableExpression (line 779) | protected transformCommonTableExpression(
    method transformCommonTableExpressionName (line 791) | protected transformCommonTableExpressionName(
    method transformHaving (line 802) | protected transformHaving(node: HavingNode, queryId?: QueryId): Having...
    method transformCreateSchema (line 809) | protected transformCreateSchema(
    method transformDropSchema (line 820) | protected transformDropSchema(
    method transformAlterTable (line 832) | protected transformAlterTable(
    method transformDropColumn (line 853) | protected transformDropColumn(
    method transformRenameColumn (line 863) | protected transformRenameColumn(
    method transformAlterColumn (line 874) | protected transformAlterColumn(
    method transformModifyColumn (line 890) | protected transformModifyColumn(
    method transformAddConstraint (line 900) | protected transformAddConstraint(
    method transformDropConstraint (line 910) | protected transformDropConstraint(
    method transformRenameConstraint (line 922) | protected transformRenameConstraint(
    method transformCreateView (line 933) | protected transformCreateView(
    method transformRefreshMaterializedView (line 949) | protected transformRefreshMaterializedView(
    method transformDropView (line 961) | protected transformDropView(
    method transformGenerated (line 974) | protected transformGenerated(
    method transformDefaultValue (line 988) | protected transformDefaultValue(
    method transformOn (line 998) | protected transformOn(node: OnNode, queryId?: QueryId): OnNode {
    method transformSelectModifier (line 1005) | protected transformSelectModifier(
    method transformCreateType (line 1017) | protected transformCreateType(
    method transformDropType (line 1028) | protected transformDropType(
    method transformExplain (line 1039) | protected transformExplain(
    method transformSchemableIdentifier (line 1050) | protected transformSchemableIdentifier(
    method transformAggregateFunction (line 1061) | protected transformAggregateFunction(
    method transformOver (line 1077) | protected transformOver(node: OverNode, queryId?: QueryId): OverNode {
    method transformPartitionBy (line 1085) | protected transformPartitionBy(
    method transformPartitionByItem (line 1095) | protected transformPartitionByItem(
    method transformBinaryOperation (line 1105) | protected transformBinaryOperation(
    method transformUnaryOperation (line 1117) | protected transformUnaryOperation(
    method transformUsing (line 1128) | protected transformUsing(node: UsingNode, queryId?: QueryId): UsingNode {
    method transformFunction (line 1135) | protected transformFunction(
    method transformCase (line 1146) | protected transformCase(node: CaseNode, queryId?: QueryId): CaseNode {
    method transformWhen (line 1156) | protected transformWhen(node: WhenNode, queryId?: QueryId): WhenNode {
    method transformJSONReference (line 1164) | protected transformJSONReference(
    method transformJSONPath (line 1175) | protected transformJSONPath(
    method transformJSONPathLeg (line 1186) | protected transformJSONPathLeg(
    method transformJSONOperatorChain (line 1197) | protected transformJSONOperatorChain(
    method transformTuple (line 1208) | protected transformTuple(node: TupleNode, queryId?: QueryId): TupleNode {
    method transformMergeQuery (line 1215) | protected transformMergeQuery(
    method transformMatched (line 1232) | protected transformMatched(
    method transformAddIndex (line 1243) | protected transformAddIndex(
    method transformCast (line 1257) | protected transformCast(node: CastNode, queryId?: QueryId): CastNode {
    method transformFetch (line 1265) | protected transformFetch(node: FetchNode, queryId?: QueryId): FetchNode {
    method transformTop (line 1273) | protected transformTop(node: TopNode, _queryId?: QueryId): TopNode {
    method transformOutput (line 1281) | protected transformOutput(node: OutputNode, queryId?: QueryId): Output...
    method transformDataType (line 1288) | protected transformDataType(
    method transformSelectAll (line 1296) | protected transformSelectAll(
    method transformIdentifier (line 1304) | protected transformIdentifier(
    method transformValue (line 1312) | protected transformValue(node: ValueNode, _queryId?: QueryId): ValueNo...
    method transformPrimitiveValueList (line 1317) | protected transformPrimitiveValueList(
    method transformOperator (line 1325) | protected transformOperator(
    method transformDefaultInsertValue (line 1333) | protected transformDefaultInsertValue(
    method transformOrAction (line 1341) | protected transformOrAction(
    method transformCollate (line 1349) | protected transformCollate(

FILE: src/operation-node/operation-node-visitor.ts
  method parentNode (line 107) | protected get parentNode(): OperationNode | undefined {

FILE: src/operation-node/operation-node.ts
  type OperationNodeKind (line 1) | type OperationNodeKind =
  type OperationNode (line 100) | interface OperationNode {

FILE: src/operation-node/operator-node.ts
  constant COMPARISON_OPERATORS (line 4) | const COMPARISON_OPERATORS = [
  constant ARITHMETIC_OPERATORS (line 45) | const ARITHMETIC_OPERATORS = [
  constant JSON_OPERATORS (line 59) | const JSON_OPERATORS = ['->', '->>'] as const
  constant BINARY_OPERATORS (line 61) | const BINARY_OPERATORS = [
  constant UNARY_FILTER_OPERATORS (line 68) | const UNARY_FILTER_OPERATORS = ['exists', 'not exists'] as const
  constant UNARY_OPERATORS (line 69) | const UNARY_OPERATORS = ['not', '-', ...UNARY_FILTER_OPERATORS] as const
  constant OPERATORS (line 70) | const OPERATORS = [
  type ComparisonOperator (line 78) | type ComparisonOperator = (typeof COMPARISON_OPERATORS)[number]
  type ArithmeticOperator (line 79) | type ArithmeticOperator = (typeof ARITHMETIC_OPERATORS)[number]
  type JSONOperator (line 80) | type JSONOperator = (typeof JSON_OPERATORS)[number]
  type JSONOperatorWith$ (line 81) | type JSONOperatorWith$ = JSONOperator | `${JSONOperator}$`
  type BinaryOperator (line 82) | type BinaryOperator = (typeof BINARY_OPERATORS)[number]
  type UnaryOperator (line 83) | type UnaryOperator = (typeof UNARY_OPERATORS)[number]
  type UnaryFilterOperator (line 84) | type UnaryFilterOperator = (typeof UNARY_FILTER_OPERATORS)[number]
  type Operator (line 85) | type Operator = (typeof OPERATORS)[number]
  type OperatorNode (line 87) | interface OperatorNode extends OperationNode {
  type OperatorNodeFactory (line 92) | type OperatorNodeFactory = Readonly<{
  method is (line 101) | is(node): node is OperatorNode {
  method create (line 105) | create(operator) {
  function isOperator (line 113) | function isOperator(op: unknown): op is Operator {
  function isBinaryOperator (line 117) | function isBinaryOperator(op: unknown): op is BinaryOperator {
  function isComparisonOperator (line 121) | function isComparisonOperator(op: unknown): op is ComparisonOperator {
  function isArithmeticOperator (line 125) | function isArithmeticOperator(op: unknown): op is ArithmeticOperator {
  function isJSONOperator (line 129) | function isJSONOperator(op: unknown): op is JSONOperator {

FILE: src/operation-node/or-action-node.ts
  type OrActionNode (line 4) | interface OrActionNode extends OperationNode {
  type OrActionNodeFactory (line 9) | type OrActionNodeFactory = Readonly<{
  method is (line 18) | is(node): node is OrActionNode {
  method create (line 22) | create(action) {

FILE: src/operation-node/or-node.ts
  type OrNode (line 4) | interface OrNode extends OperationNode {
  type OrNodeFactory (line 10) | type OrNodeFactory = Readonly<{
  method is (line 19) | is(node): node is OrNode {
  method create (line 23) | create(left, right) {

FILE: src/operation-node/order-by-item-node.ts
  type OrderByItemNodeProps (line 5) | type OrderByItemNodeProps = Omit<OrderByItemNode, 'kind' | 'orderBy'>
  type OrderByItemNode (line 7) | interface OrderByItemNode extends OperationNode {
  type OrderByItemNodeFactory (line 15) | type OrderByItemNodeFactory = Readonly<{
  method is (line 32) | is(node): node is OrderByItemNode {
  method create (line 36) | create(orderBy, direction?) {
  method cloneWith (line 44) | cloneWith(node, props) {

FILE: src/operation-node/order-by-node.ts
  type OrderByNode (line 5) | interface OrderByNode extends OperationNode {
  type OrderByNodeFactory (line 10) | type OrderByNodeFactory = Readonly<{
  method is (line 23) | is(node): node is OrderByNode {
  method create (line 27) | create(items) {
  method cloneWithItems (line 34) | cloneWithItems(orderBy, items) {

FILE: src/operation-node/output-node.ts
  type OutputNode (line 4) | interface OutputNode extends OperationNode {
  type OutputNodeFactory (line 9) | type OutputNodeFactory = Readonly<{
  method is (line 22) | is(node): node is OutputNode {
  method create (line 26) | create(selections) {
  method cloneWithSelections (line 33) | cloneWithSelections(output, selections) {

FILE: src/operation-node/over-node.ts
  type OverNode (line 8) | interface OverNode extends OperationNode {
  type OverNodeFactory (line 14) | type OverNodeFactory = Readonly<{
  method is (line 31) | is(node): node is OverNode {
  method create (line 35) | create() {
  method cloneWithOrderByItems (line 41) | cloneWithOrderByItems(overNode, items) {
  method cloneWithPartitionByItems (line 50) | cloneWithPartitionByItems(overNode, items) {

FILE: src/operation-node/parens-node.ts
  type ParensNode (line 4) | interface ParensNode extends OperationNode {
  type ParensNodeFactory (line 9) | type ParensNodeFactory = Readonly<{
  method is (line 18) | is(node): node is ParensNode {
  method create (line 22) | create(node) {

FILE: src/operation-node/partition-by-item-node.ts
  type PartitionByItemNode (line 5) | interface PartitionByItemNode extends OperationNode {
  type PartitionByItemNodeFactory (line 10) | type PartitionByItemNodeFactory = Readonly<{
  method is (line 22) | is(node): node is PartitionByItemNode {
  method create (line 26) | create(partitionBy) {

FILE: src/operation-node/partition-by-node.ts
  type PartitionByNode (line 5) | interface PartitionByNode extends OperationNode {
  type PartitionByNodeFactory (line 10) | type PartitionByNodeFactory = Readonly<{
  method is (line 24) | is(node): node is PartitionByNode {
  method create (line 28) | create(items) {
  method cloneWithItems (line 35) | cloneWithItems(partitionBy, items) {

FILE: src/operation-node/primary-key-constraint-node.ts
  type PrimaryKeyConstraintNode (line 6) | interface PrimaryKeyConstraintNode extends OperationNode {
  type PrimaryKeyConstraintNodeProps (line 14) | type PrimaryKeyConstraintNodeProps = Omit<
  type PrimaryKeyConstraintNodeFactory (line 19) | type PrimaryKeyConstraintNodeFactory = Readonly<{
  method is (line 36) | is(node): node is PrimaryKeyConstraintNode {
  method create (line 40) | create(columns, constraintName?) {
  method cloneWith (line 50) | cloneWith(node, props) {

FILE: src/operation-node/primitive-value-list-node.ts
  type PrimitiveValueListNode (line 9) | interface PrimitiveValueListNode extends OperationNode {
  type PrimitiveValueListNodeFactory (line 14) | type PrimitiveValueListNodeFactory = Readonly<{
  method is (line 24) | is(node): node is PrimitiveValueListNode {
  method create (line 28) | create(values) {

FILE: src/operation-node/query-node.ts
  type QueryNode (line 20) | type QueryNode =
  type HasJoins (line 27) | type HasJoins = { joins?: ReadonlyArray<JoinNode> }
  type HasWhere (line 28) | type HasWhere = { where?: WhereNode }
  type HasReturning (line 29) | type HasReturning = { returning?: ReturningNode }
  type HasExplain (line 30) | type HasExplain = { explain?: ExplainNode }
  type HasTop (line 31) | type HasTop = { top?: TopNode }
  type HasOutput (line 32) | type HasOutput = { output?: OutputNode }
  type HasEndModifiers (line 33) | type HasEndModifiers = { endModifiers?: ReadonlyArray<OperationNode> }
  type HasOrderBy (line 34) | type HasOrderBy = { orderBy?: OrderByNode }
  type QueryNodeFactory (line 36) | type QueryNodeFactory = Readonly<{
  method is (line 74) | is(node): node is QueryNode {
  method cloneWithEndModifier (line 84) | cloneWithEndModifier(node, modifier) {
  method cloneWithWhere (line 93) | cloneWithWhere(node, operation) {
  method cloneWithJoin (line 102) | cloneWithJoin(node, join) {
  method cloneWithReturning (line 109) | cloneWithReturning(node, selections) {
  method cloneWithoutReturning (line 118) | cloneWithoutReturning(node) {
  method cloneWithoutWhere (line 125) | cloneWithoutWhere(node) {
  method cloneWithExplain (line 132) | cloneWithExplain(node, format, options) {
  method cloneWithTop (line 139) | cloneWithTop(node, top) {
  method cloneWithOutput (line 146) | cloneWithOutput(node, selections) {
  method cloneWithOrderByItems (line 155) | cloneWithOrderByItems(node, items) {
  method cloneWithoutOrderBy (line 164) | cloneWithoutOrderBy(node) {

FILE: src/operation-node/raw-node.ts
  type RawNode (line 4) | interface RawNode extends OperationNode {
  type RawNodeFactory (line 10) | type RawNodeFactory = Readonly<{
  method is (line 25) | is(node): node is RawNode {
  method create (line 29) | create(sqlFragments, parameters) {
  method createWithSql (line 37) | createWithSql(sql) {
  method createWithChild (line 41) | createWithChild(child) {
  method createWithChildren (line 45) | createWithChildren(children) {

FILE: src/operation-node/reference-node.ts
  type ReferenceNode (line 7) | interface ReferenceNode extends OperationNode {
  type ReferenceNodeFactory (line 13) | type ReferenceNodeFactory = Readonly<{
  method is (line 24) | is(node): node is ReferenceNode {
  method create (line 28) | create(column, table?) {
  method createSelectAll (line 36) | createSelectAll(table) {

FILE: src/operation-node/references-node.ts
  constant ON_MODIFY_FOREIGN_ACTIONS (line 7) | const ON_MODIFY_FOREIGN_ACTIONS = [
  type OnModifyForeignAction (line 15) | type OnModifyForeignAction = ArrayItemType<
  type ReferencesNode (line 19) | interface ReferencesNode extends OperationNode {
  type ReferencesNodeFactory (line 27) | type ReferencesNodeFactory = Readonly<{
  method is (line 48) | is(node): node is ReferencesNode {
  method create (line 52) | create(table, columns) {
  method cloneWithOnDelete (line 60) | cloneWithOnDelete(references, onDelete) {
  method cloneWithOnUpdate (line 67) | cloneWithOnUpdate(references, onUpdate) {

FILE: src/operation-node/refresh-materialized-view-node.ts
  type RefreshMaterializedViewNodeParams (line 5) | type RefreshMaterializedViewNodeParams = Omit<
  type RefreshMaterializedViewNode (line 10) | interface RefreshMaterializedViewNode extends OperationNode {
  type RefreshMaterializedViewNodeFactory (line 17) | type RefreshMaterializedViewNodeFactory = Readonly<{
  method is (line 31) | is(node): node is RefreshMaterializedViewNode {
  method create (line 35) | create(name) {
  method cloneWith (line 42) | cloneWith(createView, params) {

FILE: src/operation-node/rename-column-node.ts
  type RenameColumnNode (line 5) | interface RenameColumnNode extends OperationNode {
  type RenameColumnNodeFactory (line 11) | type RenameColumnNodeFactory = Readonly<{
  method is (line 21) | is(node): node is RenameColumnNode {
  method create (line 25) | create(column, newColumn) {

FILE: src/operation-node/rename-constraint-node.ts
  type RenameConstraintNode (line 5) | interface RenameConstraintNode extends OperationNode {
  type RenameConstraintNodeFactory (line 11) | type RenameConstraintNodeFactory = Readonly<{
  method is (line 21) | is(node): node is RenameConstraintNode {
  method create (line 25) | create(oldName, newName) {

FILE: src/operation-node/returning-node.ts
  type ReturningNode (line 5) | interface ReturningNode extends OperationNode {
  type ReturningNodeFactory (line 10) | type ReturningNodeFactory = Readonly<{
  method is (line 24) | is(node): node is ReturningNode {
  method create (line 28) | create(selections) {
  method cloneWithSelections (line 35) | cloneWithSelections(returning, selections) {

FILE: src/operation-node/schemable-identifier-node.ts
  type SchemableIdentifierNode (line 5) | interface SchemableIdentifierNode extends OperationNode {
  type SchemableIdentifierNodeFactory (line 11) | type SchemableIdentifierNodeFactory = Readonly<{
  method is (line 25) | is(node): node is SchemableIdentifierNode {
  method create (line 29) | create(identifier) {
  method createWithSchema (line 36) | createWithSchema(schema, identifier) {

FILE: src/operation-node/select-all-node.ts
  type SelectAllNode (line 4) | interface SelectAllNode extends OperationNode {
  type SelectAllNodeFactory (line 8) | type SelectAllNodeFactory = Readonly<{
  method is (line 18) | is(node): node is SelectAllNode {
  method create (line 22) | create() {

FILE: src/operation-node/select-modifier-node.ts
  type SelectModifier (line 4) | type SelectModifier =
  type SelectModifierNode (line 13) | interface SelectModifierNode extends OperationNode {
  type SelectModifierNodeFactory (line 20) | type SelectModifierNodeFactory = Readonly<{
  method is (line 34) | is(node): node is SelectModifierNode {
  method create (line 38) | create(modifier, of?) {
  method createWithExpression (line 46) | createWithExpression(modifier) {

FILE: src/operation-node/select-query-node.ts
  type SelectQueryNode (line 22) | interface SelectQueryNode extends OperationNode {
  type SelectQueryNodeFactory (line 43) | type SelectQueryNodeFactory = Readonly<{
  method is (line 102) | is(node): node is SelectQueryNode {
  method create (line 106) | create(withNode?) {
  method createFrom (line 113) | createFrom(fromItems, withNode?) {
  method cloneWithSelections (line 121) | cloneWithSelections(select, selections) {
  method cloneWithDistinctOn (line 130) | cloneWithDistinctOn(select, expressions) {
  method cloneWithFrontModifier (line 139) | cloneWithFrontModifier(select, modifier) {
  method cloneWithGroupByItems (line 155) | cloneWithGroupByItems(selectNode, items) {
  method cloneWithLimit (line 164) | cloneWithLimit(selectNode, limit) {
  method cloneWithOffset (line 171) | cloneWithOffset(selectNode, offset) {
  method cloneWithFetch (line 178) | cloneWithFetch(selectNode, fetch) {
  method cloneWithHaving (line 185) | cloneWithHaving(selectNode, operation) {
  method cloneWithSetOperations (line 194) | cloneWithSetOperations(selectNode, setOperations) {
  method cloneWithoutSelections (line 203) | cloneWithoutSelections(select) {
  method cloneWithoutLimit (line 210) | cloneWithoutLimit(select) {
  method cloneWithoutOffset (line 217) | cloneWithoutOffset(select) {
  method cloneWithoutGroupBy (line 230) | cloneWithoutGroupBy(select) {

FILE: src/operation-node/selection-node.ts
  type SelectionNodeChild (line 9) | type SelectionNodeChild =
  type SelectionNode (line 14) | interface SelectionNode extends OperationNode {
  type SelectionNodeFactory (line 19) | type SelectionNodeFactory = Readonly<{
  method is (line 31) | is(node): node is SelectionNode {
  method create (line 35) | create(selection) {
  method createSelectAll (line 42) | createSelectAll() {
  method createSelectAllFromTable (line 49) | createSelectAllFromTable(table) {

FILE: src/operation-node/set-operation-node.ts
  type SetOperator (line 4) | type SetOperator = 'union' | 'intersect' | 'except'
  type SetOperationNode (line 6) | interface SetOperationNode extends OperationNode {
  type SetOperationNodeFactory (line 13) | type SetOperationNodeFactory = Readonly<{
  method is (line 27) | is(node): node is SetOperationNode {
  method create (line 31) | create(operator, expression, all) {

FILE: src/operation-node/simple-reference-expression-node.ts
  type SimpleReferenceExpressionNode (line 4) | type SimpleReferenceExpressionNode = ColumnNode | ReferenceNode

FILE: src/operation-node/table-node.ts
  type TableNode (line 5) | interface TableNode extends OperationNode {
  type TableNodeFactory (line 10) | type TableNodeFactory = Readonly<{
  method is (line 20) | is(node): node is TableNode {
  method create (line 24) | create(table) {
  method createWithSchema (line 31) | createWithSchema(schema, table) {

FILE: src/operation-node/top-node.ts
  type TopModifier (line 4) | type TopModifier = 'percent' | 'with ties' | 'percent with ties'
  type TopNode (line 6) | interface TopNode extends OperationNode {
  type TopNodeFactory (line 12) | type TopNodeFactory = Readonly<{
  method is (line 24) | is(node): node is TopNode {
  method create (line 28) | create(expression, modifiers?) {

FILE: src/operation-node/tuple-node.ts
  type TupleNode (line 4) | interface TupleNode extends OperationNode {
  type TupleNodeFactory (line 9) | type TupleNodeFactory = Readonly<{
  method is (line 18) | is(node): node is TupleNode {
  method create (line 22) | create(values) {

FILE: src/operation-node/unary-operation-node.ts
  type UnaryOperationNode (line 4) | interface UnaryOperationNode extends OperationNode {
  type UnaryOperationNodeFactory (line 10) | type UnaryOperationNodeFactory = Readonly<{
  method is (line 23) | is(node): node is UnaryOperationNode {
  method create (line 27) | create(operator, operand) {

FILE: src/operation-node/unique-constraint-node.ts
  type UniqueConstraintNode (line 6) | interface UniqueConstraintNode extends OperationNode {
  type UniqueConstraintNodeProps (line 15) | type UniqueConstraintNodeProps = Omit<
  type UniqueConstraintNodeFactory (line 20) | type UniqueConstraintNodeFactory = Readonly<{
  method is (line 38) | is(node): node is UniqueConstraintNode {
  method create (line 42) | create(columns, constraintName?, nullsNotDistinct?) {
  method cloneWith (line 53) | cloneWith(node, props) {

FILE: src/operation-node/update-query-node.ts
  type UpdateQueryNode (line 16) | interface UpdateQueryNode extends OperationNode {
  type UpdateQueryNodeFactory (line 33) | type UpdateQueryNodeFactory = Readonly<{
  method is (line 59) | is(node): node is UpdateQueryNode {
  method create (line 63) | create(tables, withNode?) {
  method createWithoutTable (line 73) | createWithoutTable() {
  method cloneWithFromItems (line 79) | cloneWithFromItems(updateQuery, fromItems) {
  method cloneWithUpdates (line 88) | cloneWithUpdates(updateQuery, updates) {
  method cloneWithLimit (line 97) | cloneWithLimit(updateQuery, limit) {

FILE: src/operation-node/using-node.ts
  type UsingNode (line 4) | interface UsingNode extends OperationNode {
  type UsingNodeFactory (line 9) | type UsingNodeFactory = Readonly<{
  method is (line 22) | is(node): node is UsingNode {
  method create (line 26) | create(tables) {
  method cloneWithTables (line 33) | cloneWithTables(using, tables) {

FILE: src/operation-node/value-list-node.ts
  type ValueListNode (line 4) | interface ValueListNode extends OperationNode {
  type ValueListNodeFactory (line 9) | type ValueListNodeFactory = Readonly<{
  method is (line 19) | is(node): node is ValueListNode {
  method create (line 23) | create(values) {

FILE: src/operation-node/value-node.ts
  type ValueNode (line 4) | interface ValueNode extends OperationNode {
  type ValueNodeFactory (line 10) | type ValueNodeFactory = Readonly<{
  method is (line 20) | is(node): node is ValueNode {
  method create (line 24) | create(value) {
  method createImmediate (line 31) | createImmediate(value) {

FILE: src/operation-node/values-node.ts
  type ValuesItemNode (line 6) | type ValuesItemNode = ValueListNode | PrimitiveValueListNode
  type ValuesNode (line 8) | interface ValuesNode extends OperationNode {
  type ValuesNodeFactory (line 13) | type ValuesNodeFactory = Readonly<{
  method is (line 22) | is(node): node is ValuesNode {
  method create (line 26) | create(values) {

FILE: src/operation-node/when-node.ts
  type WhenNode (line 4) | interface WhenNode extends OperationNode {
  type WhenNodeFactory (line 10) | type WhenNodeFactory = Readonly<{
  method is (line 20) | is(node): node is WhenNode {
  method create (line 24) | create(condition) {
  method cloneWithResult (line 31) | cloneWithResult(whenNode, result) {

FILE: src/operation-node/where-node.ts
  type WhereNode (line 6) | interface WhereNode extends OperationNode {
  type WhereNodeFactory (line 11) | type WhereNodeFactory = Readonly<{
  method is (line 25) | is(node): node is WhereNode {
  method create (line 29) | create(filter) {
  method cloneWithOperation (line 36) | cloneWithOperation(whereNode, operator, operation) {

FILE: src/operation-node/with-node.ts
  type WithNodeParams (line 5) | type WithNodeParams = Omit<WithNode, 'kind' | 'expressions'>
  type WithNode (line 7) | interface WithNode extends OperationNode {
  type WithNodeFactory (line 13) | type WithNodeFactory = Readonly<{
  method is (line 29) | is(node): node is WithNode {
  method create (line 33) | create(expression, params?) {
  method cloneWithExpression (line 41) | cloneWithExpression(withNode, expression) {

FILE: src/parser/binary-operation-parser.ts
  type OperandValueExpression (line 42) | type OperandValueExpression<
  type OperandValueExpressionOrList (line 48) | type OperandValueExpressionOrList<
  type OperatorExpression (line 58) | type OperatorExpression = Operator | Expression<unknown>
  type BinaryOperatorExpression (line 59) | type BinaryOperatorExpression = BinaryOperator | Expression<unknown>
  type ComparisonOperatorExpression (line 61) | type ComparisonOperatorExpression =
  type FilterObject (line 65) | type FilterObject<DB, TB extends keyof DB> = {
  function parseValueBinaryOperationOrExpression (line 73) | function parseValueBinaryOperationOrExpression(
  function parseValueBinaryOperation (line 85) | function parseValueBinaryOperation(
  function parseReferentialBinaryOperation (line 105) | function parseReferentialBinaryOperation(
  function parseFilterObject (line 117) | function parseFilterObject(
  function parseFilterList (line 131) | function parseFilterList(
  function isIsOperator (line 159) | function isIsOperator(
  function needsIsOperator (line 165) | function needsIsOperator(value: unknown): value is null | boolean {
  function parseOperator (line 169) | function parseOperator(operator: OperatorExpression): OperationNode {
  function toOperationNode (line 181) | function toOperationNode(

FILE: src/parser/coalesce-parser.ts
  type ExtractTypeFromCoalesce1 (line 3) | type ExtractTypeFromCoalesce1<
  type ExtractTypeFromCoalesce2 (line 9) | type ExtractTypeFromCoalesce2<
  type ExtractTypeFromCoalesceValues2 (line 19) | type ExtractTypeFromCoalesceValues2<V1, V2> = null extends V1
  type ExtractTypeFromCoalesce3 (line 25) | type ExtractTypeFromCoalesce3<
  type ExtractTypeFromCoalesceValues3 (line 37) | type ExtractTypeFromCoalesceValues3<V1, V2, V3> = null extends V1
  type ExtractTypeFromCoalesce4 (line 45) | type ExtractTypeFromCoalesce4<
  type ExtractTypeFromCoalesceValues4 (line 59) | type ExtractTypeFromCoalesceValues4<V1, V2, V3, V4> = null extends V1
  type ExtractTypeFromCoalesce5 (line 69) | type ExtractTypeFromCoalesce5<
  type ExtractTypeFromCoalesceValues5 (line 85) | type ExtractTypeFromCoalesceValues5<V1, V2, V3, V4, V5> = null extends V1
  type NotNull (line 97) | type NotNull<T> = Exclude<T, null>

FILE: src/parser/collate-parser.ts
  type Collation (line 1) | type Collation =

FILE: src/parser/data-type-parser.ts
  type DataTypeExpression (line 10) | type DataTypeExpression = ColumnDataType | Expression<any>
  function parseDataTypeExpression (line 12) | function parseDataTypeExpression(

FILE: src/parser/default-value-parser.ts
  type DefaultValueExpression (line 6) | type DefaultValueExpression = unknown | Expression<unknown>
  function parseDefaultValueExpression (line 8) | function parseDefaultValueExpression(

FILE: src/parser/delete-from-parser.ts
  type DeleteFrom (line 11) | type DeleteFrom<DB, TE extends TableExpressionOrList<DB, never>> = [

FILE: src/parser/expression-parser.ts
  type OperandExpression (line 22) | type OperandExpression<V> =
  type ExpressionOrFactory (line 29) | type ExpressionOrFactory<DB, TB extends keyof DB, V> =
  type AliasedExpressionOrFactory (line 33) | type AliasedExpressionOrFactory<DB, TB extends keyof DB> =
  type ExpressionFactory (line 37) | type ExpressionFactory<DB, TB extends keyof DB, V> = (
  type OperandExpressionFactory (line 41) | type OperandExpressionFactory<DB, TB extends keyof DB, V> = (
  type AliasedExpressionFactory (line 45) | type AliasedExpressionFactory<DB, TB extends keyof DB> = (
  function parseExpression (line 49) | function parseExpression(
  function parseAliasedExpression (line 61) | function parseAliasedExpression(
  function isExpressionOrFactory (line 73) | function isExpressionOrFactory(

FILE: src/parser/fetch-parser.ts
  function parseFetch (line 4) | function parseFetch(
  function isFetchModifier (line 19) | function isFetchModifier(value: any): value is FetchModifier {

FILE: src/parser/group-by-parser.ts
  type GroupByExpression (line 12) | type GroupByExpression<DB, TB extends keyof DB, O> =
  type GroupByArg (line 16) | type GroupByArg<DB, TB extends keyof DB, O> =
  function parseGroupBy (line 23) | function parseGroupBy(

FILE: src/parser/identifier-parser.ts
  function parseSchemableIdentifier (line 3) | function parseSchemableIdentifier(id: string): SchemableIdentifierNode {
  function trim (line 19) | function trim(str: string): string {

FILE: src/parser/insert-values-parser.ts
  type InsertObject (line 24) | type InsertObject<DB, TB extends keyof DB> = {
  type InsertObjectOrList (line 36) | type InsertObjectOrList<DB, TB extends keyof DB> =
  type InsertObjectOrListFactory (line 40) | type InsertObjectOrListFactory<
  type InsertExpression (line 46) | type InsertExpression<
  function parseInsertExpression (line 52) | function parseInsertExpression(
  function parseInsertColumnsAndValues (line 63) | function parseInsertColumnsAndValues(
  function parseColumnNamesAndIndexes (line 74) | function parseColumnNamesAndIndexes(
  function parseRowValues (line 92) | function parseRowValues(

FILE: src/parser/join-parser.ts
  type JoinReferenceExpression (line 17) | type JoinReferenceExpression<
  type JoinCallbackExpression (line 25) | type JoinCallbackExpression<DB, TB extends keyof DB, TE> = (
  type AnyJoinColumn (line 29) | type AnyJoinColumn<DB, TB extends keyof DB, TE> = AnyColumn<
  type AnyJoinColumnWithTable (line 34) | type AnyJoinColumnWithTable<DB, TB extends keyof DB, TE> = AnyColumnWith...
  function parseJoin (line 39) | function parseJoin(joinType: JoinType, args: any[]): JoinNode {
  function parseCallbackJoin (line 51) | function parseCallbackJoin(
  function parseSingleOnJoin (line 59) | function parseSingleOnJoin(
  function parseOnlessJoin (line 72) | function parseOnlessJoin(

FILE: src/parser/merge-into-parser.ts
  type MergeInto (line 6) | type MergeInto<DB, TE extends SimpleTableReference<DB>> = [TE] extends [

FILE: src/parser/merge-parser.ts
  function parseMergeWhen (line 17) | function parseMergeWhen(
  function parseMergeThen (line 43) | function parseMergeThen(

FILE: src/parser/on-commit-action-parse.ts
  function parseOnCommitAction (line 6) | function parseOnCommitAction(action: OnCommitAction): OnCommitAction {

FILE: src/parser/on-modify-action-parser.ts
  function parseOnModifyForeignAction (line 6) | function parseOnModifyForeignAction(

FILE: src/parser/order-by-parser.ts
  type OrderByExpression (line 22) | type OrderByExpression<DB, TB extends keyof DB, O> =
  type OrderByModifiers (line 28) | type OrderByModifiers =
  type OrderByDirection (line 32) | type OrderByDirection = 'asc' | 'desc'
  function isOrderByDirection (line 34) | function isOrderByDirection(thing: unknown): thing is OrderByDirection {
  type OrderByModifiersCallbackExpression (line 38) | type OrderByModifiersCallbackExpression = (
  type DirectedOrderByStringReference (line 46) | type DirectedOrderByStringReference<DB, TB extends keyof DB, O> = `${
  type OrderByDirectionExpression (line 54) | type OrderByDirectionExpression = OrderByDirection | Expression<any>
  type UndirectedOrderByExpression (line 60) | type UndirectedOrderByExpression<DB, TB extends keyof DB, O> =
  function parseOrderBy (line 64) | function parseOrderBy(args: any[]): OrderByItemNode[] {
  function parseOrderByItem (line 88) | function parseOrderByItem(
  function parseOrderByExpression (line 105) | function parseOrderByExpression(
  function parseOrderByWithModifiers (line 129) | function parseOrderByWithModifiers(

FILE: src/parser/parse-utils.ts
  function createSelectQueryBuilder (line 19) | function createSelectQueryBuilder(): SelectQueryBuilder<any, any, any> {
  function createQueryCreator (line 27) | function createQueryCreator(): QueryCreator<any> {
  function createJoinBuilder (line 33) | function createJoinBuilder(
  function createOverBuilder (line 42) | function createOverBuilder(): OverBuilder<any, any> {

FILE: src/parser/partition-by-parser.ts
  type PartitionByExpression (line 9) | type PartitionByExpression<DB, TB extends keyof DB> =
  type PartitionByExpressionOrList (line 13) | type PartitionByExpressionOrList<DB, TB extends keyof DB> =
  function parsePartitionBy (line 17) | function parsePartitionBy(

FILE: src/parser/reference-parser.ts
  type StringReference (line 37) | type StringReference<DB, TB extends keyof DB> =
  type SimpleReferenceExpression (line 41) | type SimpleReferenceExpression<DB, TB extends keyof DB> =
  type ReferenceExpression (line 45) | type ReferenceExpression<DB, TB extends keyof DB> =
  type ReferenceExpressionOrList (line 49) | type ReferenceExpressionOrList<DB, TB extends keyof DB> =
  type ExtractTypeFromReferenceExpression (line 53) | type ExtractTypeFromReferenceExpression<
  type ExtractRawTypeFromReferenceExpression (line 60) | type ExtractRawTypeFromReferenceExpression<
  type ExtractTypeFromStringReference (line 77) | type ExtractTypeFromStringReference<
  type OrderedColumnName (line 98) | type OrderedColumnName<C extends string> =
  type ExtractColumnNameFromOrderedColumnName (line 105) | type ExtractColumnNameFromOrderedColumnName<C extends string> =
  function parseSimpleReferenceExpression (line 112) | function parseSimpleReferenceExpression(
  function parseReferenceExpressionOrList (line 122) | function parseReferenceExpressionOrList(
  function parseReferenceExpression (line 132) | function parseReferenceExpression(
  function parseJSONReference (line 142) | function parseJSONReference(
  function parseStringReference (line 167) | function parseStringReference(ref: string): ReferenceNode {
  function parseAliasedStringReference (line 187) | function parseAliasedStringReference(
  function parseColumnName (line 204) | function parseColumnName(column: AnyColumn<any, any>): ColumnNode {
  function parseOrderedColumnName (line 208) | function parseOrderedColumnName(column: string): OperationNode {
  function parseStringReferenceWithTableAndSchema (line 226) | function parseStringReferenceWithTableAndSchema(
  function parseStringReferenceWithTable (line 237) | function parseStringReferenceWithTable(parts: string[]): ReferenceNode {
  function trim (line 246) | function trim(str: string): string {

FILE: src/parser/returning-parser.ts
  type ReturningRow (line 11) | type ReturningRow<DB, TB extends keyof DB, O, SE> = O extends
  type ReturningCallbackRow (line 19) | type ReturningCallbackRow<DB, TB extends keyof DB, O, CB> = O extends
  type ReturningAllRow (line 27) | type ReturningAllRow<DB, TB extends keyof DB, O> = O extends

FILE: src/parser/savepoint-parser.ts
  type RollbackToSavepoint (line 4) | type RollbackToSavepoint<
  type ReleaseSavepoint (line 13) | type ReleaseSavepoint<
  function parseSavepointCommand (line 22) | function parseSavepointCommand(

FILE: src/parser/select-from-parser.ts
  type SelectFrom (line 10) | type SelectFrom<

FILE: src/parser/select-parser.ts
  type SelectExpression (line 29) | type SelectExpression<DB, TB extends keyof DB> =
  type SelectCallback (line 37) | type SelectCallback<DB, TB extends keyof DB> = (
  type Selection (line 44) | type Selection<
  type CallbackSelection (line 61) | type CallbackSelection<DB, TB extends keyof DB, CB> = CB extends (
  type SelectArg (line 67) | type SelectArg<
  type FlattenSelectExpression (line 76) | type FlattenSelectExpression<SE> =
  type ExtractAliasFromSelectExpression (line 81) | type ExtractAliasFromSelectExpression<SE> = SE extends string
  type ExtractAliasFromStringSelectExpression (line 91) | type ExtractAliasFromStringSelectExpression<SE extends string> =
  type ExtractTypeFromSelectExpression (line 104) | type ExtractTypeFromSelectExpression<
  type ExtractTypeFromStringSelectExpression (line 122) | type ExtractTypeFromStringSelectExpression<
  type AllSelection (line 158) | type AllSelection<DB, TB extends keyof DB> = DrainOuterGeneric<{
  function parseSelectArg (line 164) | function parseSelectArg(
  function parseSelectExpression (line 176) | function parseSelectExpression(
  function parseSelectAll (line 188) | function parseSelectAll(table?: string | string[]): SelectionNode[] {
  function parseSelectAllArg (line 198) | function parseSelectAllArg(table: string): SelectionNode {

FILE: src/parser/set-operation-parser.ts
  type SetOperandExpression (line 13) | type SetOperandExpression<DB, O> =
  function parseSetOperations (line 20) | function parseSetOperations(

FILE: src/parser/table-parser.ts
  type TableExpression (line 17) | type TableExpression<DB, TB extends keyof DB> =
  type TableExpressionOrList (line 23) | type TableExpressionOrList<DB, TB extends keyof DB> =
  type SimpleTableReference (line 27) | type SimpleTableReference<DB> = AnyAliasedTable<DB> | AnyTable<DB>
  type AnyAliasedTable (line 28) | type AnyAliasedTable<DB> = `${AnyTable<DB>} as ${string}`
  type AnyTable (line 29) | type AnyTable<DB> = keyof DB & string
  type From (line 31) | type From<DB, TE> = DrainOuterGeneric<{
  type FromTables (line 44) | type FromTables<DB, TB extends keyof DB, TE> = DrainOuterGeneric<
  type ExtractTableAlias (line 48) | type ExtractTableAlias<DB, TE> = TE extends `${string} as ${infer TA}`
  type ExtractAliasFromTableExpression (line 56) | type ExtractAliasFromTableExpression<DB, TE> = TE extends string
  type ExtractRowTypeFromTableExpression (line 70) | type ExtractRowTypeFromTableExpression<
  function parseTableExpressionOrList (line 100) | function parseTableExpressionOrList(
  function parseTableExpression (line 110) | function parseTableExpression(
  function parseAliasedTable (line 122) | function parseAliasedTable(from: string): TableNode | AliasNode {
  function parseTable (line 134) | function parseTable(from: string): TableNode {
  function trim (line 146) | function trim(str: string): string {

FILE: src/parser/top-parser.ts
  function parseTop (line 4) | function parseTop(
  function isTopModifiers (line 19) | function isTopModifiers(modifiers: string): modifiers is TopModifier {

FILE: src/parser/tuple-parser.ts
  type RefTuple2 (line 5) | type RefTuple2<DB, TB extends keyof DB, R1, R2> = DrainOuterGeneric<
  type RefTuple3 (line 12) | type RefTuple3<DB, TB extends keyof DB, R1, R2, R3> = DrainOuterGeneric<
  type RefTuple4 (line 20) | type RefTuple4<
  type RefTuple5 (line 36) | type RefTuple5<
  type ValTuple2 (line 54) | type ValTuple2<V1, V2> = DrainOuterGeneric<
  type ValTuple3 (line 58) | type ValTuple3<V1, V2, V3> = DrainOuterGeneric<
  type ValTuple4 (line 66) | type ValTuple4<V1, V2, V3, V4> = DrainOuterGeneric<
  type ValTuple5 (line 75) | type ValTuple5<V1, V2, V3, V4, V5> = DrainOuterGeneric<

FILE: src/parser/unary-operation-parser.ts
  type ExistsExpression (line 12) | type ExistsExpression<DB, TB extends keyof DB> = ExpressionOrFactory<
  function parseExists (line 18) | function parseExists(
  function parseNotExists (line 24) | function parseNotExists(
  function parseUnaryOperation (line 30) | function parseUnaryOperation(

FILE: src/parser/update-parser.ts
  type UpdateTable (line 11) | type UpdateTable<DB, TE extends TableExpressionOrList<DB, never>> = [

FILE: src/parser/update-set-parser.ts
  type UpdateObject (line 17) | type UpdateObject<
  type UpdateObjectFactory (line 29) | type UpdateObjectFactory<
  type UpdateObjectExpression (line 35) | type UpdateObjectExpression<
  type ExtractUpdateTypeFromReferenceExpression (line 41) | type ExtractUpdateTypeFromReferenceExpression<
  function parseUpdate (line 48) | function parseUpdate(
  function parseUpdateObjectExpression (line 65) | function parseUpdateObjectExpression(

FILE: src/parser/value-parser.ts
  type ValueExpression (line 19) | type ValueExpression<DB, TB extends keyof DB, V> =
  type ValueExpressionOrList (line 23) | type ValueExpressionOrList<DB, TB extends keyof DB, V> =
  type ExtractTypeFromValueExpressionOrList (line 27) | type ExtractTypeFromValueExpressionOrList<VE> =
  type ExtractTypeFromValueExpression (line 32) | type ExtractTypeFromValueExpression<VE> =
  function parseValueExpressionOrList (line 39) | function parseValueExpressionOrList(
  function parseValueExpression (line 49) | function parseValueExpression(
  function isSafeImmediateValue (line 59) | function isSafeImmediateValue(
  function parseSafeImmediateValue (line 65) | function parseSafeImmediateValue(
  function parseValueExpressionList (line 75) | function parseValueExpressionList(

FILE: src/parser/with-parser.ts
  type CommonTableExpression (line 17) | type CommonTableExpression<DB, CN extends string> = (
  type RecursiveCommonTableExpression (line 21) | type RecursiveCommonTableExpression<DB, CN extends string> = (
  type QueryCreatorWithCommonTableExpression (line 30) | type QueryCreatorWithCommonTableExpression<
  type CommonTableExpressionOutput (line 40) | type CommonTableExpressionOutput<DB, CN extends string> =
  type ExtractRowFromCommonTableExpression (line 57) | type ExtractRowFromCommonTableExpression<CTE> = CTE extends (
  type ExtractTableFromCommonTableExpressionName (line 74) | type ExtractTableFromCommonTableExpressionName<CN extends string> =
  type ExtractRowFromCommonTableExpressionName (line 86) | type ExtractRowFromCommonTableExpressionName<CN extends string> =
  type ExtractColumnNamesFromColumnList (line 94) | type ExtractColumnNamesFromColumnList<R extends string> =
  function parseCommonTableExpression (line 99) | function parseCommonTableExpression(
  function cteBuilderFactory (line 117) | function cteBuilderFactory(expressionNode: OperationNode) {
  function parseCommonTableExpressionName (line 128) | function parseCommonTableExpressionName(

FILE: src/plugin/camel-case/camel-case-plugin.ts
  type CamelCasePluginOptions (line 17) | interface CamelCasePluginOptions {
  class CamelCasePlugin (line 121) | class CamelCasePlugin implements KyselyPlugin {
    method constructor (line 126) | constructor(readonly opt: CamelCasePluginOptions = {}) {
    method transformQuery (line 135) | transformQuery(args: PluginTransformQueryArgs): RootOperationNode {
    method transformResult (line 139) | async transformResult(
    method mapRow (line 152) | protected mapRow(row: UnknownRow): UnknownRow {
    method snakeCase (line 167) | protected snakeCase(str: string): string {
    method camelCase (line 171) | protected camelCase(str: string): string {
  function canMap (line 176) | function canMap(

FILE: src/plugin/camel-case/camel-case-transformer.ts
  class SnakeCaseTransformer (line 6) | class SnakeCaseTransformer extends OperationNodeTransformer {
    method constructor (line 9) | constructor(snakeCase: StringMapper) {
    method transformIdentifier (line 14) | protected override transformIdentifier(

FILE: src/plugin/camel-case/camel-case.ts
  type StringMapper (line 1) | type StringMapper = (str: string) => string
  function createSnakeCaseMapper (line 6) | function createSnakeCaseMapper({
  function createCamelCaseMapper (line 74) | function createCamelCaseMapper({
  function isAllUpperCaseSnakeCase (line 108) | function isAllUpperCaseSnakeCase(str: string): boolean {
  function isDigit (line 120) | function isDigit(char: string): boolean {
  function memoize (line 124) | function memoize(func: StringMapper): StringMapper {

FILE: src/plugin/deduplicate-joins/deduplicate-joins-plugin.ts
  class DeduplicateJoinsPlugin (line 16) | class DeduplicateJoinsPlugin implements KyselyPlugin {
    method transformQuery (line 19) | transformQuery(args: PluginTransformQueryArgs): RootOperationNode {
    method transformResult (line 23) | transformResult(

FILE: src/plugin/deduplicate-joins/deduplicate-joins-transformer.ts
  class DeduplicateJoinsTransformer (line 9) | class DeduplicateJoinsTransformer extends OperationNodeTransformer {
    method transformSelectQuery (line 10) | protected transformSelectQuery(
    method transformUpdateQuery (line 17) | protected transformUpdateQuery(
    method transformDeleteQuery (line 24) | protected transformDeleteQuery(
    method #transformQuery (line 31) | #transformQuery<
    method #deduplicateJoins (line 44) | #deduplicateJoins(joins: ReadonlyArray<JoinNode>): ReadonlyArray<JoinN...

FILE: src/plugin/handle-empty-in-lists/handle-empty-in-lists-plugin.ts
  class HandleEmptyInListsPlugin (line 155) | class HandleEmptyInListsPlugin implements KyselyPlugin {
    method constructor (line 158) | constructor(readonly opt: HandleEmptyInListsOptions) {
    method transformQuery (line 162) | transformQuery(args: PluginTransformQueryArgs): RootOperationNode {
    method transformResult (line 166) | async transformResult(

FILE: src/plugin/handle-empty-in-lists/handle-empty-in-lists-transformer.ts
  class HandleEmptyInListsTransformer (line 11) | class HandleEmptyInListsTransformer extends OperationNodeTransformer {
    method constructor (line 14) | constructor(strategy: EmptyInListsStrategy) {
    method transformBinaryOperation (line 19) | protected transformBinaryOperation(
    method #isEmptyInListNode (line 29) | #isEmptyInListNode(node: BinaryOperationNode): node is EmptyInListNode {

FILE: src/plugin/handle-empty-in-lists/handle-empty-in-lists.ts
  type HandleEmptyInListsOptions (line 11) | interface HandleEmptyInListsOptions {
  type EmptyInListNode (line 20) | type EmptyInListNode = BinaryOperationNode & {
  type EmptyInListsStrategy (line 29) | type EmptyInListsStrategy = (
  function replaceWithNoncontingentExpression (line 45) | function replaceWithNoncontingentExpression(
  function pushValueIntoList (line 78) | function pushValueIntoList(

FILE: src/plugin/immediate-value/immediate-value-plugin.ts
  class ImmediateValuePlugin (line 19) | class ImmediateValuePlugin implements KyselyPlugin {
    method transformQuery (line 22) | transformQuery(args: PluginTransformQueryArgs): RootOperationNode {
    method transformResult (line 26) | transformResult(

FILE: src/plugin/immediate-value/immediate-value-transformer.ts
  class ImmediateValueTransformer (line 14) | class ImmediateValueTransformer extends OperationNodeTransformer {
    method transformPrimitiveValueList (line 15) | override transformPrimitiveValueList(
    method transformValue (line 23) | override transformValue(node: ValueNode): ValueNode {

FILE: src/plugin/kysely-plugin.ts
  type KyselyPlugin (line 6) | interface KyselyPlugin {
  type PluginTransformQueryArgs (line 70) | interface PluginTransformQueryArgs {
  type PluginTransformResultArgs (line 75) | interface PluginTransformResultArgs {

FILE: src/plugin/noop-plugin.ts
  class NoopPlugin (line 10) | class NoopPlugin implements KyselyPlugin {
    method transformQuery (line 11) | transformQuery(args: PluginTransformQueryArgs): RootOperationNode {
    method transformResult (line 15) | async transformResult(

FILE: src/plugin/parse-json-results/parse-json-results-plugin.ts
  type ParseJSONResultsPluginOptions (line 11) | interface ParseJSONResultsPluginOptions {
  type ObjectStrategy (line 25) | type ObjectStrategy = 'in-place' | 'create'
  class ParseJSONResultsPlugin (line 71) | class ParseJSONResultsPlugin implements KyselyPlugin {
    method constructor (line 74) | constructor(readonly opt: ParseJSONResultsPluginOptions = {}) {
    method transformQuery (line 79) | transformQuery(args: PluginTransformQueryArgs): RootOperationNode {
    method transformResult (line 83) | async transformResult(
  function parseArray (line 93) | function parseArray<T>(arr: T[], objectStrategy: ObjectStrategy): T[] {
  function parse (line 103) | function parse(obj: unknown, objectStrategy: ObjectStrategy): unknown {
  function parseString (line 119) | function parseString(str: string): unknown {
  function maybeJson (line 131) | function maybeJson(value: string): boolean {
  function parseObject (line 135) | function parseObject(

FILE: src/plugin/with-schema/with-schema-plugin.ts
  class WithSchemaPlugin (line 11) | class WithSchemaPlugin implements KyselyPlugin {
    method constructor (line 14) | constructor(schema: string) {
    method transformQuery (line 18) | transformQuery(args: PluginTransformQueryArgs): RootOperationNode {
    method transformResult (line 22) | async transformResult(

FILE: src/plugin/with-schema/with-schema-transformer.ts
  constant ROOT_OPERATION_NODES (line 24) | const ROOT_OPERATION_NODES: Record<RootOperationNode['kind'], true> = fr...
  constant SCHEMALESS_FUNCTIONS (line 45) | const SCHEMALESS_FUNCTIONS: Record<string, true> = {
  class WithSchemaTransformer (line 50) | class WithSchemaTransformer extends OperationNodeTransformer {
    method constructor (line 55) | constructor(schema: string) {
    method transformNodeImpl (line 60) | protected override transformNodeImpl<T extends OperationNode>(
    method transformSchemableIdentifier (line 93) | protected override transformSchemableIdentifier(
    method transformReferences (line 109) | protected override transformReferences(
    method transformAggregateFunction (line 128) | protected override transformAggregateFunction(
    method transformFunction (line 142) | protected override transformFunction(
    method transformSelectModifier (line 156) | protected override transformSelectModifier(
    method #transformTableArgsWithoutSchemas (line 173) | #transformTableArgsWithoutSchemas<
    method #isRootOperationNode (line 191) | #isRootOperationNode(node: OperationNode): node is RootOperationNode {
    method #collectSchemableIds (line 195) | #collectSchemableIds(node: RootOperationNode): Set<string> {
    method #collectCTEs (line 233) | #collectCTEs(node: RootOperationNode): Set<string> {
    method #collectSchemableIdsFromTableExpr (line 243) | #collectSchemableIdsFromTableExpr(
    method #collectSchemableId (line 270) | #collectSchemableId(
    method #collectCTEIds (line 281) | #collectCTEIds(node: WithNode, ctes: Set<string>): void {

FILE: src/query-builder/aggregate-function-builder.ts
  class AggregateFunctionBuilder (line 30) | class AggregateFunctionBuilder<DB, TB extends keyof DB, O = unknown>
    method constructor (line 35) | constructor(props: AggregateFunctionBuilderProps) {
    method expressionType (line 40) | get expressionType(): O | undefined {
    method as (line 69) | as<A extends string>(
    method distinct (line 96) | distinct(): AggregateFunctionBuilder<DB, TB, O> {
    method orderBy (line 160) | orderBy(...args: any[]): any {
    method clearOrderBy (line 170) | clearOrderBy(): AggregateFunctionBuilder<DB, TB, O> {
    method withinGroupOrderBy (line 239) | withinGroupOrderBy(...args: any[]): any {
    method filterWhere (line 304) | filterWhere(...args: any[]): any {
    method filterWhereRef (line 346) | filterWhereRef<
    method over (line 405) | over(
    method $call (line 423) | $call<T>(func: (qb: this) => T): T {
    method $castTo (line 433) | $castTo<C>(): AggregateFunctionBuilder<DB, TB, C> {
    method $notNull (line 446) | $notNull(): AggregateFunctionBuilder<DB, TB, Exclude<O, null>> {
    method toOperationNode (line 450) | toOperationNode(): AggregateFunctionNode {
  class AliasedAggregateFunctionBuilder (line 458) | class AliasedAggregateFunctionBuilder<
    method constructor (line 467) | constructor(
    method expression (line 476) | get expression(): Expression<O> {
    method alias (line 481) | get alias(): A {
    method toOperationNode (line 485) | toOperationNode(): AliasNode {
  type AggregateFunctionBuilderProps (line 493) | interface AggregateFunctionBuilderProps {
  type OverBuilderCallback (line 497) | type OverBuilderCallback<DB, TB extends keyof DB> = (

FILE: src/query-builder/case-builder.ts
  class CaseBuilder (line 20) | class CaseBuilder<
    method constructor (line 28) | constructor(props: CaseBuilderProps) {
    method when (line 51) | when(...args: any[]): any {
  type CaseBuilderProps (line 62) | interface CaseBuilderProps {
  class CaseThenBuilder (line 66) | class CaseThenBuilder<DB, TB extends keyof DB, W, O> {
    method constructor (line 69) | constructor(props: CaseBuilderProps) {
    method then (line 93) | then(valueExpression: any): any {
  class CaseWhenBuilder (line 106) | class CaseWhenBuilder<DB, TB extends keyof DB, W, O>
    method constructor (line 111) | constructor(props: CaseBuilderProps) {
    method when (line 134) | when(...args: any[]): any {
    method else (line 163) | else(valueExpression: any): any {
    method end (line 174) | end(): ExpressionWrapper<DB, TB, O | null> {
    method endCase (line 180) | endCase(): ExpressionWrapper<DB, TB, O | null> {
  class CaseEndBuilder (line 187) | class CaseEndBuilder<DB, TB extends keyof DB, O> implements Endable<
    method constructor (line 194) | constructor(props: CaseBuilderProps) {
    method end (line 198) | end(): ExpressionWrapper<DB, TB, O> {
    method endCase (line 204) | endCase(): ExpressionWrapper<DB, TB, O> {
  type Whenable (line 211) | interface Whenable<DB, TB extends keyof DB, W, O> {
  type Endable (line 237) | interface Endable<DB, TB extends keyof DB, O> {

FILE: src/query-builder/cte-builder.ts
  class CTEBuilder (line 5) | class CTEBuilder<N extends string> implements OperationNodeSource {
    method constructor (line 8) | constructor(props: CTEBuilderProps) {
    method materialized (line 15) | materialized(): CTEBuilder<N> {
    method notMaterialized (line 27) | notMaterialized(): CTEBuilder<N> {
    method toOperationNode (line 36) | toOperationNode(): CommonTableExpressionNode {
  type CTEBuilderProps (line 41) | interface CTEBuilderProps {
  type CTEBuilderCallback (line 45) | type CTEBuilderCallback<N extends string> = (

FILE: src/query-builder/delete-query-builder.ts
  class DeleteQueryBuilder (line 85) | class DeleteQueryBuilder<DB, TB extends keyof DB, O>
    method constructor (line 98) | constructor(props: DeleteQueryBuilderProps) {
    method where (line 115) | where(...args: any[]): any {
    method whereRef (line 125) | whereRef<
    method clearWhere (line 142) | clearWhere(): DeleteQueryBuilder<DB, TB, O> {
    method top (line 188) | top(
    method using (line 283) | using(tables: TableExpressionOrList<any, any>): any {
    method innerJoin (line 413) | innerJoin(...args: any): any {
    method leftJoin (line 431) | leftJoin(...args: any): any {
    method rightJoin (line 449) | rightJoin(...args: any): any {
    method fullJoin (line 467) | fullJoin(...args: any): any {
    method #join (line 471) | #join(joinType: JoinType, args: any[]): any {
    method returning (line 493) | returning<SE extends SelectExpression<DB, TB>>(
    method returningAll (line 607) | returningAll(table?: any): any {
    method output (line 641) | output(args: any): any {
    method outputAll (line 651) | outputAll(
    method clearReturning (line 682) | clearReturning(): DeleteQueryBuilder<DB, TB, DeleteResult> {
    method clearLimit (line 709) | clearLimit(): DeleteQueryBuilder<DB, TB, O> {
    method orderBy (line 754) | orderBy(...args: any[]): any {
    method clearOrderBy (line 764) | clearOrderBy(): DeleteQueryBuilder<DB, TB, O> {
    method limit (line 795) | limit(limit: ValueExpression<DB, TB, number>): DeleteQueryBuilder<DB, ...
    method modifyEnd (line 826) | modifyEnd(modifier: Expression<any>): DeleteQueryBuilder<DB, TB, O> {
    method $call (line 860) | $call<T>(func: (qb: this) => T): T {
    method $if (line 899) | $if<O2>(
    method $castTo (line 922) | $castTo<C>(): DeleteQueryBuilder<DB, TB, C> {
    method $narrowType (line 975) | $narrowType<T>(): DeleteQueryBuilder<DB, TB, NarrowPartial<O, T>> {
    method $assertType (line 1024) | $assertType<T extends O>(): O extends T
    method withPlugin (line 1033) | withPlugin(plugin: KyselyPlugin): DeleteQueryBuilder<DB, TB, O> {
    method toOperationNode (line 1040) | toOperationNode(): DeleteQueryNode {
    method compile (line 1047) | compile(): CompiledQuery<SimplifyResult<O>> {
    method execute (line 1059) | async execute(): Promise<SimplifyResult<O>[]> {
    method executeTakeFirst (line 1081) | async executeTakeFirst(): Promise<SimplifySingleResult<O>> {
    method executeTakeFirstOrThrow (line 1094) | async executeTakeFirstOrThrow(
    method stream (line 1112) | async *stream(chunkSize: number = 100): AsyncIterableIterator<O> {
    method explain (line 1122) | async explain<ER extends Record<string, any> = Record<string, any>>(
  type DeleteQueryBuilderProps (line 1139) | interface DeleteQueryBuilderProps {
  type DeleteQueryBuilderWithInnerJoin (line 1145) | type DeleteQueryBuilderWithInnerJoin<
  type InnerJoinedBuilder (line 1162) | type InnerJoinedBuilder<
  type InnerJoinedDB (line 1173) | type InnerJoinedDB<DB, A extends string, R> = DrainOuterGeneric<{
  type DeleteQueryBuilderWithLeftJoin (line 1177) | type DeleteQueryBuilderWithLeftJoin<
  type LeftJoinedBuilder (line 1194) | type LeftJoinedBuilder<
  type LeftJoinedDB (line 1205) | type LeftJoinedDB<DB, A extends keyof any, R> = DrainOuterGeneric<{
  type DeleteQueryBuilderWithRightJoin (line 1213) | type DeleteQueryBuilderWithRightJoin<
  type RightJoinedBuilder (line 1230) | type RightJoinedBuilder<
  type RightJoinedDB (line 1238) | type RightJoinedDB<
  type DeleteQueryBuilderWithFullJoin (line 1253) | type DeleteQueryBuilderWithFullJoin<
  type OuterJoinedBuilder (line 1270) | type OuterJoinedBuilder<
  type OuterJoinedBuilderDB (line 1278) | type OuterJoinedBuilderDB<

FILE: src/query-builder/delete-result.ts
  class DeleteResult (line 1) | class DeleteResult {
    method constructor (line 4) | constructor(numDeletedRows: bigint) {

FILE: src/query-builder/function-module.ts
  type FunctionModule (line 105) | interface FunctionModule<DB, TB extends keyof DB> {
  function createFunctionModule (line 774) | function createFunctionModule<DB, TB extends keyof DB>(): FunctionModule<

FILE: src/query-builder/having-interface.ts
  type HavingInterface (line 9) | interface HavingInterface<DB, TB extends keyof DB> {

FILE: src/query-builder/insert-query-builder.ts
  class InsertQueryBuilder (line 71) | class InsertQueryBuilder<DB, TB extends keyof DB, O>
    method constructor (line 82) | constructor(props: InsertQueryBuilderProps) {
    method values (line 263) | values(insert: InsertExpression<DB, TB>): InsertQueryBuilder<DB, TB, O> {
    method columns (line 298) | columns(
    method expression (line 341) | expression(
    method defaultValues (line 369) | defaultValues(): InsertQueryBuilder<DB, TB, O> {
    method modifyEnd (line 403) | modifyEnd(modifier: Expression<any>): InsertQueryBuilder<DB, TB, O> {
    method ignore (line 453) | ignore(): InsertQueryBuilder<DB, TB, O> {
    method orIgnore (line 497) | orIgnore(): InsertQueryBuilder<DB, TB, O> {
    method orAbort (line 532) | orAbort(): InsertQueryBuilder<DB, TB, O> {
    method orFail (line 567) | orFail(): InsertQueryBuilder<DB, TB, O> {
    method orReplace (line 604) | orReplace(): InsertQueryBuilder<DB, TB, O> {
    method orRollback (line 639) | orRollback(): InsertQueryBuilder<DB, TB, O> {
    method top (line 695) | top(
    method onConflict (line 881) | onConflict(
    method onDuplicateKeyUpdate (line 935) | onDuplicateKeyUpdate(
    method returning (line 960) | returning<SE extends SelectExpression<DB, TB>>(
    method returningAll (line 972) | returningAll(): InsertQueryBuilder<DB, TB, Selectable<DB[TB]>> {
    method output (line 1006) | output(args: any): any {
    method outputAll (line 1016) | outputAll(
    method clearReturning (line 1047) | clearReturning(): InsertQueryBuilder<DB, TB, InsertResult> {
    method $call (line 1079) | $call<T>(func: (qb: this) => T): T {
    method $if (line 1120) | $if<O2>(
    method $castTo (line 1143) | $castTo<C>(): InsertQueryBuilder<DB, TB, C> {
    method $narrowType (line 1205) | $narrowType<T>(): InsertQueryBuilder<DB, TB, NarrowPartial<O, T>> {
    method $assertType (line 1257) | $assertType<T extends O>(): O extends T
    method withPlugin (line 1266) | withPlugin(plugin: KyselyPlugin): InsertQueryBuilder<DB, TB, O> {
    method toOperationNode (line 1273) | toOperationNode(): InsertQueryNode {
    method compile (line 1280) | compile(): CompiledQuery<O> {
    method execute (line 1292) | async execute(): Promise<SimplifyResult<O>[]> {
    method executeTakeFirst (line 1319) | async executeTakeFirst(): Promise<SimplifySingleResult<O>> {
    method executeTakeFirstOrThrow (line 1332) | async executeTakeFirstOrThrow(
    method stream (line 1350) | async *stream(chunkSize: number = 100): AsyncIterableIterator<O> {
    method explain (line 1360) | async explain<ER extends Record<string, any> = Record<string, any>>(
  type InsertQueryBuilderProps (line 1377) | interface InsertQueryBuilderProps {

FILE: src/query-builder/insert-result.ts
  class InsertResult (line 29) | class InsertResult {
    method constructor (line 47) | constructor(

FILE: src/query-builder/join-builder.ts
  class JoinBuilder (line 15) | class JoinBuilder<
    method constructor (line 21) | constructor(props: JoinBuilderProps) {
    method on (line 39) | on(...args: any[]): JoinBuilder<DB, TB> {
    method onRef (line 55) | onRef(
    method onTrue (line 72) | onTrue(): JoinBuilder<DB, TB> {
    method $call (line 86) | $call<T>(func: (qb: this) => T): T {
    method toOperationNode (line 90) | toOperationNode(): JoinNode {
  type JoinBuilderProps (line 95) | interface JoinBuilderProps {

FILE: src/query-builder/json-path-builder.ts
  class JSONPathBuilder (line 19) | class JSONPathBuilder<S, O = S> {
    method constructor (line 22) | constructor(node: JSONReferenceNode | JSONPathNode) {
    method at (line 93) | at<
    method key (line 151) | key<
    method #createBuilderWithPathLeg (line 169) | #createBuilderWithPathLeg(
  class TraversedJSONPathBuilder (line 199) | class TraversedJSONPathBuilder<S, O>
    method constructor (line 205) | constructor(node: JSONReferenceNode | JSONPathNode) {
    method expressionType (line 211) | get expressionType(): O | undefined {
    method as (line 242) | as(alias: string | Expression<any>): AliasedExpression<O, string> {
    method $castTo (line 252) | $castTo<O2>(): TraversedJSONPathBuilder<S, O2> {
    method $notNull (line 256) | $notNull(): TraversedJSONPathBuilder<S, Exclude<O, null>> {
    method toOperationNode (line 260) | toOperationNode(): OperationNode {
  class AliasedJSONPathBuilder (line 265) | class AliasedJSONPathBuilder<
    method constructor (line 272) | constructor(
    method expression (line 281) | get expression(): Expression<O> {
    method alias (line 286) | get alias(): A | Expression<unknown> {
    method toOperationNode (line 290) | toOperationNode(): AliasNode {

FILE: src/query-builder/merge-query-builder.ts
  class MergeQueryBuilder (line 73) | class MergeQueryBuilder<DB, TT extends keyof DB, O>
    method constructor (line 78) | constructor(props: MergeQueryBuilderProps) {
    method modifyEnd (line 105) | modifyEnd(modifier: Expression<any>): MergeQueryBuilder<DB, TT, O> {
    method top (line 162) | top(
    method using (line 218) | using(...args: any): any {
    method returning (line 240) | returning(args: any): any {
    method returningAll (line 256) | returningAll(table?: any): any {
    method output (line 290) | output(args: any): any {
    method outputAll (line 300) | outputAll(
  type MergeQueryBuilderProps (line 313) | interface MergeQueryBuilderProps {
  class WheneableMergeQueryBuilder (line 319) | class WheneableMergeQueryBuilder<
    method constructor (line 333) | constructor(props: MergeQueryBuilderProps) {
    method modifyEnd (line 360) | modifyEnd(
    method top (line 375) | top(
    method whenMatched (line 416) | whenMatched(): MatchedThenableMergeQueryBuilder<DB, TT, ST, TT | ST, O> {
    method whenMatchedAnd (line 460) | whenMatchedAnd(
    method whenMatchedAndRef (line 473) | whenMatchedAndRef<
    method #whenMatched (line 484) | #whenMatched(
    method whenNotMatched (line 528) | whenNotMatched(): NotMatchedThenableMergeQueryBuilder<DB, TT, ST, O> {
    method whenNotMatchedAnd (line 577) | whenNotMatchedAnd(
    method whenNotMatchedAndRef (line 592) | whenNotMatchedAndRef<
    method whenNotMatchedBySource (line 610) | whenNotMatchedBySource(): MatchedThenableMergeQueryBuilder<
    method whenNotMatchedBySourceAnd (line 640) | whenNotMatchedBySourceAnd(
    method whenNotMatchedBySourceAndRef (line 652) | whenNotMatchedBySourceAndRef<
    method returning (line 680) | returning(args: any): any {
    method returningAll (line 701) | returningAll(table?: any): any {
    method output (line 738) | output(args: any): any {
    method outputAll (line 748) | outputAll(
    method #whenNotMatched (line 760) | #whenNotMatched(
    method $call (line 805) | $call<T>(func: (qb: this) => T): T {
    method $if (line 847) | $if<O2>(
    method toOperationNode (line 864) | toOperationNode(): MergeQueryNode {
    method compile (line 871) | compile(): CompiledQuery<O> {
    method execute (line 883) | async execute(): Promise<SimplifyResult<O>[]> {
    method executeTakeFirst (line 905) | async executeTakeFirst(): Promise<SimplifySingleResult<O>> {
    method executeTakeFirstOrThrow (line 918) | async executeTakeFirstOrThrow(
  class MatchedThenableMergeQueryBuilder (line 937) | class MatchedThenableMergeQueryBuilder<
    method constructor (line 946) | constructor(props: MergeQueryBuilderProps) {
    method thenDelete (line 976) | thenDelete(): WheneableMergeQueryBuilder<DB, TT, ST, O> {
    method thenDoNothing (line 1014) | thenDoNothing(): WheneableMergeQueryBuilder<DB, TT, ST, O> {
    method thenUpdate (line 1060) | thenUpdate<QB extends UpdateQueryBuilder<DB, TT, UT, never>>(
    method thenUpdateSet (line 1127) | thenUpdateSet(...args: any[]): any {
  class NotMatchedThenableMergeQueryBuilder (line 1133) | class NotMatchedThenableMergeQueryBuilder<
    method constructor (line 1141) | constructor(props: MergeQueryBuilderProps) {
    method thenDoNothing (line 1171) | thenDoNothing(): WheneableMergeQueryBuilder<DB, TT, ST, O> {
    method thenInsertValues (line 1219) | thenInsertValues<IE extends InsertExpression<DB, TT, ST>>(
  type ExtractWheneableMergeQueryBuilder (line 1239) | type ExtractWheneableMergeQueryBuilder<
  type UsingBuilder (line 1256) | type UsingBuilder<

FILE: src/query-builder/merge-result.ts
  class MergeResult (line 1) | class MergeResult {
    method constructor (line 4) | constructor(numChangedRows: bigint | undefined) {

FILE: src/query-builder/no-result-error.ts
  type NoResultErrorConstructor (line 3) | type NoResultErrorConstructor = new (node: QueryNode) => Error
  class NoResultError (line 5) | class NoResultError extends Error {
    method constructor (line 11) | constructor(node: QueryNode) {
  function isNoResultErrorConstructor (line 17) | function isNoResultErrorConstructor(

FILE: src/query-builder/on-conflict-builder.ts
  class OnConflictBuilder (line 23) | class OnConflictBuilder<
    method constructor (line 29) | constructor(props: OnConflictBuilderProps) {
    method column (line 39) | column(column: AnyColumn<DB, TB>): OnConflictBuilder<DB, TB> {
    method columns (line 58) | columns(
    method constraint (line 79) | constraint(constraintName: string): OnConflictBuilder<DB, TB> {
    method expression (line 96) | expression(expression: Expression<any>): OnConflictBuilder<DB, TB> {
    method where (line 118) | where(...args: any[]): OnConflictBuilder<DB, TB> {
    method whereRef (line 128) | whereRef<
    method clearWhere (line 145) | clearWhere(): OnConflictBuilder<DB, TB> {
    method doNothing (line 181) | doNothing(): OnConflictDoNothingBuilder<DB, TB> {
    method doUpdateSet (line 251) | doUpdateSet(
    method $call (line 270) | $call<T>(func: (qb: this) => T): T {
  type OnConflictBuilderProps (line 275) | interface OnConflictBuilderProps {
  type OnConflictDatabase (line 279) | type OnConflictDatabase<DB, TB extends keyof DB> = {
  type OnConflictTables (line 283) | type OnConflictTables<TB> = TB | 'excluded'
  class OnConflictDoNothingBuilder (line 285) | class OnConflictDoNothingBuilder<
    method constructor (line 291) | constructor(props: OnConflictBuilderProps) {
    method toOperationNode (line 295) | toOperationNode(): OnConflictNode {
  class OnConflictUpdateBuilder (line 300) | class OnConflictUpdateBuilder<DB, TB extends keyof DB>
    method constructor (line 305) | constructor(props: OnConflictBuilderProps) {
    method where (line 327) | where(...args: any[]): OnConflictUpdateBuilder<DB, TB> {
    method whereRef (line 342) | whereRef<
    method clearWhere (line 359) | clearWhere(): OnConflictUpdateBuilder<DB, TB> {
    method $call (line 372) | $call<T>(func: (qb: this) => T): T {
    method toOperationNode (line 376) | toOperationNode(): OnConflictNode {

FILE: src/query-builder/order-by-interface.ts
  type OrderByInterface (line 8) | interface OrderByInterface<DB, TB extends keyof DB, O> {

FILE: src/query-builder/order-by-item-builder.ts
  class OrderByItemBuilder (line 8) | class OrderByItemBuilder implements OperationNodeSource {
    method constructor (line 11) | constructor(props: OrderByItemBuilderProps) {
    method desc (line 20) | desc(): OrderByItemBuilder {
    method asc (line 33) | asc(): OrderByItemBuilder {
    method nullsLast (line 48) | nullsLast(): OrderByItemBuilder {
    method nullsFirst (line 61) | nullsFirst(): OrderByItemBuilder {
    method collate (line 70) | collate(collation: Collation): OrderByItemBuilder {
    method toOperationNode (line 78) | toOperationNode(): OrderByItemNode {
  type OrderByItemBuilderProps (line 83) | interface OrderByItemBuilderProps {

FILE: src/query-builder/output-interface.ts
  type OutputInterface (line 12) | interface OutputInterface<
  type OutputPrefix (line 168) | type OutputPrefix = 'deleted' | 'inserted'
  type OutputDatabase (line 170) | type OutputDatabase<
  type OutputExpression (line 178) | type OutputExpression<
  type OutputCallback (line 189) | type OutputCallback<
  type SelectExpressionFromOutputExpression (line 197) | type SelectExpressionFromOutputExpression<OE> =
  type SelectExpressionFromOutputCallback (line 200) | type SelectExpressionFromOutputCallback<CB> = CB extends (

FILE: src/query-builder/over-builder.ts
  class OverBuilder (line 19) | class OverBuilder<DB, TB extends keyof DB>
    method constructor (line 24) | constructor(props: OverBuilderProps) {
    method orderBy (line 81) | orderBy(...args: any[]): any {
    method clearOrderBy (line 90) | clearOrderBy(): OverBuilder<DB, TB> {
    method partitionBy (line 125) | partitionBy(partitionBy: PartitionByExpressionOrList<DB, TB>): any {
    method $call (line 138) | $call<T>(func: (qb: this) => T): T {
    method toOperationNode (line 142) | toOperationNode(): OverNode {
  type OverBuilderProps (line 147) | interface OverBuilderProps {

FILE: src/query-builder/returning-interface.ts
  type ReturningInterface (line 12) | interface ReturningInterface<DB, TB extends keyof DB, O> {
  type MultiTableReturningInterface (line 93) | interface MultiTableReturningInterface<

FILE: src/query-builder/select-query-builder-expression.ts
  type SelectQueryBuilderExpression (line 4) | interface SelectQueryBuilderExpression<

FILE: src/query-builder/select-query-builder.ts
  type SelectQueryBuilder (line 87) | interface SelectQueryBuilder<DB, TB extends keyof DB, O>
  class SelectQueryBuilderImpl (line 2154) | class SelectQueryBuilderImpl<
    method constructor (line 2161) | constructor(props: SelectQueryBuilderProps) {
    method expressionType (line 2165) | get expressionType(): O | undefined {
    method isSelectQueryBuilder (line 2169) | get isSelectQueryBuilder(): true {
    method where (line 2173) | where(...args: any[]): any {
    method whereRef (line 2183) | whereRef(
    method having (line 2197) | having(...args: any[]): any {
    method havingRef (line 2207) | havingRef(
    method select (line 2221) | select<SE extends SelectExpression<DB, TB>>(
    method distinctOn (line 2233) | distinctOn(selection: ReferenceExpressionOrList<DB, TB>): any {
    method modifyFront (line 2243) | modifyFront(modifier: Expression<any>): SelectQueryBuilder<DB, TB, O> {
    method modifyEnd (line 2253) | modifyEnd(modifier: Expression<any>): SelectQueryBuilder<DB, TB, O> {
    method distinct (line 2263) | distinct(): SelectQueryBuilder<DB, TB, O> {
    method forUpdate (line 2273) | forUpdate(of?: TableOrList<TB>): SelectQueryBuilder<DB, TB, O> {
    method forShare (line 2286) | forShare(of?: TableOrList<TB>): SelectQueryBuilder<DB, TB, O> {
    method forKeyShare (line 2299) | forKeyShare(of?: TableOrList<TB>): SelectQueryBuilder<DB, TB, O> {
    method forNoKeyUpdate (line 2312) | forNoKeyUpdate(of?: TableOrList<TB>): SelectQueryBuilder<DB, TB, O> {
    method skipLocked (line 2325) | skipLocked(): SelectQueryBuilder<DB, TB, O> {
    method noWait (line 2335) | noWait(): SelectQueryBuilder<DB, TB, O> {
    method selectAll (line 2345) | selectAll(table?: any): any {
    method innerJoin (line 2355) | innerJoin(...args: any): any {
    method leftJoin (line 2359) | leftJoin(...args: any): any {
    method rightJoin (line 2363) | rightJoin(...args: any): any {
    method fullJoin (line 2367) | fullJoin(...args: any): any {
    method crossJoin (line 2371) | crossJoin(...args: any): any {
    method innerJoinLateral (line 2375) | innerJoinLateral(...args: any): any {
    method leftJoinLateral (line 2379) | leftJoinLateral(...args: any): any {
    method crossJoinLateral (line 2383) | crossJoinLateral(...args: any): any {
    method crossApply (line 2387) | crossApply(...args: any): any {
    method outerApply (line 2391) | outerApply(...args: any[]): any {
    method #join (line 2395) | #join(joinType: JoinType, args: any[]): any {
    method orderBy (line 2405) | orderBy(...args: any[]): SelectQueryBuilder<DB, TB, O> {
    method groupBy (line 2415) | groupBy(groupBy: GroupByArg<DB, TB, O>): SelectQueryBuilder<DB, TB, O> {
    method limit (line 2425) | limit(
    method offset (line 2437) | offset(
    method fetch (line 2449) | fetch(
    method top (line 2462) | top(
    method union (line 2475) | union(
    method unionAll (line 2487) | unionAll(
    method intersect (line 2499) | intersect(
    method intersectAll (line 2511) | intersectAll(
    method except (line 2523) | except(
    method exceptAll (line 2535) | exceptAll(
    method as (line 2547) | as<A extends string>(alias: A): AliasedSelectQueryBuilder<O, A> {
    method clearSelect (line 2551) | clearSelect(): SelectQueryBuilder<DB, TB, {}> {
    method clearWhere (line 2558) | clearWhere(): SelectQueryBuilder<DB, TB, O> {
    method clearLimit (line 2565) | clearLimit(): SelectQueryBuilder<DB, TB, O> {
    method clearOffset (line 2572) | clearOffset(): SelectQueryBuilder<DB, TB, O> {
    method clearOrderBy (line 2579) | clearOrderBy(): SelectQueryBuilder<DB, TB, O> {
    method clearGroupBy (line 2586) | clearGroupBy(): SelectQueryBuilder<DB, TB, O> {
    method $call (line 2593) | $call<T>(func: (qb: this) => T): T {
    method $if (line 2597) | $if<O2>(
    method $castTo (line 2610) | $castTo<C>(): SelectQueryBuilder<DB, TB, C> {
    method $narrowType (line 2614) | $narrowType<T>(): SelectQueryBuilder<DB, TB, NarrowPartial<O, T>> {
    method $assertType (line 2618) | $assertType<T extends O>(): O extends T
    method $asTuple (line 2624) | $asTuple(): ExpressionWrapper<DB, TB, any> {
    method $asScalar (line 2628) | $asScalar(): ExpressionWrapper<DB, TB, any> {
    method withPlugin (line 2632) | withPlugin(plugin: KyselyPlugin): SelectQueryBuilder<DB, TB, O> {
    method toOperationNode (line 2639) | toOperationNode(): SelectQueryNode {
    method compile (line 2646) | compile(): CompiledQuery<Simplify<O>> {
    method execute (line 2653) | async execute(): Promise<Simplify<O>[]> {
    method executeTakeFirst (line 2661) | async executeTakeFirst(): Promise<SimplifySingleResult<O>> {
    method executeTakeFirstOrThrow (line 2666) | async executeTakeFirstOrThrow(
    method stream (line 2684) | async *stream(chunkSize: number = 100): AsyncIterableIterator<O> {
    method explain (line 2694) | async explain<ER extends Record<string, any> = Record<string, any>>(
  function createSelectQueryBuilder (line 2711) | function createSelectQueryBuilder<DB, TB extends keyof DB, O>(
  type SelectQueryBuilderProps (line 2717) | interface SelectQueryBuilderProps {
  type AliasedSelectQueryBuilder (line 2723) | interface AliasedSelectQueryBuilder<
  class AliasedSelectQueryBuilderImpl (line 2733) | class AliasedSelectQueryBuilderImpl<
    method constructor (line 2742) | constructor(queryBuilder: SelectQueryBuilder<DB, TB, O>, alias: A) {
    method expression (line 2747) | get expression(): Expression<O> {
    method alias (line 2751) | get alias(): A {
    method isAliasedSelectQueryBuilder (line 2755) | get isAliasedSelectQueryBuilder(): true {
    method toOperationNode (line 2759) | toOperationNode(): AliasNode {
  type SelectQueryBuilderWithInnerJoin (line 2767) | type SelectQueryBuilderWithInnerJoin<
  type InnerJoinedBuilder (line 2784) | type InnerJoinedBuilder<
  type InnerJoinedDB (line 2795) | type InnerJoinedDB<DB, A extends string, R> = DrainOuterGeneric<{
  type SelectQueryBuilderWithLeftJoin (line 2799) | type SelectQueryBuilderWithLeftJoin<
  type LeftJoinedBuilder (line 2816) | type LeftJoinedBuilder<
  type LeftJoinedDB (line 2827) | type LeftJoinedDB<DB, A extends keyof any, R> = DrainOuterGeneric<{
  type SelectQueryBuilderWithRightJoin (line 2835) | type SelectQueryBuilderWithRightJoin<
  type RightJoinedBuilder (line 2852) | type RightJoinedBuilder<
  type RightJoinedDB (line 2860) | type RightJoinedDB<
  type SelectQueryBuilderWithFullJoin (line 2875) | type SelectQueryBuilderWithFullJoin<
  type OuterJoinedBuilder (line 2892) | type OuterJoinedBuilder<
  type OuterJoinedBuilderDB (line 2900) | type OuterJoinedBuilderDB<
  type TableOrList (line 2915) | type TableOrList<TB extends keyof any> =

FILE: src/query-builder/update-query-builder.ts
  class UpdateQueryBuilder (line 91) | class UpdateQueryBuilder<DB, UT extends keyof DB, TB extends keyof DB, O>
    method constructor (line 104) | constructor(props: UpdateQueryBuilderProps) {
    method where (line 121) | where(...args: any[]): any {
    method whereRef (line 131) | whereRef<
    method clearWhere (line 148) | clearWhere(): UpdateQueryBuilder<DB, UT, TB, O> {
    method top (line 194) | top(
    method from (line 242) | from(from: TableExpressionOrList<any, any>): any {
    method innerJoin (line 376) | innerJoin(...args: any): any {
    method leftJoin (line 398) | leftJoin(...args: any): any {
    method rightJoin (line 420) | rightJoin(...args: any): any {
    method fullJoin (line 442) | fullJoin(...args: any): any {
    method #join (line 446) | #join(joinType: JoinType, args: any[]): any {
    method orderBy (line 494) | orderBy(...args: any[]): any {
    method clearOrderBy (line 504) | clearOrderBy(): UpdateQueryBuilder<DB, UT, TB, O> {
    method limit (line 532) | limit(
    method set (line 732) | set(
    method returning (line 758) | returning<SE extends SelectExpression<DB, TB>>(
    method returningAll (line 780) | returningAll(table?: any): any {
    method output (line 817) | output(args: any): any {
    method outputAll (line 827) | outputAll(
    method modifyEnd (line 862) | modifyEnd(modifier: Expression<any>): UpdateQueryBuilder<DB, UT, TB, O> {
    method clearReturning (line 891) | clearReturning(): UpdateQueryBuilder<DB, UT, TB, UpdateResult> {
    method $call (line 928) | $call<T>(func: (qb: this) => T): T {
    method $if (line 970) | $if<O2>(
    method $castTo (line 993) | $castTo<C>(): UpdateQueryBuilder<DB, UT, TB, C> {
    method $narrowType (line 1055) | $narrowType<T>(): UpdateQueryBuilder<DB, UT, TB, NarrowPartial<O, T>> {
    method $assertType (line 1113) | $assertType<T extends O>(): O extends T
    method withPlugin (line 1122) | withPlugin(plugin: KyselyPlugin): UpdateQueryBuilder<DB, UT, TB, O> {
    method toOperationNode (line 1129) | toOperationNode(): UpdateQueryNode {
    method compile (line 1136) | compile(): CompiledQuery<SimplifyResult<O>> {
    method execute (line 1148) | async execute(): Promise<SimplifyResult<O>[]> {
    method executeTakeFirst (line 1175) | async executeTakeFirst(): Promise<SimplifySingleResult<O>> {
    method executeTakeFirstOrThrow (line 1188) | async executeTakeFirstOrThrow(
    method stream (line 1206) | async *stream(chunkSize: number = 100): AsyncIterableIterator<O> {
    method explain (line 1216) | async explain<ER extends Record<string, any> = Record<string, any>>(
  type UpdateQueryBuilderProps (line 1233) | interface UpdateQueryBuilderProps {
  type UpdateQueryBuilderWithInnerJoin (line 1239) | type UpdateQueryBuilderWithInnerJoin<
  type InnerJoinedBuilder (line 1257) | type InnerJoinedBuilder<
  type InnerJoinedDB (line 1269) | type InnerJoinedDB<DB, A extends string, R> = DrainOuterGeneric<{
  type UpdateQueryBuilderWithLeftJoin (line 1273) | type UpdateQueryBuilderWithLeftJoin<
  type LeftJoinedBuilder (line 1291) | type LeftJoinedBuilder<
  type LeftJoinedDB (line 1303) | type LeftJoinedDB<DB, A extends keyof any, R> = DrainOuterGeneric<{
  type UpdateQueryBuilderWithRightJoin (line 1311) | type UpdateQueryBuilderWithRightJoin<
  type RightJoinedBuilder (line 1329) | type RightJoinedBuilder<
  type RightJoinedDB (line 1338) | type RightJoinedDB<
  type UpdateQueryBuilderWithFullJoin (line 1353) | type UpdateQueryBuilderWithFullJoin<
  type OuterJoinedBuilder (line 1371) | type OuterJoinedBuilder<
  type OuterJoinedBuilderDB (line 1380) | type OuterJoinedBuilderDB<

FILE: src/query-builder/update-result.ts
  class UpdateResult (line 1) | class UpdateResult {
    method constructor (line 15) | constructor(numUpdatedRows: bigint, numChangedRows: bigint | undefined) {

FILE: src/query-builder/where-interface.ts
  type WhereInterface (line 10) | interface WhereInterface<DB, TB extends keyof DB> {

FILE: src/query-compiler/compiled-query.ts
  type CompiledQuery (line 6) | interface CompiledQuery<O = unknown> {
  type CompiledQueryFactory (line 13) | type CompiledQueryFactory = Readonly<{
  method raw (line 19) | raw(sql, parameters = []) {

FILE: src/query-compiler/default-query-compiler.ts
  constant LIT_WRAP_REGEX (line 121) | const LIT_WRAP_REGEX = /'/g
  class DefaultQueryCompiler (line 123) | class DefaultQueryCompiler
    method numParameters (line 130) | protected get numParameters(): number {
    method compileQuery (line 134) | compileQuery(node: RootOperationNode, queryId: QueryId): CompiledQuery {
    method getSql (line 149) | protected getSql(): string {
    method visitSelectQuery (line 153) | protected override visitSelectQuery(node: SelectQueryNode): void {
    method visitFrom (line 258) | protected override visitFrom(node: FromNode): void {
    method visitSelection (line 263) | protected override visitSelection(node: SelectionNode): void {
    method visitColumn (line 267) | protected override visitColumn(node: ColumnNode): void {
    method compileDistinctOn (line 271) | protected compileDistinctOn(expressions: ReadonlyArray<OperationNode>)...
    method compileList (line 277) | protected compileList(
    method visitWhere (line 292) | protected override visitWhere(node: WhereNode): void {
    method visitHaving (line 297) | protected override visitHaving(node: HavingNode): void {
    method visitInsertQuery (line 302) | protected override visitInsertQuery(node: InsertQueryNode): void {
    method visitValues (line 394) | protected override visitValues(node: ValuesNode): void {
    method visitDeleteQuery (line 399) | protected override visitDeleteQuery(node: DeleteQueryNode): void {
    method visitReturning (line 473) | protected override visitReturning(node: ReturningNode): void {
    method visitAlias (line 478) | protected override visitAlias(node: AliasNode): void {
    method visitReference (line 484) | protected override visitReference(node: ReferenceNode): void {
    method visitSelectAll (line 493) | protected override visitSelectAll(_: SelectAllNode): void {
    method visitIdentifier (line 497) | protected override visitIdentifier(node: IdentifierNode): void {
    method compileUnwrappedIdentifier (line 503) | protected compileUnwrappedIdentifier(node: IdentifierNode): void {
    method visitAnd (line 513) | protected override visitAnd(node: AndNode): void {
    method visitOr (line 519) | protected override visitOr(node: OrNode): void {
    method visitValue (line 525) | protected override visitValue(node: ValueNode): void {
    method visitValueList (line 533) | protected override visitValueList(node: ValueListNode): void {
    method visitTuple (line 539) | protected override visitTuple(node: TupleNode): void {
    method visitPrimitiveValueList (line 545) | protected override visitPrimitiveValueList(
    method visitParens (line 562) | protected override visitParens(node: ParensNode): void {
    method visitJoin (line 568) | protected override visitJoin(node: JoinNode): void {
    method visitOn (line 579) | protected override visitOn(node: OnNode): void {
    method visitRaw (line 584) | protected override visitRaw(node: RawNode): void {
    method visitOperator (line 596) | protected override visitOperator(node: OperatorNode): void {
    method visitTable (line 600) | protected override visitTable(node: TableNode): void {
    method visitSchemableIdentifier (line 604) | protected override visitSchemableIdentifier(
    method visitCreateTable (line 615) | protected override visitCreateTable(node: CreateTableNode): void {
    method visitColumnDefinition (line 657) | protected override visitColumnDefinition(node: ColumnDefinitionNode): ...
    method getAutoIncrement (line 727) | protected getAutoIncrement(): string {
    method visitReferences (line 731) | protected override visitReferences(node: ReferencesNode): void {
    method visitDropTable (line 749) | protected override visitDropTable(node: DropTableNode): void {
    method visitDataType (line 763) | protected override visitDataType(node: DataTypeNode): void {
    method visitOrderBy (line 767) | protected override visitOrderBy(node: OrderByNode): void {
    method visitOrderByItem (line 772) | protected override visitOrderByItem(node: OrderByItemNode): void {
    method visitGroupBy (line 791) | protected override visitGroupBy(node: GroupByNode): void {
    method visitGroupByItem (line 796) | protected override visitGroupByItem(node: GroupByItemNode): void {
    method visitUpdateQuery (line 800) | protected override visitUpdateQuery(node: UpdateQueryNode): void {
    method visitColumnUpdate (line 890) | protected override visitColumnUpdate(node: ColumnUpdateNode): void {
    method visitLimit (line 896) | protected override visitLimit(node: LimitNode): void {
    method visitOffset (line 901) | protected override visitOffset(node: OffsetNode): void {
    method visitOnConflict (line 906) | protected override visitOnConflict(node: OnConflictNode): void {
    method visitOnDuplicateKey (line 940) | protected override visitOnDuplicateKey(node: OnDuplicateKeyNode): void {
    method visitCreateIndex (line 945) | protected override visitCreateIndex(node: CreateIndexNode): void {
    method visitDropIndex (line 986) | protected override visitDropIndex(node: DropIndexNode): void {
    method visitCreateSchema (line 1005) | protected override visitCreateSchema(node: CreateSchemaNode): void {
    method visitDropSchema (line 1015) | protected override visitDropSchema(node: DropSchemaNode): void {
    method visitPrimaryKeyConstraint (line 1029) | protected override visitPrimaryKeyConstraint(
    method buildDeferrable (line 1045) | protected buildDeferrable(node: {
    method visitUniqueConstraint (line 1066) | protected override visitUniqueConstraint(node: UniqueConstraintNode): ...
    method visitCheckConstraint (line 1086) | protected override visitCheckConstraint(node: CheckConstraintNode): vo...
    method visitForeignKeyConstraint (line 1098) | protected override visitForeignKeyConstraint(
    method visitList (line 1125) | protected override visitList(node: ListNode): void {
    method visitWith (line 1129) | protected override visitWith(node: WithNode): void {
    method visitCommonTableExpression (line 1139) | protected override visitCommonTableExpression(
    method visitCommonTableExpressionName (line 1156) | protected override visitCommonTableExpressionName(
    method visitAlterTable (line 1168) | protected override visitAlterTable(node: AlterTableNode): void {
    method visitAddColumn (line 1208) | protected override visitAddColumn(node: AddColumnNode): void {
    method visitRenameColumn (line 1213) | protected override visitRenameColumn(node: RenameColumnNode): void {
    method visitDropColumn (line 1220) | protected override visitDropColumn(node: DropColumnNode): void {
    method visitAlterColumn (line 1225) | protected override visitAlterColumn(node: AlterColumnNode): void {
    method visitModifyColumn (line 1261) | protected override visitModifyColumn(node: ModifyColumnNode): void {
    method visitAddConstraint (line 1266) | protected override visitAddConstraint(node: AddConstraintNode): void {
    method visitDropConstraint (line 1271) | protected override visitDropConstraint(node: DropConstraintNode): void {
    method visitRenameConstraint (line 1287) | protected override visitRenameConstraint(node: RenameConstraintNode): ...
    method visitSetOperation (line 1294) | protected override visitSetOperation(node: SetOperationNode): void {
    method visitCreateView (line 1305) | protected override visitCreateView(node: CreateViewNode): void {
    method visitRefreshMaterializedView (line 1341) | protected override visitRefreshMaterializedView(
    method visitDropView (line 1359) | protected override visitDropView(node: DropViewNode): void {
    method visitGenerated (line 1379) | protected override visitGenerated(node: GeneratedNode): void {
    method visitDefaultValue (line 1407) | protected override visitDefaultValue(node: DefaultValueNode): void {
    method visitSelectModifier (line 1412) | protected override visitSelectModifier(node: SelectModifierNode): void {
    method visitCreateType (line 1425) | protected override visitCreateType(node: CreateTypeNode): void {
    method visitDropType (line 1435) | protected override visitDropType(node: DropTypeNode): void {
    method visitExplain (line 1445) | protected override visitExplain(node: ExplainNode): void {
    method visitDefaultInsertValue (line 1470) | protected visitDefaultInsertValue(_: DefaultInsertValueNode): void {
    method visitAggregateFunction (line 1474) | protected override visitAggregateFunction(node: AggregateFunctionNode)...
    method visitOver (line 1509) | protected override visitOver(node: OverNode): void {
    method visitPartitionBy (line 1527) | protected override visitPartitionBy(node: PartitionByNode): void {
    method visitPartitionByItem (line 1532) | protected override visitPartitionByItem(node: PartitionByItemNode): vo...
    method visitBinaryOperation (line 1536) | protected override visitBinaryOperation(node: BinaryOperationNode): vo...
    method visitUnaryOperation (line 1544) | protected override visitUnaryOperation(node: UnaryOperationNode): void {
    method isMinusOperator (line 1554) | protected isMinusOperator(node: OperationNode): node is OperatorNode {
    method visitUsing (line 1558) | protected override visitUsing(node: UsingNode): void {
    method visitFunction (line 1563) | protected override visitFunction(node: FunctionNode): void {
    method visitCase (line 1570) | protected override visitCase(node: CaseNode): void {
    method visitWhen (line 1595) | protected override visitWhen(node: WhenNode): void {
    method visitJSONReference (line 1606) | protected override visitJSONReference(node: JSONReferenceNode): void {
    method visitJSONPath (line 1611) | protected override visitJSONPath(node: JSONPathNode): void {
    method visitJSONPathLeg (line 1625) | protected override visitJSONPathLeg(node: JSONPathLegNode): void {
    method visitJSONOperatorChain (line 1641) | protected override visitJSONOperatorChain(node: JSONOperatorChainNode)...
    method visitMergeQuery (line 1653) | protected override visitMergeQuery(node: MergeQueryNode): void {
    method visitMatched (line 1695) | protected override visitMatched(node: MatchedNode): void {
    method visitAddIndex (line 1707) | protected override visitAddIndex(node: AddIndexNode): void {
    method visitCast (line 1730) | protected override visitCast(node: CastNode): void {
    method visitFetch (line 1738) | protected override visitFetch(node: FetchNode): void {
    method visitOutput (line 1744) | protected override visitOutput(node: OutputNode): void {
    method visitTop (line 1749) | protected override visitTop(node: TopNode): void {
    method visitOrAction (line 1757) | protected override visitOrAction(node: OrActionNode): void {
    method visitCollate (line 1761) | protected override visitCollate(node: CollateNode): void {
    method append (line 1766) | protected append(str: string): void {
    method appendValue (line 1770) | protected appendValue(parameter: unknown): void {
    method getLeftIdentifierWrapper (line 1775) | protected getLeftIdentifierWrapper(): string {
    method getRightIdentifierWrapper (line 1779) | protected getRightIdentifierWrapper(): string {
    method getCurrentParameterPlaceholder (line 1783) | protected getCurrentParameterPlaceholder(): string {
    method getLeftExplainOptionsWrapper (line 1787) | protected getLeftExplainOptionsWrapper(): string {
    method getExplainOptionAssignment (line 1791) | protected getExplainOptionAssignment(): string {
    method getExplainOptionsDelimiter (line 1795) | protected getExplainOptionsDelimiter(): string {
    method getRightExplainOptionsWrapper (line 1799) | protected getRightExplainOptionsWrapper(): string {
    method sanitizeIdentifier (line 1803) | protected sanitizeIdentifier(identifier: string): string {
    method sanitizeStringLiteral (line 1821) | protected sanitizeStringLiteral(value: string): string {
    method addParameter (line 1825) | protected addParameter(parameter: unknown): void {
    method appendImmediateValue (line 1829) | protected appendImmediateValue(value: unknown): void {
    method appendStringLiteral (line 1843) | protected appendStringLiteral(value: string): void {
    method sortSelectModifiers (line 1849) | protected sortSelectModifiers(
    method compileColumnAlterations (line 1862) | protected compileColumnAlterations(
    method announcesNewColumnDataType (line 1872) | protected announcesNewColumnDataType(): boolean {
  constant SELECT_MODIFIER_SQL (line 1877) | const SELECT_MODIFIER_SQL: Readonly<Record<SelectModifier, string>> = fr...
  constant SELECT_MODIFIER_PRIORITY (line 1887) | const SELECT_MODIFIER_PRIORITY: Readonly<Record<SelectModifier, number>> =
  constant JOIN_TYPE_SQL (line 1898) | const JOIN_TYPE_SQL: Readonly<Record<JoinType, string>> = freeze({

FILE: src/query-compiler/query-compiler.ts
  type RootOperationNode (line 19) | type RootOperationNode =
  type QueryCompiler (line 39) | interface QueryCompiler {

FILE: src/query-creator.ts
  class QueryCreator (line 51) | class QueryCreator<DB> {
    method constructor (line 54) | constructor(props: QueryCreatorProps) {
    method selectFrom (line 165) | selectFrom<TE extends TableExpressionOrList<DB, never>>(
    method selectNoFrom (line 236) | selectNoFrom<SE extends SelectExpression<DB, never>>(
    method insertInto (line 287) | insertInto<T extends keyof DB & string>(
    method replaceInto (line 336) | replaceInto<T extends keyof DB & string>(
    method deleteFrom (line 399) | deleteFrom<TE extends TableExpressionOrList<DB, never>>(
    method updateTable (line 435) | updateTable<TE extends TableExpressionOrList<DB, never>>(
    method mergeInto (line 531) | mergeInto<TR extends SimpleTableReference<DB>>(
    method with (line 655) | with<N extends string, E extends CommonTableExpression<DB, N>>(
    method withRecursive (line 679) | withRecursive<
    method withPlugin (line 699) | withPlugin(plugin: KyselyPlugin): QueryCreator<DB> {
    method withoutPlugins (line 709) | withoutPlugins(): QueryCreator<DB> {
    method withSchema (line 763) | withSchema(schema: string): QueryCreator<DB> {
  type QueryCreatorProps (line 773) | interface QueryCreatorProps {

FILE: src/query-executor/default-query-executor.ts
  class DefaultQueryExecutor (line 13) | class DefaultQueryExecutor extends QueryExecutorBase {
    method constructor (line 18) | constructor(
    method adapter (line 31) | get adapter(): DialectAdapter {
    method compileQuery (line 35) | compileQuery(node: RootOperationNode, queryId: QueryId): CompiledQuery {
    method provideConnection (line 39) | provideConnection<T>(
    method withPlugins (line 45) | withPlugins(plugins: ReadonlyArray<KyselyPlugin>): DefaultQueryExecutor {
    method withPlugin (line 54) | withPlugin(plugin: KyselyPlugin): DefaultQueryExecutor {
    method withPluginAtFront (line 63) | withPluginAtFront(plugin: KyselyPlugin): DefaultQueryExecutor {
    method withConnectionProvider (line 72) | withConnectionProvider(
    method withoutPlugins (line 83) | withoutPlugins(): DefaultQueryExecutor {

FILE: src/query-executor/noop-query-executor.ts
  class NoopQueryExecutor (line 11) | class NoopQueryExecutor extends QueryExecutorBase {
    method adapter (line 12) | get adapter(): DialectAdapter {
    method compileQuery (line 16) | compileQuery(): CompiledQuery {
    method provideConnection (line 20) | provideConnection<T>(): Promise<T> {
    method withConnectionProvider (line 24) | withConnectionProvider(): NoopQueryExecutor {
    method withPlugin (line 28) | withPlugin(plugin: KyselyPlugin): NoopQueryExecutor {
    method withPlugins (line 32) | withPlugins(plugins: ReadonlyArray<KyselyPlugin>): NoopQueryExecutor {
    method withPluginAtFront (line 36) | withPluginAtFront(plugin: KyselyPlugin): NoopQueryExecutor {
    method withoutPlugins (line 40) | withoutPlugins(): NoopQueryExecutor {
  constant NOOP_QUERY_EXECUTOR (line 45) | const NOOP_QUERY_EXECUTOR: NoopQueryExecutor = new NoopQueryExecutor()

FILE: src/query-executor/query-executor-base.ts
  constant NO_PLUGINS (line 16) | const NO_PLUGINS: ReadonlyArray<KyselyPlugin> = freeze([])
  method constructor (line 21) | constructor(plugins: ReadonlyArray<KyselyPlugin> = NO_PLUGINS) {
  method plugins (line 27) | get plugins(): ReadonlyArray<KyselyPlugin> {
  method transformQuery (line 31) | transformQuery<T extends RootOperationNode>(node: T, queryId: QueryId): T {
  method executeQuery (line 63) | async executeQuery<R>(compiledQuery: CompiledQuery): Promise<QueryResult...
  method stream (line 77) | async *stream<R>(
  method #transformResult (line 104) | async #transformResult<T>(

FILE: src/query-executor/query-executor-provider.ts
  type QueryExecutorProvider (line 7) | interface QueryExecutorProvider {

FILE: src/query-executor/query-executor.ts
  type QueryExecutor (line 15) | interface QueryExecutor extends ConnectionProvider {

FILE: src/raw-builder/raw-builder.ts
  type RawBuilder (line 25) | interface RawBuilder<O> extends AliasableExpression<O> {
  class RawBuilderImpl (line 143) | class RawBuilderImpl<O> implements RawBuilder<O> {
    method constructor (line 146) | constructor(props: RawBuilderProps) {
    method expressionType (line 150) | get expressionType(): O | undefined {
    method isRawBuilder (line 154) | get isRawBuilder(): true {
    method as (line 158) | as(alias: string | Expression<unknown>): AliasedRawBuilder<O, string> {
    method $castTo (line 162) | $castTo<C>(): RawBuilder<C> {
    method $notNull (line 166) | $notNull(): RawBuilder<Exclude<O, null>> {
    method withPlugin (line 170) | withPlugin(plugin: KyselyPlugin): RawBuilder<O> {
    method toOperationNode (line 180) | toOperationNode(): RawNode {
    method compile (line 184) | compile(executorProvider: QueryExecutorProvider): CompiledQuery<O> {
    method execute (line 188) | async execute(
    method #getExecutor (line 196) | #getExecutor(executorProvider?: QueryExecutorProvider): QueryExecutor {
    method #toOperationNode (line 207) | #toOperationNode(executor: QueryExecutor): RawNode {
    method #compile (line 211) | #compile(executor: QueryExecutor): CompiledQuery {
  type RawBuilderProps (line 219) | interface RawBuilderProps {
  function createRawBuilder (line 225) | function createRawBuilder<O>(props: RawBuilderProps): RawBuilder<O> {
  type AliasedRawBuilder (line 232) | interface AliasedRawBuilder<
  class AliasedRawBuilderImpl (line 239) | class AliasedRawBuilderImpl<
    method constructor (line 246) | constructor(rawBuilder: RawBuilder<O>, alias: A | Expression<unknown>) {
    method expression (line 251) | get expression(): Expression<O> {
    method alias (line 255) | get alias(): A | Expression<unknown> {
    method rawBuilder (line 259) | get rawBuilder(): RawBuilder<O> {
    method toOperationNode (line 263) | toOperationNode(): AliasNode {

FILE: src/raw-builder/sql.ts
  type Sql (line 12) | interface Sql {
  method ref (line 406) | ref<R = unknown>(columnReference: string): RawBuilder<R> {
  method val (line 413) | val<V>(value: V): RawBuilder<V> {
  method value (line 420) | value<V>(value: V): RawBuilder<V> {
  method table (line 424) | table<T = unknown>(tableReference: string): RawBuilder<T> {
  method id (line 431) | id<T = unknown>(...ids: readonly string[]): RawBuilder<T> {
  method lit (line 443) | lit<V>(value: V): RawBuilder<V> {
  method literal (line 450) | literal<V>(value: V): RawBuilder<V> {
  method raw (line 454) | raw<R = unknown>(sql: string): RawBuilder<R> {
  method join (line 461) | join<T = unknown>(
  function parseParameter (line 484) | function parseParameter(param: unknown): OperationNode {

FILE: src/schema/alter-column-builder.ts
  class AlterColumnBuilder (line 12) | class AlterColumnBuilder {
    method constructor (line 15) | constructor(column: string) {
    method setDataType (line 19) | setDataType(dataType: DataTypeExpression): AlteredColumnBuilder {
    method setDefault (line 29) | setDefault(value: DefaultValueExpression): AlteredColumnBuilder {
    method dropDefault (line 39) | dropDefault(): AlteredColumnBuilder {
    method setNotNull (line 45) | setNotNull(): AlteredColumnBuilder {
    method dropNotNull (line 51) | dropNotNull(): AlteredColumnBuilder {
    method $call (line 61) | $call<T>(func: (qb: this) => T): T {
  class AlteredColumnBuilder (line 95) | class AlteredColumnBuilder implements OperationNodeSource {
    method constructor (line 98) | constructor(alterColumnNode: AlterColumnNode) {
    method toOperationNode (line 102) | toOperationNode(): AlterColumnNode {
  type AlterColumnBuilderCallback (line 107) | type AlterColumnBuilderCallback = (

FILE: src/schema/alter-table-add-foreign-key-constraint-builder.ts
  class AlterTableAddForeignKeyConstraintBuilder (line 15) | class AlterTableAddForeignKeyConstraintBuilder
    method constructor (line 23) | constructor(props: AlterTableAddForeignKeyConstraintBuilderProps) {
    method onDelete (line 27) | onDelete(
    method onUpdate (line 36) | onUpdate(
    method deferrable (line 45) | deferrable(): AlterTableAddForeignKeyConstraintBuilder {
    method notDeferrable (line 52) | notDeferrable(): AlterTableAddForeignKeyConstraintBuilder {
    method initiallyDeferred (line 59) | initiallyDeferred(): AlterTableAddForeignKeyConstraintBuilder {
    method initiallyImmediate (line 66) | initiallyImmediate(): AlterTableAddForeignKeyConstraintBuilder {
    method $call (line 77) | $call<T>(func: (qb: this) => T): T {
    method toOperationNode (line 81) | toOperationNode(): AlterTableNode {
    method compile (line 92) | compile(): CompiledQuery {
    method execute (line 99) | async execute(): Promise<void> {
  type AlterTableAddForeignKeyConstraintBuilderProps (line 104) | interface AlterTableAddForeignKeyConstraintBuilderProps {

FILE: src/schema/alter-table-add-index-builder.ts
  class AlterTableAddIndexBuilder (line 17) | class AlterTableAddIndexBuilder
    method constructor (line 22) | constructor(props: AlterTableAddIndexBuilderProps) {
    method unique (line 46) | unique(): AlterTableAddIndexBuilder {
    method column (line 80) | column<CL extends string>(
    method columns (line 115) | columns<CL extends string>(
    method expression (line 150) | expression(expression: Expression<any>): AlterTableAddIndexBuilder {
    method using (line 183) | using(indexType: string): AlterTableAddIndexBuilder {
    method $call (line 198) | $call<T>(func: (qb: this) => T): T {
    method toOperationNode (line 202
Condensed preview — 616 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,848K chars).
[
  {
    "path": ".github/workflows/bench.yml",
    "chars": 5827,
    "preview": "name: bench\n\npermissions:\n  contents: read\n\non:\n  push:\n    branches:\n      - master\n    paths-ignore:\n      - '.github/"
  },
  {
    "path": ".github/workflows/compare.yml",
    "chars": 3322,
    "preview": "name: compare llms-full.txt\n\npermissions:\n  contents: read\n\non:\n  pull_request:\n    paths:\n      - '.github/workflows/co"
  },
  {
    "path": ".github/workflows/preview.yml",
    "chars": 1374,
    "preview": "name: preview\n\npermissions:\n  contents: read\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    paths:\n      "
  },
  {
    "path": ".github/workflows/publish.yml",
    "chars": 3497,
    "preview": "# https://docs.npmjs.com/trusted-publishers#github-actions-configuration\nname: publish\n\non:\n  push:\n    tags:\n      - 'v"
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 12490,
    "preview": "name: test\n\npermissions:\n  contents: read\n\non:\n  push:\n    branches:\n      - master\n    paths:\n      - '**/*'\n      - '!"
  },
  {
    "path": ".gitignore",
    "chars": 86,
    "preview": "dist\n/helpers\n/test/browser/bundle.js\nnode_modules\n.vscode\n.idea\ntsconfig.tsbuildinfo\n"
  },
  {
    "path": ".mocharc.js",
    "chars": 78,
    "preview": "const { isCI } = require('std-env')\n\nmodule.exports = {\n  forbidOnly: isCI,\n}\n"
  },
  {
    "path": ".node-version",
    "chars": 3,
    "preview": "22\n"
  },
  {
    "path": ".npmrc",
    "chars": 105,
    "preview": "# so we don't have to `-w` anytime we bump root workspace dependencies.\nignore-workspace-root-check=true\n"
  },
  {
    "path": ".nvmrc",
    "chars": 6,
    "preview": "lts/*\n"
  },
  {
    "path": ".prettierignore",
    "chars": 4,
    "preview": "*.md"
  },
  {
    "path": ".prettierrc.json",
    "chars": 69,
    "preview": "{\n  \"semi\": false,\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 9065,
    "preview": "# ~~Contributor Covenant Code of Conduct~~ Kysely Code of Conduct\n\n## Our Pledge\n\n~~We as members, contributors, and lea"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 8582,
    "preview": "# Contribution Guidelines\n\nWanna contribute to Kysely or other libraries within the [kysely-org](https://github.com/kyse"
  },
  {
    "path": "FUNDING.md",
    "chars": 1005,
    "preview": "# Funding\n\nKysely is an MIT-licensed open-source project and is completely free to use - and will remain so.\n\nKysely is "
  },
  {
    "path": "LICENSE",
    "chars": 1081,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2022 Sami Koskimäki\n\nPermission is hereby granted, free of charge, to any person ob"
  },
  {
    "path": "README.md",
    "chars": 11880,
    "preview": "[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://"
  },
  {
    "path": "SECURITY.md",
    "chars": 2613,
    "preview": "# Security Policy\n\nWe take security seriously. We are responsible maintainers. Kysely is widely used in production and t"
  },
  {
    "path": "deno.check.d.ts",
    "chars": 2300,
    "preview": "import type {\n  ColumnType,\n  Generated,\n  GeneratedAlways,\n  Insertable,\n  Kysely,\n  Selectable,\n  SqlBool,\n  Updateabl"
  },
  {
    "path": "deno.check.json",
    "chars": 698,
    "preview": "{\n  \"$schema\": \"https://deno.land/x/deno/cli/schemas/config-file.v1.json\",\n  \"compilerOptions\": {\n    \"types\": [\"./deno."
  },
  {
    "path": "deno.lint.json",
    "chars": 136,
    "preview": "{\n  \"$schema\": \"https://deno.land/x/deno/cli/schemas/config-file.v1.json\",\n  \"lint\": {\n    \"rules\": {\n      \"tags\": [\"js"
  },
  {
    "path": "docker-compose.yml",
    "chars": 1428,
    "preview": "services:\n  # credit to Knex.js team for the following mssql setup here:\n  mssql:\n    image: mcr.microsoft.com/mssql/ser"
  },
  {
    "path": "docs/index.html",
    "chars": 178,
    "preview": "<!doctype html>\n<html>\n  <head>\n    <meta\n      http-equiv=\"refresh\"\n      content=\"0; url='https://kysely-org.github.io"
  },
  {
    "path": "example/.gitignore",
    "chars": 25,
    "preview": "lib\nnode_modules\n.vscode\n"
  },
  {
    "path": "example/.prettierrc.json",
    "chars": 43,
    "preview": "{\n  \"semi\": false,\n  \"singleQuote\": true\n}\n"
  },
  {
    "path": "example/README.md",
    "chars": 1555,
    "preview": "# An example server that uses Kysely\n\nThis is a simple but realistic Koa based server that shows one way to use Kysely. "
  },
  {
    "path": "example/package.json",
    "chars": 1087,
    "preview": "{\n  \"name\": \"kysely_koa_example\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"b"
  },
  {
    "path": "example/src/app.ts",
    "chars": 2521,
    "preview": "import * as Koa from 'koa'\nimport * as json from 'koa-json'\nimport * as compress from 'koa-compress'\nimport * as bodyPar"
  },
  {
    "path": "example/src/authentication/auth-token.service.ts",
    "chars": 3347,
    "preview": "import * as jwt from 'jsonwebtoken'\nimport * as refreshTokenRepository from './refresh-token.repository'\nimport { Kysely"
  },
  {
    "path": "example/src/authentication/auth-token.ts",
    "chars": 51,
    "preview": "export interface AuthToken {\n  authToken: string\n}\n"
  },
  {
    "path": "example/src/authentication/authentication.service.ts",
    "chars": 1791,
    "preview": "import * as refreshTokenRepository from './refresh-token.repository'\nimport * as authTokenService from './auth-token.ser"
  },
  {
    "path": "example/src/authentication/refresh-token.repository.ts",
    "chars": 1212,
    "preview": "import { Kysely } from 'kysely'\nimport { Database } from '../database'\nimport {\n  RefreshTokenRow,\n  UpdateableRefreshTo"
  },
  {
    "path": "example/src/authentication/refresh-token.table.ts",
    "chars": 424,
    "preview": "import { Generated, Insertable, Selectable, Updateable } from 'kysely'\n\nexport interface RefreshTokenTable {\n  refresh_t"
  },
  {
    "path": "example/src/authentication/refresh-token.ts",
    "chars": 278,
    "preview": "import { ajv } from '../util/ajv'\n\nexport interface RefreshToken {\n  refreshToken: string\n}\n\nexport const validateRefres"
  },
  {
    "path": "example/src/config.ts",
    "chars": 817,
    "preview": "import * as dotenv from 'dotenv'\nimport { ConnectionConfig } from 'pg'\n\ndotenv.config()\n\nexport interface Config {\n  rea"
  },
  {
    "path": "example/src/context.ts",
    "chars": 339,
    "preview": "import * as Koa from 'koa'\nimport * as KoaRouter from 'koa-router'\n\nimport { Kysely } from 'kysely'\nimport { Database } "
  },
  {
    "path": "example/src/database.ts",
    "chars": 467,
    "preview": "import { RefreshTokenTable } from './authentication/refresh-token.table'\nimport { PasswordSignInMethodTable } from './us"
  },
  {
    "path": "example/src/migrate-to-latest.ts",
    "chars": 1070,
    "preview": "import * as path from 'path'\nimport { promises as fs } from 'fs'\nimport { Database } from './database'\nimport { config }"
  },
  {
    "path": "example/src/migrations/2021_09_18_06_54_59_create_user.ts",
    "chars": 580,
    "preview": "import { Kysely, sql } from 'kysely'\n\nexport async function up(db: Kysely<any>): Promise<void> {\n  await db.schema\n    ."
  },
  {
    "path": "example/src/migrations/2021_09_18_14_05_20_create_refresh_token.ts",
    "chars": 821,
    "preview": "import { Kysely, sql } from 'kysely'\n\nexport async function up(db: Kysely<any>): Promise<void> {\n  await db.schema\n    ."
  },
  {
    "path": "example/src/migrations/2021_09_18_18_22_45_create_sign_in_method.ts",
    "chars": 1153,
    "preview": "import { Kysely } from 'kysely'\n\nexport async function up(db: Kysely<any>): Promise<void> {\n  await db.schema\n    .creat"
  },
  {
    "path": "example/src/router.ts",
    "chars": 151,
    "preview": "import * as KoaRouter from 'koa-router'\n\nimport { ContextExtension } from './context'\n\nexport class Router extends KoaRo"
  },
  {
    "path": "example/src/user/sign-in-method/password-sign-in-method.table.ts",
    "chars": 405,
    "preview": "import { Insertable, Selectable, Updateable } from 'kysely'\n\nexport interface PasswordSignInMethodTable {\n  user_id: str"
  },
  {
    "path": "example/src/user/sign-in-method/sign-in-method.controller.ts",
    "chars": 4165,
    "preview": "import * as signInMethodService from './sign-in-method.service'\nimport * as authenticationService from '../../authentica"
  },
  {
    "path": "example/src/user/sign-in-method/sign-in-method.repository.ts",
    "chars": 1030,
    "preview": "import { Kysely } from 'kysely'\nimport { Database } from '../../database'\nimport {\n  InsertablePasswordSignInMethodRow,\n"
  },
  {
    "path": "example/src/user/sign-in-method/sign-in-method.service.ts",
    "chars": 3244,
    "preview": "import * as crypto from 'crypto'\nimport * as signInMethodRepository from './sign-in-method.repository'\nimport * as userS"
  },
  {
    "path": "example/src/user/sign-in-method/sign-in-method.table.ts",
    "chars": 338,
    "preview": "import { Insertable, Selectable, Updateable } from 'kysely'\n\nexport interface SignInMethodTable {\n  user_id: string\n  ty"
  },
  {
    "path": "example/src/user/sign-in-method/sign-in-method.ts",
    "chars": 409,
    "preview": "import { ajv } from '../../util/ajv'\n\nexport type SignInMethod = PasswordSignInMethod\n\nexport interface PasswordSignInMe"
  },
  {
    "path": "example/src/user/signed-in-user.ts",
    "chars": 250,
    "preview": "import { AuthToken } from '../authentication/auth-token'\nimport { RefreshToken } from '../authentication/refresh-token'\n"
  },
  {
    "path": "example/src/user/user.controller.ts",
    "chars": 1378,
    "preview": "import * as userService from './user.service'\nimport * as authenticationService from '../authentication/authentication.s"
  },
  {
    "path": "example/src/user/user.repository.ts",
    "chars": 1483,
    "preview": "import { Kysely, Transaction } from 'kysely'\nimport { Database } from '../database'\nimport { InsertableUserRow, UserRow "
  },
  {
    "path": "example/src/user/user.service.ts",
    "chars": 1928,
    "preview": "import * as userRepository from './user.repository'\nimport * as authTokenService from '../authentication/auth-token.serv"
  },
  {
    "path": "example/src/user/user.table.ts",
    "chars": 393,
    "preview": "import { Generated, Insertable, Selectable, Updateable } from 'kysely'\n\nexport interface UserTable {\n  user_id: Generate"
  },
  {
    "path": "example/src/user/user.ts",
    "chars": 488,
    "preview": "import { ajv } from '../util/ajv'\n\nexport interface User {\n  id: string\n  firstName: string | null\n  lastName: string | "
  },
  {
    "path": "example/src/util/ajv.ts",
    "chars": 52,
    "preview": "import Ajv from 'ajv'\n\nexport const ajv = new Ajv()\n"
  },
  {
    "path": "example/src/util/errors.ts",
    "chars": 1114,
    "preview": "export type AuthenticationErrors =\n  | 'NoUserIdParameter'\n  | 'InvalidAuthorizationHeader'\n  | 'InvalidAuthToken'\n  | '"
  },
  {
    "path": "example/src/util/object.ts",
    "chars": 128,
    "preview": "export function isObject(value: unknown): value is Record<string, any> {\n  return typeof value === 'object' && value !=="
  },
  {
    "path": "example/test/test-config.ts",
    "chars": 531,
    "preview": "import { ConnectionConfig } from 'pg'\nimport { Config } from '../src/config'\n\nexport interface TestConfig extends Config"
  },
  {
    "path": "example/test/test-context.ts",
    "chars": 2120,
    "preview": "import * as path from 'path'\nimport axios from 'axios'\nimport { promises as fs } from 'fs'\nimport {\n  FileMigrationProvi"
  },
  {
    "path": "example/test/user/user.test.ts",
    "chars": 4007,
    "preview": "import { expect } from 'chai'\n\nimport { TestContext } from '../test-context'\nimport { User } from '../../src/user/user'\n"
  },
  {
    "path": "example/tsconfig.json",
    "chars": 203,
    "preview": "{\n  \"compilerOptions\": {\n    \"module\": \"commonjs\",\n    \"target\": \"ESNext\",\n    \"declaration\": true,\n    \"outDir\": \"./dis"
  },
  {
    "path": "jsr.json",
    "chars": 482,
    "preview": "{\n  \"$schema\": \"https://jsr.io/schema/config-file.v1.json\",\n  \"name\": \"@kysely/kysely\",\n  \"version\": \"0.28.14\",\n  \"licen"
  },
  {
    "path": "outdated-typescript.d.ts",
    "chars": 584,
    "preview": "import type { KyselyTypeError } from './dist/cjs/util/type-error'\n\ndeclare const Kysely: KyselyTypeError<'The installed "
  },
  {
    "path": "package.json",
    "chars": 5717,
    "preview": "{\n  \"name\": \"kysely\",\n  \"version\": \"0.28.14\",\n  \"description\": \"Type safe SQL query builder\",\n  \"repository\": {\n    \"typ"
  },
  {
    "path": "pnpm-workspace.yaml",
    "chars": 1411,
    "preview": "packages:\n  - './site'\n  - './test/cloudflare-workers'\n\n# Allow (true) or disallow (false) script execution.\n# https://p"
  },
  {
    "path": "scripts/add-deno-type-references.js",
    "chars": 662,
    "preview": "/**\n * This scripts adds a `/// <reference types=\"./file.d.ts\" />` directive\n * at the beginning of each ESM JavaScript "
  },
  {
    "path": "scripts/align-versions.mts",
    "chars": 795,
    "preview": "/**\n * This script aligns docs site package.json AND jsr versions with\n * Kysely's version so we use only the latest pub"
  },
  {
    "path": "scripts/check-esm-imports.js",
    "chars": 1274,
    "preview": "/**\n * This script goes through all source files and makes sure\n * imports end with '.js'. If they don't, the ESM versio"
  },
  {
    "path": "scripts/check-exports.js",
    "chars": 991,
    "preview": "/**\n * This script ensures all files in a path are exported in the index.ts file.\n * For now it only checks the operatio"
  },
  {
    "path": "scripts/copy-interface-documentation.js",
    "chars": 6435,
    "preview": "/**\n * This script goes through all generated type definition files and copies\n * method/property documentation from int"
  },
  {
    "path": "scripts/exclude-test-files-for-backwards-compat.mts",
    "chars": 1354,
    "preview": "import { unlink } from 'node:fs/promises'\nimport { dirname, resolve } from 'pathe'\nimport { readPackageJSON, readTSConfi"
  },
  {
    "path": "scripts/generate-site-examples.js",
    "chars": 10904,
    "preview": "/**\n * This script goes through all generated type definitions and creates\n * playground examples in the site for all co"
  },
  {
    "path": "scripts/module-fixup.js",
    "chars": 1446,
    "preview": "/**\n * Adds a package.json file to both commonjs and ESM distribution\n * folders with a correct module type. This is nee"
  },
  {
    "path": "scripts/remove-global-augmentations.mts",
    "chars": 1142,
    "preview": "/**\n * This script removes global augmentations so we could publish to JSR.\n * https://github.com/denoland/deno/issues/2"
  },
  {
    "path": "scripts/tsconfig.json",
    "chars": 186,
    "preview": "{\n  \"extends\": \"../tsconfig-base.json\",\n  \"compilerOptions\": {\n    \"allowSyntheticDefaultImports\": true,\n    \"module\": \""
  },
  {
    "path": "scripts/util/for-each-file.js",
    "chars": 458,
    "preview": "const fs = require('fs')\nconst path = require('path')\n\nfunction forEachFile(dir, callback) {\n  const files = fs.readdirS"
  },
  {
    "path": "site/.gitignore",
    "chars": 242,
    "preview": "# Dependencies\n/node_modules\n\n# Production\n/build\n\n# Generated files\n.docusaurus\n.cache-loader\n\n# Misc\n.DS_Store\n.env.lo"
  },
  {
    "path": "site/babel.config.js",
    "chars": 88,
    "preview": "module.exports = {\n  presets: [require.resolve('@docusaurus/core/lib/babel/preset')],\n}\n"
  },
  {
    "path": "site/docs/dialects.md",
    "chars": 3418,
    "preview": "# Dialects\n\nA dialect is the glue between Kysely and the underlying database engine. Check the [API docs](https://kysely"
  },
  {
    "path": "site/docs/examples/_category_.json",
    "chars": 184,
    "preview": "{\n  \"label\": \"Examples\",\n  \"position\": 5,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and simpl"
  },
  {
    "path": "site/docs/examples/cte/0010-simple-selects.js",
    "chars": 635,
    "preview": "export const simpleSelects = `const result = await db\n  // Create a CTE called \\`jennifers\\` that selects all\n  // perso"
  },
  {
    "path": "site/docs/examples/cte/0010-simple-selects.mdx",
    "chars": 650,
    "preview": "---\ntitle: 'Simple selects'\n---\n\n# Simple selects\n\nCommon table expressions (CTE) are a great way to modularize complex "
  },
  {
    "path": "site/docs/examples/cte/0020-inserts-updates-and-deletions.js",
    "chars": 643,
    "preview": "export const insertsUpdatesAndDeletions = `const result = await db\n  .with('new_person', (db) => db\n    .insertInto('per"
  },
  {
    "path": "site/docs/examples/cte/0020-inserts-updates-and-deletions.mdx",
    "chars": 465,
    "preview": "---\ntitle: 'Inserts, updates and deletions'\n---\n\n# Inserts, updates and deletions\n\nSome databases like postgres also all"
  },
  {
    "path": "site/docs/examples/cte/_category_.json",
    "chars": 190,
    "preview": "{\n  \"label\": \"CTE\",\n  \"position\": 9,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and simple exa"
  },
  {
    "path": "site/docs/examples/delete/0010-single-row.js",
    "chars": 162,
    "preview": "export const singleRow = `const result = await db\n  .deleteFrom('person')\n  .where('person.id', '=', 1)\n  .executeTakeFi"
  },
  {
    "path": "site/docs/examples/delete/0010-single-row.mdx",
    "chars": 799,
    "preview": "---\ntitle: 'Single row'\n---\n\n# Single row\n\nDelete a single row:\n\nimport { Playground } from '../../../src/components/Pla"
  },
  {
    "path": "site/docs/examples/delete/_category_.json",
    "chars": 168,
    "preview": "{\n  \"label\": \"DELETE\",\n  \"position\": 6,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and simple "
  },
  {
    "path": "site/docs/examples/insert/0010-single-row.js",
    "chars": 481,
    "preview": "export const singleRow = `const result = await db\n  .insertInto('person')\n  .values({\n    first_name: 'Jennifer',\n    la"
  },
  {
    "path": "site/docs/examples/insert/0010-single-row.mdx",
    "chars": 1011,
    "preview": "---\ntitle: 'Single row'\n---\n\n# Single row\n\nInsert a single row:\n\nimport { Playground } from '../../../src/components/Pla"
  },
  {
    "path": "site/docs/examples/insert/0020-multiple-rows.js",
    "chars": 240,
    "preview": "export const multipleRows = `await db\n  .insertInto('person')\n  .values([{\n    first_name: 'Jennifer',\n    last_name: 'A"
  },
  {
    "path": "site/docs/examples/insert/0020-multiple-rows.mdx",
    "chars": 1299,
    "preview": "---\ntitle: 'Multiple rows'\n---\n\n# Multiple rows\n\nOn dialects that support it (for example PostgreSQL) you can insert mul"
  },
  {
    "path": "site/docs/examples/insert/0030-returning-data.js",
    "chars": 234,
    "preview": "export const returningData = `const result = await db\n  .insertInto('person')\n  .values({\n    first_name: 'Jennifer',\n  "
  },
  {
    "path": "site/docs/examples/insert/0030-returning-data.mdx",
    "chars": 1279,
    "preview": "---\ntitle: 'Returning data'\n---\n\n# Returning data\n\nOn supported dialects like PostgreSQL you need to chain `returning` t"
  },
  {
    "path": "site/docs/examples/insert/0040-complex-values.js",
    "chars": 420,
    "preview": "export const complexValues = `import { sql } from 'kysely'\n\nconst ani = \"Ani\"\nconst ston = \"ston\"\n\nconst result = await "
  },
  {
    "path": "site/docs/examples/insert/0040-complex-values.mdx",
    "chars": 1197,
    "preview": "---\ntitle: 'Complex values'\n---\n\n# Complex values\n\nIn addition to primitives, the values can also be arbitrary expressio"
  },
  {
    "path": "site/docs/examples/insert/0050-insert-subquery.js",
    "chars": 302,
    "preview": "export const insertSubquery = `const result = await db.insertInto('person')\n  .columns(['first_name', 'last_name', 'age'"
  },
  {
    "path": "site/docs/examples/insert/0050-insert-subquery.mdx",
    "chars": 1252,
    "preview": "---\ntitle: 'Insert subquery'\n---\n\n# Insert subquery\n\nYou can create an `INSERT INTO SELECT FROM` query using the `expres"
  },
  {
    "path": "site/docs/examples/insert/_category_.json",
    "chars": 168,
    "preview": "{\n  \"label\": \"INSERT\",\n  \"position\": 4,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and simple "
  },
  {
    "path": "site/docs/examples/join/0010-simple-inner-join.js",
    "chars": 304,
    "preview": "export const simpleInnerJoin = `const result = await db\n  .selectFrom('person')\n  .innerJoin('pet', 'pet.owner_id', 'per"
  },
  {
    "path": "site/docs/examples/join/0010-simple-inner-join.mdx",
    "chars": 1129,
    "preview": "---\ntitle: 'Simple inner join'\n---\n\n# Simple inner join\n\nSimple `inner join`s can be done by providing a table name and "
  },
  {
    "path": "site/docs/examples/join/0020-aliased-inner-join.js",
    "chars": 176,
    "preview": "export const aliasedInnerJoin = `await db.selectFrom('person')\n  .innerJoin('pet as p', 'p.owner_id', 'person.id')\n  .wh"
  },
  {
    "path": "site/docs/examples/join/0020-aliased-inner-join.mdx",
    "chars": 1104,
    "preview": "---\ntitle: 'Aliased inner join'\n---\n\n# Aliased inner join\n\nYou can give an alias for the joined table like this:\n\nimport"
  },
  {
    "path": "site/docs/examples/join/0030-complex-join.js",
    "chars": 323,
    "preview": "export const complexJoin = `await db.selectFrom('person')\n  .innerJoin(\n    'pet',\n    (join) => join\n      .onRef('pet."
  },
  {
    "path": "site/docs/examples/join/0030-complex-join.mdx",
    "chars": 1540,
    "preview": "---\ntitle: 'Complex join'\n---\n\n# Complex join\n\nYou can provide a function as the second argument to get a join\nbuilder f"
  },
  {
    "path": "site/docs/examples/join/0040-subquery-join.js",
    "chars": 336,
    "preview": "export const subqueryJoin = `const result = await db.selectFrom('person')\n  .innerJoin(\n    (eb) => eb\n      .selectFrom"
  },
  {
    "path": "site/docs/examples/join/0040-subquery-join.mdx",
    "chars": 1079,
    "preview": "---\ntitle: 'Subquery join'\n---\n\n# Subquery join\n\nYou can join a subquery by providing two callbacks:\n\nimport { Playgroun"
  },
  {
    "path": "site/docs/examples/join/_category_.json",
    "chars": 144,
    "preview": "{\n  \"label\": \"JOIN\",\n  \"position\": 3,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Examples of queries"
  },
  {
    "path": "site/docs/examples/merge/0010-source-row-existence.js",
    "chars": 393,
    "preview": "export const sourceRowExistence = `const result = await db\n  .mergeInto('person as target')\n  .using('pet as source', 's"
  },
  {
    "path": "site/docs/examples/merge/0010-source-row-existence.mdx",
    "chars": 1647,
    "preview": "---\ntitle: 'Source row existence'\n---\n\n# Source row existence\n\nUpdate a target column based on the existence of a source"
  },
  {
    "path": "site/docs/examples/merge/0020-temporary-changes-table.js",
    "chars": 616,
    "preview": "export const temporaryChangesTable = `const result = await db\n  .mergeInto('wine as target')\n  .using(\n    'wine_stock_c"
  },
  {
    "path": "site/docs/examples/merge/0020-temporary-changes-table.mdx",
    "chars": 1649,
    "preview": "---\ntitle: 'Temporary changes table'\n---\n\n# Temporary changes table\n\nMerge new entries from a temporary changes table:\n\n"
  },
  {
    "path": "site/docs/examples/merge/_category_.json",
    "chars": 166,
    "preview": "{\n  \"label\": \"MERGE\",\n  \"position\": 7,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and simple e"
  },
  {
    "path": "site/docs/examples/select/0010-a-single-column.js",
    "chars": 146,
    "preview": "export const aSingleColumn = `const persons = await db\n  .selectFrom('person')\n  .select('id')\n  .where('first_name', '="
  },
  {
    "path": "site/docs/examples/select/0010-a-single-column.mdx",
    "chars": 933,
    "preview": "---\ntitle: 'A single column'\n---\n\n# A single column\n\nSelect a single column:\n\nimport { Playground } from '../../../src/c"
  },
  {
    "path": "site/docs/examples/select/0020-column-with-a-table.js",
    "chars": 127,
    "preview": "export const columnWithATable = `const persons = await db\n  .selectFrom(['person', 'pet'])\n  .select('person.id')\n  .exe"
  },
  {
    "path": "site/docs/examples/select/0020-column-with-a-table.mdx",
    "chars": 971,
    "preview": "---\ntitle: 'Column with a table'\n---\n\n# Column with a table\n\nSelect a single column and specify a table:\n\nimport { Playg"
  },
  {
    "path": "site/docs/examples/select/0030-multiple-columns.js",
    "chars": 133,
    "preview": "export const multipleColumns = `const persons = await db\n  .selectFrom('person')\n  .select(['person.id', 'first_name'])\n"
  },
  {
    "path": "site/docs/examples/select/0030-multiple-columns.mdx",
    "chars": 941,
    "preview": "---\ntitle: 'Multiple columns'\n---\n\n# Multiple columns\n\nSelect multiple columns:\n\nimport { Playground } from '../../../sr"
  },
  {
    "path": "site/docs/examples/select/0040-aliases.js",
    "chars": 156,
    "preview": "export const aliases = `const persons = await db\n  .selectFrom('person as p')\n  .select([\n    'first_name as fn',\n    'p"
  },
  {
    "path": "site/docs/examples/select/0040-aliases.mdx",
    "chars": 962,
    "preview": "---\ntitle: 'Aliases'\n---\n\n# Aliases\n\nYou can give an alias for selections and tables by appending `as the_alias` to the "
  },
  {
    "path": "site/docs/examples/select/0050-complex-selections.js",
    "chars": 833,
    "preview": "export const complexSelections = `import { sql } from 'kysely'\n\nconst persons = await db.selectFrom('person')\n  .select("
  },
  {
    "path": "site/docs/examples/select/0050-complex-selections.mdx",
    "chars": 1089,
    "preview": "---\ntitle: 'Complex selections'\n---\n\n# Complex selections\n\nYou can select arbitrary expression including subqueries and "
  },
  {
    "path": "site/docs/examples/select/0051-not-null.js",
    "chars": 943,
    "preview": "export const notNull = `import { NotNull } from 'kysely'\nimport { jsonObjectFrom } from 'kysely/helpers/postgres'\n\nconst"
  },
  {
    "path": "site/docs/examples/select/0051-not-null.mdx",
    "chars": 1280,
    "preview": "---\ntitle: 'Not null'\n---\n\n# Not null\n\nSometimes you can be sure something's not null, but Kysely isn't able to infer\nit"
  },
  {
    "path": "site/docs/examples/select/0060-function-calls.js",
    "chars": 1235,
    "preview": "export const functionCalls = `import { sql } from 'kysely'\n\nconst result = await db.selectFrom('person')\n  .innerJoin('p"
  },
  {
    "path": "site/docs/examples/select/0060-function-calls.mdx",
    "chars": 1158,
    "preview": "---\ntitle: 'Function calls'\n---\n\n# Function calls\n\nThis example shows how to create function calls. These examples also "
  },
  {
    "path": "site/docs/examples/select/0070-distinct.js",
    "chars": 122,
    "preview": "export const distinct = `const persons = await db.selectFrom('person')\n  .select('first_name')\n  .distinct()\n  .execute("
  },
  {
    "path": "site/docs/examples/select/0070-distinct.mdx",
    "chars": 877,
    "preview": "---\ntitle: 'Distinct'\n---\n\n# Distinct\n\nimport { Playground } from '../../../src/components/Playground'\n\nimport {\n  disti"
  },
  {
    "path": "site/docs/examples/select/0080-distinct-on.js",
    "chars": 220,
    "preview": "export const distinctOn = `const persons = await db.selectFrom('person')\n  .innerJoin('pet', 'pet.owner_id', 'person.id'"
  },
  {
    "path": "site/docs/examples/select/0080-distinct-on.mdx",
    "chars": 890,
    "preview": "---\ntitle: 'Distinct on'\n---\n\n# Distinct on\n\nimport { Playground } from '../../../src/components/Playground'\n\nimport {\n "
  },
  {
    "path": "site/docs/examples/select/0090-all-columns.js",
    "chars": 104,
    "preview": "export const allColumns = `const persons = await db\n  .selectFrom('person')\n  .selectAll()\n  .execute()`"
  },
  {
    "path": "site/docs/examples/select/0090-all-columns.mdx",
    "chars": 936,
    "preview": "---\ntitle: 'All columns'\n---\n\n# All columns\n\nThe `selectAll` method generates `SELECT *`:\n\nimport { Playground } from '."
  },
  {
    "path": "site/docs/examples/select/0100-all-columns-of-a-table.js",
    "chars": 120,
    "preview": "export const allColumnsOfATable = `const persons = await db\n  .selectFrom('person')\n  .selectAll('person')\n  .execute()`"
  },
  {
    "path": "site/docs/examples/select/0100-all-columns-of-a-table.mdx",
    "chars": 971,
    "preview": "---\ntitle: 'All columns of a table'\n---\n\n# All columns of a table\n\nSelect all columns of a table:\n\nimport { Playground }"
  },
  {
    "path": "site/docs/examples/select/0110-nested-array.js",
    "chars": 375,
    "preview": "export const nestedArray = `import { jsonArrayFrom } from 'kysely/helpers/postgres'\n\nconst result = await db\n  .selectFr"
  },
  {
    "path": "site/docs/examples/select/0110-nested-array.mdx",
    "chars": 1590,
    "preview": "---\ntitle: 'Nested array'\n---\n\n# Nested array\n\nWhile kysely is not an ORM and it doesn't have the concept of relations, "
  },
  {
    "path": "site/docs/examples/select/0120-nested-object.js",
    "chars": 402,
    "preview": "export const nestedObject = `import { jsonObjectFrom } from 'kysely/helpers/postgres'\n\nconst result = await db\n  .select"
  },
  {
    "path": "site/docs/examples/select/0120-nested-object.mdx",
    "chars": 1605,
    "preview": "---\ntitle: 'Nested object'\n---\n\n# Nested object\n\nWhile kysely is not an ORM and it doesn't have the concept of relations"
  },
  {
    "path": "site/docs/examples/select/0130-generic-find-query.js",
    "chars": 623,
    "preview": "export const genericFindQuery = `import { SelectType } from 'kysely'\nimport { Database } from 'type-editor'\n\nasync funct"
  },
  {
    "path": "site/docs/examples/select/0130-generic-find-query.mdx",
    "chars": 997,
    "preview": "---\ntitle: 'Generic find query'\n---\n\n# Generic find query\n\nA generic type-safe helper function for finding a row by a co"
  },
  {
    "path": "site/docs/examples/select/_category_.json",
    "chars": 165,
    "preview": "{\n  \"label\": \"SELECT\",\n  \"position\": 1,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and simple "
  },
  {
    "path": "site/docs/examples/transactions/0010-simple-transaction.js",
    "chars": 496,
    "preview": "export const simpleTransaction = `const catto = await db.transaction().execute(async (trx) => {\n  const jennifer = await"
  },
  {
    "path": "site/docs/examples/transactions/0010-simple-transaction.mdx",
    "chars": 979,
    "preview": "---\ntitle: 'Simple transaction'\n---\n\n# Simple transaction\n\nThis example inserts two rows in a transaction. If an excepti"
  },
  {
    "path": "site/docs/examples/transactions/0011-controlled-transaction.js",
    "chars": 601,
    "preview": "export const controlledTransaction = `const trx = await db.startTransaction().execute()\n\ntry {\n  const jennifer = await "
  },
  {
    "path": "site/docs/examples/transactions/0011-controlled-transaction.mdx",
    "chars": 1018,
    "preview": "---\ntitle: 'Controlled transaction'\n---\n\n# Controlled transaction\n\nA controlled transaction allows you to commit and rol"
  },
  {
    "path": "site/docs/examples/transactions/0012-controlled-transaction-w-savepoints.js",
    "chars": 1085,
    "preview": "export const controlledTransactionWSavepoints = `const trx = await db.startTransaction().execute()\n\ntry {\n  const jennif"
  },
  {
    "path": "site/docs/examples/transactions/0012-controlled-transaction-w-savepoints.mdx",
    "chars": 1235,
    "preview": "---\ntitle: 'Controlled transaction /w savepoints'\n---\n\n# Controlled transaction /w savepoints\n\nA controlled transaction "
  },
  {
    "path": "site/docs/examples/transactions/_category_.json",
    "chars": 170,
    "preview": "{\n  \"label\": \"Transactions\",\n  \"position\": 8,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and s"
  },
  {
    "path": "site/docs/examples/update/0010-single-row.js",
    "chars": 187,
    "preview": "export const singleRow = `const result = await db\n  .updateTable('person')\n  .set({\n    first_name: 'Jennifer',\n    last"
  },
  {
    "path": "site/docs/examples/update/0010-single-row.mdx",
    "chars": 908,
    "preview": "---\ntitle: 'Single row'\n---\n\n# Single row\n\nUpdate a row in `person` table:\n\nimport { Playground } from '../../../src/com"
  },
  {
    "path": "site/docs/examples/update/0020-complex-values.js",
    "chars": 264,
    "preview": "export const complexValues = `const result = await db\n  .updateTable('person')\n  .set((eb) => ({\n    age: eb('age', '+',"
  },
  {
    "path": "site/docs/examples/update/0020-complex-values.mdx",
    "chars": 994,
    "preview": "---\ntitle: 'Complex values'\n---\n\n# Complex values\n\nAs always, you can provide a callback to the `set` method to get acce"
  },
  {
    "path": "site/docs/examples/update/0030-my-sql-joins.js",
    "chars": 265,
    "preview": "export const mySqlJoins = `const result = await db\n  .updateTable(['person', 'pet'])\n  .set('person.first_name', 'Update"
  },
  {
    "path": "site/docs/examples/update/0030-my-sql-joins.mdx",
    "chars": 1452,
    "preview": "---\ntitle: 'MySQL joins'\n---\n\n# MySQL joins\n\nMySQL allows you to join tables directly to the \"main\" table and update\nrow"
  },
  {
    "path": "site/docs/examples/update/_category_.json",
    "chars": 168,
    "preview": "{\n  \"label\": \"UPDATE\",\n  \"position\": 5,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and simple "
  },
  {
    "path": "site/docs/examples/where/0010-simple-where-clause.js",
    "chars": 184,
    "preview": "export const simpleWhereClause = `const person = await db\n  .selectFrom('person')\n  .selectAll()\n  .where('first_name', "
  },
  {
    "path": "site/docs/examples/where/0010-simple-where-clause.mdx",
    "chars": 873,
    "preview": "---\ntitle: 'Simple where clause'\n---\n\n# Simple where clause\n\n`where` method calls are combined with `AND`:\n\nimport { Pla"
  },
  {
    "path": "site/docs/examples/where/0020-where-in.js",
    "chars": 133,
    "preview": "export const whereIn = `const persons = await db\n  .selectFrom('person')\n  .selectAll()\n  .where('id', 'in', [1, 2, 3])\n"
  },
  {
    "path": "site/docs/examples/where/0020-where-in.mdx",
    "chars": 823,
    "preview": "---\ntitle: 'Where in'\n---\n\n# Where in\n\nFind multiple items using a list of identifiers:\n\nimport { Playground } from '../"
  },
  {
    "path": "site/docs/examples/where/0030-object-filter.js",
    "chars": 202,
    "preview": "export const objectFilter = `const persons = await db\n  .selectFrom('person')\n  .selectAll()\n  .where((eb) => eb.and({\n "
  },
  {
    "path": "site/docs/examples/where/0030-object-filter.mdx",
    "chars": 881,
    "preview": "---\ntitle: 'Object filter'\n---\n\n# Object filter\n\nYou can use the `and` function to create a simple equality\nfilter using"
  },
  {
    "path": "site/docs/examples/where/0040-or-where.js",
    "chars": 445,
    "preview": "export const orWhere = `const persons = await db\n  .selectFrom('person')\n  .selectAll()\n  // 1. Using the \\`or\\` method "
  },
  {
    "path": "site/docs/examples/where/0040-or-where.mdx",
    "chars": 923,
    "preview": "---\ntitle: 'OR where'\n---\n\n# OR where\n\nTo combine conditions using `OR`, you can use the expression builder.\nThere are t"
  },
  {
    "path": "site/docs/examples/where/0050-conditional-where-calls.js",
    "chars": 865,
    "preview": "export const conditionalWhereCalls = `import { Expression, SqlBool } from 'kysely'\n\nconst firstName: string | undefined "
  },
  {
    "path": "site/docs/examples/where/0050-conditional-where-calls.mdx",
    "chars": 896,
    "preview": "---\ntitle: 'Conditional where calls'\n---\n\n# Conditional where calls\n\nYou can add expressions conditionally like this:\n\ni"
  },
  {
    "path": "site/docs/examples/where/0060-complex-where-clause.js",
    "chars": 446,
    "preview": "export const complexWhereClause = `const firstName = 'Jennifer'\nconst maxAge = 60\n\nconst persons = await db\n  .selectFro"
  },
  {
    "path": "site/docs/examples/where/0060-complex-where-clause.mdx",
    "chars": 956,
    "preview": "---\ntitle: 'Complex where clause'\n---\n\n# Complex where clause\n\nFor complex `where` expressions you can pass in a single "
  },
  {
    "path": "site/docs/examples/where/_category_.json",
    "chars": 314,
    "preview": "{\n  \"label\": \"WHERE\",\n  \"position\": 2,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Short and simple e"
  },
  {
    "path": "site/docs/execution.mdx",
    "chars": 7660,
    "preview": "---\nsidebar_position: 3\ntitle: 'Execution flow'\n---\n\nThe following page gives a **simplified** overview of Kysely's exec"
  },
  {
    "path": "site/docs/generating-types.md",
    "chars": 1338,
    "preview": "# Generating types\n\nTo work with Kysely, you're required to provide a database schema type definition to the Kysely cons"
  },
  {
    "path": "site/docs/getting-started/Dialects.tsx",
    "chars": 6220,
    "preview": "import Admonition from '@theme/Admonition'\nimport CodeBlock from '@theme/CodeBlock'\nimport Heading from '@theme/Heading'"
  },
  {
    "path": "site/docs/getting-started/IUseADifferentDialect.tsx",
    "chars": 609,
    "preview": "import Link from '@docusaurus/Link'\nimport {\n  DEFAULT_DIALECT,\n  PRETTY_DIALECT_NAMES,\n  type PropsWithDialect,\n} from "
  },
  {
    "path": "site/docs/getting-started/IUseADifferentPackageManager.tsx",
    "chars": 749,
    "preview": "import Link from '@docusaurus/Link'\nimport {\n  DEFAULT_PACKAGE_MANAGER,\n  PRETTY_PACKAGE_MANAGER_NAMES,\n  type PropsWith"
  },
  {
    "path": "site/docs/getting-started/Installation.tsx",
    "chars": 3695,
    "preview": "import type { ReactNode } from 'react'\nimport CodeBlock from '@theme/CodeBlock'\nimport Link from '@docusaurus/Link'\nimpo"
  },
  {
    "path": "site/docs/getting-started/Instantiation.tsx",
    "chars": 6521,
    "preview": "import Admonition from '@theme/Admonition'\nimport CodeBlock from '@theme/CodeBlock'\nimport { IUseADifferentDialect } fro"
  },
  {
    "path": "site/docs/getting-started/Querying.tsx",
    "chars": 4336,
    "preview": "import Admonition from '@theme/Admonition'\nimport CodeBlock from '@theme/CodeBlock'\nimport Link from '@docusaurus/Link'\n"
  },
  {
    "path": "site/docs/getting-started/Summary.tsx",
    "chars": 4816,
    "preview": "import Admonition from '@theme/Admonition'\nimport CodeBlock from '@theme/CodeBlock'\nimport Link from '@docusaurus/Link'\n"
  },
  {
    "path": "site/docs/getting-started/_prerequisites.mdx",
    "chars": 795,
    "preview": "- [TypeScript](https://www.typescriptlang.org/)\n  - Minimum supported version [4.6](https://devblogs.microsoft.com/types"
  },
  {
    "path": "site/docs/getting-started/_types.mdx",
    "chars": 3558,
    "preview": "For Kysely's type-safety and autocompletion to work, it needs to know your\ndatabase structure. This requires a TypeScrip"
  },
  {
    "path": "site/docs/getting-started/shared.tsx",
    "chars": 4614,
    "preview": "import { useLocation } from '@docusaurus/router'\nimport { useEffect, useState, type ReactNode } from 'react'\nimport pack"
  },
  {
    "path": "site/docs/getting-started.mdx",
    "chars": 1091,
    "preview": "---\nsidebar_position: 2\ntitle: 'Getting started'\n---\n\nimport BrowserOnly from '@docusaurus/BrowserOnly'\nimport Prerequis"
  },
  {
    "path": "site/docs/integrations/_category_.json",
    "chars": 184,
    "preview": "{\n  \"label\": \"Integrations\",\n  \"position\": 10,\n  \"link\": {\n    \"type\": \"generated-index\",\n    \"description\": \"Kysely int"
  },
  {
    "path": "site/docs/integrations/llms.mdx",
    "chars": 2230,
    "preview": "# LLMs\n\nKysely provides LLM-friendly documentation to help AI tools like **Cursor**, **Windsurf**, **GitHub Copilot**, *"
  },
  {
    "path": "site/docs/integrations/supabase.mdx",
    "chars": 1808,
    "preview": "# Supabase\n\nSupabase is an open-source Firebase alternative that provides a suite of tools\nfor building applications. At"
  },
  {
    "path": "site/docs/intro.mdx",
    "chars": 1959,
    "preview": "---\nsidebar_position: 1\n---\n\nimport { DemoVideo } from '@site/src/components/DemoVideo'\n\n# Introduction\n\nKysely (pronoun"
  },
  {
    "path": "site/docs/migrations.mdx",
    "chars": 6995,
    "preview": "---\nsidebar_position: 4\n---\n\n# Migrations\n\n## Migration files\n\nMigration files should look like this:\n\n```ts\nimport { Ky"
  },
  {
    "path": "site/docs/playground.mdx",
    "chars": 603,
    "preview": "---\nsidebar_position: 3\n---\n\n# Playground\n\n[@wirekang](https://github.com/wirekang) has created a [playground for Kysely"
  },
  {
    "path": "site/docs/plugins.md",
    "chars": 1101,
    "preview": "# Plugin system\n\nPlugins are classes that implement [KyselyPlugin](https://kysely-org.github.io/kysely-apidoc/interfaces"
  },
  {
    "path": "site/docs/recipes/0001-relations.md",
    "chars": 6038,
    "preview": "# Relations\n\n<h3>\nKysely IS NOT an ORM. Kysely DOES NOT have the concept of relations.\nKysely IS a query builder. Kysely"
  },
  {
    "path": "site/docs/recipes/0001-reusable-helpers.md",
    "chars": 7317,
    "preview": "# Reusable helpers\n\n:::info\n[Here's](https://kyse.link/qm67s) a playground link containing all the code in this recipe.\n"
  },
  {
    "path": "site/docs/recipes/0002-data-types.md",
    "chars": 3475,
    "preview": "# Data types\n\nWhen talking about data types in Kysely we need to make a distinction between the two kinds of types:\n\n1. "
  },
  {
    "path": "site/docs/recipes/0003-raw-sql.md",
    "chars": 201,
    "preview": "# Raw SQL\n\nYou can execute raw SQL strings and pass raw SQL snippets to pretty much any method or function\nusing the [sq"
  },
  {
    "path": "site/docs/recipes/0004-splitting-query-building-and-execution.md",
    "chars": 3333,
    "preview": "# Splitting query building and execution\n\nKysely is primarily a type-safe sql query builder.\n\nIt also does query executi"
  },
  {
    "path": "site/docs/recipes/0005-conditional-selects.md",
    "chars": 3393,
    "preview": "# Conditional selects\n\nSometimes you may want to select some fields based on a runtime condition.\nSomething like this:\n\n"
  },
  {
    "path": "site/docs/recipes/0006-expressions.md",
    "chars": 8836,
    "preview": "# Expressions\n\nAn [`Expression<T>`](https://kysely-org.github.io/kysely-apidoc/interfaces/Expression.html) is the basic "
  },
  {
    "path": "site/docs/recipes/0007-schemas.md",
    "chars": 2793,
    "preview": "# Working with schemas\n\nFirst of all, when we talk about schemas in this document, we mean custom\nschemas like [postgres"
  },
  {
    "path": "site/docs/recipes/0008-deduplicate-joins.md",
    "chars": 2516,
    "preview": "# Deduplicate joins\n\nWhen building dynamic queries, you sometimes end up in situations where the same join\ncould be adde"
  },
  {
    "path": "site/docs/recipes/0009-excessively-deep-types.md",
    "chars": 4266,
    "preview": "# Dealing with the `Type instantiation is excessively deep and possibly infinite` error\n\nKysely uses complex type magic "
  },
  {
    "path": "site/docs/recipes/0010-extending-kysely.md",
    "chars": 11206,
    "preview": "# Extending kysely\n\nIn many cases, Kysely doesn't provide a built-in type-safe method for a feature. It's often because "
  }
]

// ... and 416 more files (download for full content)

About this extraction

This page contains the full source code of the kysely-org/kysely GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 616 files (2.6 MB), approximately 705.7k tokens, and a symbol index with 3234 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!